Skip to content

Commit

Permalink
HV-1350 Use assertj assertion as it displays the actual value if it f…
Browse files Browse the repository at this point in the history
…ails
  • Loading branch information
gsmet committed Jun 23, 2017
1 parent 4d937ce commit 0062ce9
Showing 1 changed file with 1 addition and 7 deletions.
Expand Up @@ -7,7 +7,6 @@
package org.hibernate.validator.testutil;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;

import java.lang.annotation.Annotation;
Expand All @@ -19,7 +18,6 @@
import java.util.stream.Collectors;

import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import javax.validation.ElementKind;
import javax.validation.Path;
import javax.validation.metadata.ConstraintDescriptor;
Expand Down Expand Up @@ -90,17 +88,13 @@ public static ConstraintViolationSetAssert assertThat(Set<? extends ConstraintVi
return new ConstraintViolationSetAssert( actualViolations );
}

public static void assertCorrectPropertyPaths(ConstraintViolationException e, String... expectedPropertyPaths) {
assertCorrectPropertyPaths( e.getConstraintViolations(), expectedPropertyPaths );
}

/**
* Asserts that the given violation list has no violations (is empty).
*
* @param violations The violation list to verify.
*/
public static void assertNoViolations(Set<? extends ConstraintViolation<?>> violations) {
assertTrue( violations.isEmpty(), "Should not have constraint violations" );
Assertions.assertThat( violations ).isEmpty();
}

public static void assertConstraintTypes(Set<? extends ConstraintDescriptor<?>> descriptors,
Expand Down

0 comments on commit 0062ce9

Please sign in to comment.