私はjunitExpectedExceptions
のjavadocを閲覧していましたが、それらの例のがどこから来ているのか理解できませんstartsWith
(コードでここにマークされています)。CoreMatcher
ユーティリティクラスを確認しましたが、静的startsWith
メソッドが見つかりませんでした。
そのメソッドはどこにありますか?
(私は明らかにそれを自分で書くことができますが、それは重要ではありません)
public static class HasExpectedException {
@Rule
public ExpectedException thrown = ExpectedException.none();
@Test
public void throwsNullPointerExceptionWithMessage() {
thrown.expect(NullPointerException.class);
thrown.expectMessage("happened?");
thrown.expectMessage(startsWith("What")); //HERE
throw new NullPointerException("What happened?");
}
}