Skip to content

Commit

Permalink
chore(#2058): add tests and fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
SteKoe committed Jul 1, 2022
1 parent ab05b73 commit 568d102
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ public final class BuildVersion implements Serializable, Comparable<BuildVersion
private final String value;

private BuildVersion(String value) {
if(!StringUtils.hasText(value)) {
if (!StringUtils.hasText(value)) {
this.value = DEFAULT_VERSION;
} else {
}
else {
this.value = value;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class BuildVersionTest {

@Test
public void should_return_version() {
assertThat(BuildVersion.valueOf(null).getValue()).isEqualTo("UNKNOWN");
assertThat(BuildVersion.from(emptyMap())).isNull();
assertThat(BuildVersion.from(singletonMap("version", "1.0.0"))).isEqualTo(BuildVersion.valueOf("1.0.0"));
assertThat(BuildVersion.from(singletonMap("build.version", "1.0.0"))).isEqualTo(BuildVersion.valueOf("1.0.0"));
Expand Down

0 comments on commit 568d102

Please sign in to comment.