aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/junit/experimental/results/ResultMatchers.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/junit/experimental/results/ResultMatchers.java')
-rw-r--r--src/main/java/org/junit/experimental/results/ResultMatchers.java35
1 files changed, 3 insertions, 32 deletions
diff --git a/src/main/java/org/junit/experimental/results/ResultMatchers.java b/src/main/java/org/junit/experimental/results/ResultMatchers.java
index 92f2e6b..cf58f1b 100644
--- a/src/main/java/org/junit/experimental/results/ResultMatchers.java
+++ b/src/main/java/org/junit/experimental/results/ResultMatchers.java
@@ -14,15 +14,6 @@ import org.hamcrest.TypeSafeMatcher;
* </pre>
*/
public class ResultMatchers {
-
- /**
- * Do not instantiate.
- * @deprecated will be private soon.
- */
- @Deprecated
- public ResultMatchers() {
- }
-
/**
* Matches if the tests are all successful
*/
@@ -62,33 +53,13 @@ public class ResultMatchers {
}
/**
- * Matches if the result has exactly one failure matching the given matcher.
- *
- * @since 4.13
- */
- public static Matcher<PrintableResult> hasSingleFailureMatching(final Matcher<Throwable> matcher) {
- return new TypeSafeMatcher<PrintableResult>() {
- @Override
- public boolean matchesSafely(PrintableResult item) {
- return item.failureCount() == 1 && matcher.matches(item.failures().get(0).getException());
- }
-
- public void describeTo(Description description) {
- description.appendText("has failure with exception matching ");
- matcher.describeTo(description);
- }
- };
- }
-
- /**
* Matches if the result has one or more failures, and at least one of them
* contains {@code string}
*/
public static Matcher<PrintableResult> hasFailureContaining(final String string) {
- return new TypeSafeMatcher<PrintableResult>() {
- @Override
- public boolean matchesSafely(PrintableResult item) {
- return item.failureCount() > 0 && item.toString().contains(string);
+ return new BaseMatcher<PrintableResult>() {
+ public boolean matches(Object item) {
+ return item.toString().contains(string);
}
public void describeTo(Description description) {