7
7
import static org .junit .Assert .fail ;
8
8
import static org .junit .internal .matchers .ThrowableCauseMatcher .hasCause ;
9
9
import static org .junit .internal .matchers .ThrowableMessageMatcher .hasMessage ;
10
-
11
10
import org .hamcrest .Matcher ;
12
11
import org .hamcrest .StringDescription ;
13
12
import org .junit .AssumptionViolatedException ;
@@ -168,7 +167,10 @@ public Statement apply(Statement base,
168
167
* thrown.expect(is(e));
169
168
* throw e;
170
169
* }</pre>
170
+ *
171
+ * @deprecated use {@code org.hamcrest.junit.ExpectedException.expect()}
171
172
*/
173
+ @ Deprecated
172
174
public void expect (Matcher <?> matcher ) {
173
175
matcherBuilder .add (matcher );
174
176
}
@@ -207,7 +209,10 @@ public void expectMessage(String substring) {
207
209
* thrown.expectMessage(startsWith("What"));
208
210
* throw new NullPointerException("What happened?");
209
211
* }</pre>
212
+ *
213
+ * @deprecated use {@code org.hamcrest.junit.ExpectedException.expectMessage()}
210
214
*/
215
+ @ Deprecated
211
216
public void expectMessage (Matcher <String > matcher ) {
212
217
expect (hasMessage (matcher ));
213
218
}
@@ -221,7 +226,10 @@ public void expectMessage(Matcher<String> matcher) {
221
226
* thrown.expectCause(is(expectedCause));
222
227
* throw new IllegalArgumentException("What happened?", cause);
223
228
* }</pre>
229
+ *
230
+ * @deprecated use {@code org.hamcrest.junit.ExpectedException.expectCause()}
224
231
*/
232
+ @ Deprecated
225
233
public void expectCause (Matcher <? extends Throwable > expectedCause ) {
226
234
expect (hasCause (expectedCause ));
227
235
}
0 commit comments