Skip to content

Commit

Permalink
add more test cases for multipleOf diff
Browse files Browse the repository at this point in the history
  • Loading branch information
DrSatyr committed Feb 12, 2025
1 parent 1bde213 commit ee26246
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,24 @@ public void changeMultipleOfHandling() {
assertThat(changedSchema).isNotNull();
Map<String, ChangedSchema> props = changedSchema.getChangedProperties();
assertThat(props).isNotEmpty();

// Check changes in multipleOf
assertThat(props.get("field1").getMultipleOf().isIncompatible()).isTrue();
assertThat(props.get("field1").getMultipleOf().getLeft()).isEqualTo(BigDecimal.valueOf(10));
assertThat(props.get("field1").getMultipleOf().getRight()).isEqualTo(BigDecimal.valueOf(20));

assertThat(props.get("field2").getMultipleOf().isIncompatible()).isTrue();
assertThat(props.get("field2").getMultipleOf().getLeft()).isEqualTo(BigDecimal.valueOf(0.01));
assertThat(props.get("field2").getMultipleOf().getRight()).isEqualTo(BigDecimal.valueOf(0.1));

// Check addition of multipleOf
assertThat(props.get("field3").getMultipleOf().isIncompatible()).isTrue();
assertThat(props.get("field3").getMultipleOf().getLeft()).isNull();
assertThat(props.get("field3").getMultipleOf().getRight()).isEqualTo(BigDecimal.valueOf(10));

// Check deletion of multipleOf
assertThat(props.get("field4").getMultipleOf().isIncompatible()).isTrue();
assertThat(props.get("field4").getMultipleOf().getLeft()).isEqualTo(BigDecimal.valueOf(10));
assertThat(props.get("field4").getMultipleOf().getRight()).isNull();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ components:
multipleOf: 10
field2:
type: integer
multipleOf: 0.01
multipleOf: 0.01
field3:
type: integer
field4:
type: integer
multipleOf: 10
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ components:
multipleOf: 20
field2:
type: integer
multipleOf: 0.1
multipleOf: 0.1
field3:
type: integer
multipleOf: 10
field4:
type: integer

0 comments on commit ee26246

Please sign in to comment.