Skip to content

Commit 0391e45

Browse files
committed
remove usages of deprecated org.junit.Assert.assertThat()
1 parent 7167b23 commit 0391e45

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/java/org/junit/rules/ErrorCollector.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.junit.rules;
22

3-
import static org.junit.Assert.assertThat;
43
import static org.junit.Assert.assertThrows;
54

65
import java.util.ArrayList;
@@ -10,6 +9,7 @@
109
import org.junit.function.ThrowingRunnable;
1110
import org.junit.internal.AssumptionViolatedException;
1211
import org.hamcrest.Matcher;
12+
import org.hamcrest.MatcherAssert;
1313
import org.junit.runners.model.MultipleFailureException;
1414

1515
/**
@@ -74,7 +74,7 @@ public <T> void checkThat(final T value, final Matcher<T> matcher) {
7474
public <T> void checkThat(final String reason, final T value, final Matcher<T> matcher) {
7575
checkSucceeds(new Callable<Object>() {
7676
public Object call() throws Exception {
77-
assertThat(reason, value, matcher);
77+
MatcherAssert.assertThat(reason, value, matcher);
7878
return value;
7979
}
8080
});

src/main/java/org/junit/rules/ExpectedException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
import static java.lang.String.format;
44
import static org.hamcrest.CoreMatchers.containsString;
55
import static org.hamcrest.CoreMatchers.instanceOf;
6-
import static org.junit.Assert.assertThat;
76
import static org.junit.Assert.fail;
87
import static org.junit.internal.matchers.ThrowableCauseMatcher.hasCause;
98
import static org.junit.internal.matchers.ThrowableMessageMatcher.hasMessage;
109
import org.hamcrest.Matcher;
10+
import org.hamcrest.MatcherAssert;
1111
import org.hamcrest.StringDescription;
1212
import org.junit.AssumptionViolatedException;
1313
import org.junit.runners.model.Statement;
@@ -268,7 +268,7 @@ public void evaluate() throws Throwable {
268268

269269
private void handleException(Throwable e) throws Throwable {
270270
if (isAnyExceptionExpected()) {
271-
assertThat(e, matcherBuilder.build());
271+
MatcherAssert.assertThat(e, matcherBuilder.build());
272272
} else {
273273
throw e;
274274
}

0 commit comments

Comments
 (0)