-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Milestone
Description
Test code:
@Test
public void withDockerTlsVerify() throws Exception {
DockerClientConfig.DockerClientConfigBuilder builder = new DockerClientConfig.DockerClientConfigBuilder();
// throw a IllegalArgumentException
builder.withDockerTlsVerify("");
// throw a IllegalArgumentException
builder.withDockerTlsVerify("false");
}Exception:
java.lang.IllegalArgumentException: The String did not match either specified value
at org.apache.commons.lang.BooleanUtils.toBoolean(BooleanUtils.java:763)
at com.github.dockerjava.core.DockerClientConfig$DockerClientConfigBuilder.withDockerTlsVerify(DockerClientConfig.java:421)
at com.github.dockerjava.core.DockerClientConfigTest.withDockerTlsVerify(DockerClientConfigTest.java:183)
...
Problem code:
com.github.dockerjava.core.DockerClientConfig.DockerClientConfigBuilder#withDockerTlsVerify(java.lang.String)
public final DockerClientConfigBuilder withDockerTlsVerify(String dockerTlsVerify) {
// The simplest way is to catch IllegalArgumentException and set false to dockerTlsVerify
this.dockerTlsVerify = BooleanUtils.toBoolean(dockerTlsVerify.trim())
|| BooleanUtils.toBoolean(dockerTlsVerify.trim(), "1", "0");
return this;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels