|
14 | 14 |
|
15 | 15 | import static org.hamcrest.CoreMatchers.is;
|
16 | 16 | import static org.hamcrest.MatcherAssert.assertThat;
|
| 17 | +import static org.hamcrest.Matchers.containsInAnyOrder; |
17 | 18 | import static org.mockito.ArgumentMatchers.any;
|
18 | 19 | import static org.mockito.Mockito.*;
|
19 | 20 |
|
@@ -268,7 +269,7 @@ public void assertValidationThrowsExceptionContainingMessagesForAllRequiredConfi
|
268 | 269 | params.put(DECIMAL_REQUIRED_PARAM_NAME, null);
|
269 | 270 | ConfigValidationException exception = Assertions.assertThrows(ConfigValidationException.class,
|
270 | 271 | () -> configDescriptionValidator.validate(params, CONFIG_DESCRIPTION_URI));
|
271 |
| - assertThat(getConfigValidationMessages(exception), is(expected)); |
| 272 | + assertThat(getConfigValidationMessages(exception), containsInAnyOrder(expected.toArray())); |
272 | 273 | }
|
273 | 274 |
|
274 | 275 | void assertMissingRequired(String parameterName) {
|
@@ -352,7 +353,7 @@ public void assertValidationThrowsExceptionContainingMessagesForAllMinMaxConfigP
|
352 | 353 | params.put(DECIMAL_MAX_PARAM_NAME, DECIMAL_MAX_VIOLATED);
|
353 | 354 | ConfigValidationException exception = Assertions.assertThrows(ConfigValidationException.class,
|
354 | 355 | () -> configDescriptionValidator.validate(params, CONFIG_DESCRIPTION_URI));
|
355 |
| - assertThat(getConfigValidationMessages(exception), is(expected)); |
| 356 | + assertThat(getConfigValidationMessages(exception), containsInAnyOrder(expected.toArray())); |
356 | 357 | }
|
357 | 358 |
|
358 | 359 | void assertMinMax(String parameterName, Object value, MessageKey msgKey, String minMax) {
|
@@ -405,7 +406,7 @@ public void assertValidationThrowsExceptionContainingMessagesForMultipleInvalidT
|
405 | 406 | params.put(DECIMAL_PARAM_NAME, INVALID);
|
406 | 407 | ConfigValidationException exception = Assertions.assertThrows(ConfigValidationException.class,
|
407 | 408 | () -> configDescriptionValidator.validate(params, CONFIG_DESCRIPTION_URI));
|
408 |
| - assertThat(getConfigValidationMessages(exception), is(expected)); |
| 409 | + assertThat(getConfigValidationMessages(exception), containsInAnyOrder(expected.toArray())); |
409 | 410 | }
|
410 | 411 |
|
411 | 412 | void assertType(String parameterName, Type type) {
|
@@ -513,7 +514,7 @@ public void assertValidationThrowsExceptionContainingMultipleVariousViolations()
|
513 | 514 | params.put(DECIMAL_MAX_PARAM_NAME, DECIMAL_MAX_VIOLATED);
|
514 | 515 | ConfigValidationException exception = Assertions.assertThrows(ConfigValidationException.class,
|
515 | 516 | () -> configDescriptionValidator.validate(params, CONFIG_DESCRIPTION_URI));
|
516 |
| - assertThat(getConfigValidationMessages(exception), is(expected)); |
| 517 | + assertThat(getConfigValidationMessages(exception), containsInAnyOrder(expected.toArray())); |
517 | 518 | }
|
518 | 519 |
|
519 | 520 | @Test
|
|
0 commit comments