나는 junit ExpectedExceptions
' javadoc을 탐색 중이었고 그 예제에서 startsWith
이 어디서 왔는지 (코드에 표시되어 있음) 이해할 수 없습니다. CoreMatcher
utility class을 확인했지만 정적 startsWith
메서드를 찾을 수 없습니다.JUnit Matcher # 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?");
}
}