Skip to content

Commit

Permalink
Fixed config parsing.
Browse files Browse the repository at this point in the history
  • Loading branch information
And1sS committed Oct 24, 2024
1 parent ceaeda1 commit c4b7cf5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
1 change: 1 addition & 0 deletions extra/modules/pb-request-correction/src/lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lombok.anyConstructor.addConstructorProperties = true
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import lombok.Builder;
import lombok.Value;

@Value
@Builder
@Value(staticConstructor = "of")
public class Config {

boolean enabled;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ public void isVersionLessThenShouldReturnTrueIfVersionIsLessThanRequired() {
assertThat(VersionUtil.isVersionLessThan("2.2.3", 2, 4, 3)).isTrue();
}

@Test
public void isVersionLessThenShouldReturnFalseIfVersionIsUnparsable() {
// when and then
assertThat(VersionUtil.isVersionLessThan("2.2a.3", 2, 4, 3)).isFalse();
}

@Test
public void isVersionLessThenShouldReturnExpectedResults() {
// major
Expand All @@ -40,8 +34,8 @@ public void isVersionLessThenShouldReturnExpectedResults() {
assertThat(VersionUtil.isVersionLessThan("3", 2, 2, 3)).isFalse();

// minor
assertThat(VersionUtil.isVersionLessThan("0" + MAX_VALUE, 2, 2, 3)).isTrue();
assertThat(VersionUtil.isVersionLessThan("1" + MAX_VALUE, 2, 2, 3)).isTrue();
assertThat(VersionUtil.isVersionLessThan("0." + MAX_VALUE, 2, 2, 3)).isTrue();
assertThat(VersionUtil.isVersionLessThan("1." + MAX_VALUE, 2, 2, 3)).isTrue();
assertThat(VersionUtil.isVersionLessThan("2.0", 2, 2, 3)).isTrue();
assertThat(VersionUtil.isVersionLessThan("2.1", 2, 2, 3)).isTrue();
assertThat(VersionUtil.isVersionLessThan("2.2", 2, 2, 3)).isTrue();
Expand All @@ -51,7 +45,7 @@ public void isVersionLessThenShouldReturnExpectedResults() {
assertThat(VersionUtil.isVersionLessThan("0.%d.%d".formatted(MAX_VALUE, MAX_VALUE), 2, 2, 3)).isTrue();
assertThat(VersionUtil.isVersionLessThan("1.%d.%d".formatted(MAX_VALUE, MAX_VALUE), 2, 2, 3)).isTrue();
assertThat(VersionUtil.isVersionLessThan("2.1." + MAX_VALUE, 2, 2, 3)).isTrue();
assertThat(VersionUtil.isVersionLessThan("2.2.3", 2, 2, 3)).isTrue();
assertThat(VersionUtil.isVersionLessThan("2.2.1", 2, 2, 3)).isTrue();
assertThat(VersionUtil.isVersionLessThan("2.2.2", 2, 2, 3)).isTrue();
assertThat(VersionUtil.isVersionLessThan("2.2.3", 2, 2, 3)).isFalse();
}
Expand Down

0 comments on commit c4b7cf5

Please sign in to comment.