use of org.assertj.core.api.recursive.comparison.RecursiveComparisonConfiguration in project hono by eclipse.
the class CredentialsManagementIT method assertResponseBodyContainsAllCredentials.
private static void assertResponseBodyContainsAllCredentials(final JsonArray responseBody, final List<CommonCredential> expected) {
final List<CommonCredential> returnedCreds = responseBody.stream().filter(JsonObject.class::isInstance).map(JsonObject.class::cast).map(json -> json.mapTo(CommonCredential.class)).collect(Collectors.toList());
final RecursiveComparisonConfiguration config = RecursiveComparisonConfiguration.builder().withStrictTypeChecking(true).withIgnoreCollectionOrder(true).withIgnoredFields("secrets.id", "secrets.key", "secrets.passwordHash", "secrets.passwordPlain", "secrets.hashFunction", "secrets.salt").build();
Assertions.assertThat(returnedCreds).usingRecursiveFieldByFieldElementComparator(config).containsExactlyInAnyOrderElementsOf(expected);
}
Aggregations