@@ -144,7 +144,7 @@ public void changeMultipleOfHandling() {
144
144
assertThat (props .get ("field4" ).getMultipleOf ().getRight ()).isNull ();
145
145
}
146
146
147
- @ Test // issues #480
147
+ @ Test // issues #480 and #779
148
148
public void changeMinMaxItemsHandling () {
149
149
ChangedOpenApi changedOpenApi =
150
150
OpenApiCompare .fromLocations (
@@ -158,6 +158,9 @@ public void changeMinMaxItemsHandling() {
158
158
Map <String , ChangedSchema > props = changedSchema .getChangedProperties ();
159
159
assertThat (props ).isNotEmpty ();
160
160
161
+ // Check no changes in minItems and maxItems
162
+ assertThat (props .get ("field0" )).isNull ();
163
+
161
164
// Check increasing of minItems
162
165
assertThat (props .get ("field1" ).getMinItems ().isIncompatible ()).isTrue ();
163
166
assertThat (props .get ("field1" ).getMinItems ().getOldValue ()).isEqualTo (1 );
@@ -177,6 +180,26 @@ public void changeMinMaxItemsHandling() {
177
180
assertThat (props .get ("field4" ).getMaxItems ().isIncompatible ()).isTrue ();
178
181
assertThat (props .get ("field4" ).getMaxItems ().getOldValue ()).isEqualTo (100 );
179
182
assertThat (props .get ("field4" ).getMaxItems ().getNewValue ()).isEqualTo (90 );
183
+
184
+ // Check removal of minItems
185
+ assertThat (props .get ("field5" ).getMinItems ().isCompatible ()).isTrue ();
186
+ assertThat (props .get ("field5" ).getMinItems ().getOldValue ()).isEqualTo (1 );
187
+ assertThat (props .get ("field5" ).getMinItems ().getNewValue ()).isNull ();
188
+
189
+ // Check removal of maxItems
190
+ assertThat (props .get ("field5" ).getMaxItems ().isCompatible ()).isTrue ();
191
+ assertThat (props .get ("field5" ).getMaxItems ().getOldValue ()).isEqualTo (100 );
192
+ assertThat (props .get ("field5" ).getMaxItems ().getNewValue ()).isNull ();
193
+
194
+ // Check addition of minItems
195
+ assertThat (props .get ("field6" ).getMinItems ().isCompatible ()).isTrue ();
196
+ assertThat (props .get ("field6" ).getMinItems ().getOldValue ()).isNull ();
197
+ assertThat (props .get ("field6" ).getMinItems ().getNewValue ()).isEqualTo (1 );
198
+
199
+ // Check addition of maxItems
200
+ assertThat (props .get ("field6" ).getMaxItems ().isCompatible ()).isTrue ();
201
+ assertThat (props .get ("field6" ).getMaxItems ().getOldValue ()).isNull ();
202
+ assertThat (props .get ("field6" ).getMaxItems ().getNewValue ()).isEqualTo (100 );
180
203
}
181
204
182
205
@ Test // issue #482
0 commit comments