Skip to content

Commit f69ea37

Browse files
RugvedBRugved0103
andauthored
Fixed multipleSchemaDepViolation test failure by swapping (#500)
Co-authored-by: bongale2 <[email protected]>
1 parent 7dbae50 commit f69ea37

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

core/src/test/java/org/everit/json/schema/ObjectSchemaTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,14 @@ public void multipleSchemaDepViolation() {
143143
ageFailure = tmp;
144144
}
145145
ValidationException billingAddressFailure = creditCardFailure.getCausingExceptions().get(0);
146+
ValidationException billingNameFailure = creditCardFailure.getCausingExceptions().get(1);
147+
if(billingAddressFailure.getPointerToViolation().equals("#/billing_name")) {
148+
ValidationException tmp = billingAddressFailure;
149+
billingAddressFailure = billingNameFailure;
150+
billingNameFailure = tmp;
151+
}
146152
assertEquals("#/billing_address", billingAddressFailure.getPointerToViolation());
147153
assertEquals(billingAddressSchema, billingAddressFailure.getViolatedSchema());
148-
ValidationException billingNameFailure = creditCardFailure
149-
.getCausingExceptions().get(1);
150154
assertEquals("#/billing_name", billingNameFailure.getPointerToViolation());
151155
assertEquals(billingNameSchema, billingNameFailure.getViolatedSchema());
152156
assertEquals("#", ageFailure.getPointerToViolation());

0 commit comments

Comments
 (0)