-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Allow null value. boolean <-> Boolean error #605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -180,25 +180,25 @@ public void withDockerTlsVerify() throws Exception { | |
| field.setAccessible(true); | ||
|
|
||
| builder.withDockerTlsVerify(""); | ||
| assertThat(field.getBoolean(builder), is(false)); | ||
| assertThat((Boolean) field.get(builder), is(false)); | ||
|
|
||
| builder.withDockerTlsVerify("false"); | ||
| assertThat(field.getBoolean(builder), is(false)); | ||
| assertThat((Boolean) field.get(builder), is(false)); | ||
|
|
||
| builder.withDockerTlsVerify("FALSE"); | ||
| assertThat(field.getBoolean(builder), is(false)); | ||
| assertThat((Boolean) field.get(builder), is(false)); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. btw, why not move setters directly into class, then getters would work?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, don't get it...
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. field is object, getBoolean() works only with primitive |
||
|
|
||
| builder.withDockerTlsVerify("true"); | ||
| assertThat(field.getBoolean(builder), is(true)); | ||
| assertThat((Boolean) field.get(builder), is(true)); | ||
|
|
||
| builder.withDockerTlsVerify("TRUE"); | ||
| assertThat(field.getBoolean(builder), is(true)); | ||
| assertThat((Boolean) field.get(builder), is(true)); | ||
|
|
||
| builder.withDockerTlsVerify("0"); | ||
| assertThat(field.getBoolean(builder), is(false)); | ||
| assertThat((Boolean) field.get(builder), is(false)); | ||
|
|
||
| builder.withDockerTlsVerify("1"); | ||
| assertThat(field.getBoolean(builder), is(true)); | ||
| assertThat((Boolean) field.get(builder), is(true)); | ||
| } | ||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
either setter should use boolean. If
null- then docker-java default.