我正在编写测试,但我没有填写我可以使用什么断言来代替verifyException()
public void test0() throws Throwable {
CustomHeaderInterceptor customHeaderInterceptor0 = new CustomHeaderInterceptor();
Stack<String> stack0 = new Stack<String>();
Enumeration<String> enumeration0 = stack0.elements();
HttpServletRequest httpServletRequest0 = mock(HttpServletRequest.class);
doReturn((-1548)).when(httpServletRequest0).getContentLength();
doReturn("HtW").when(httpServletRequest0).getContentType();
doReturn(enumeration0).when(httpServletRequest0).getHeaderNames();
ServletServerHttpRequest servletServerHttpRequest0 = new ServletServerHttpRequest(httpServletRequest0);
ClientHttpRequestExecution clientHttpRequestExecution0 = mock(ClientHttpRequestExecution.class);
// Undeclared exception!
try {
customHeaderInterceptor0.intercept(servletServerHttpRequest0, (byte[]) null, clientHttpRequestExecution0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException(“com.zapstich.shared.util.http.CustomHeaderInterceptor”,e);
}
}
而不是 verifyException(“com.zapstich.shared.util.http.CustomHeaderInterceptor”,e);
我可以使用什么断言?请帮帮我。文章源自玩技e族-https://www.playezu.com/181068.html 文章源自玩技e族-https://www.playezu.com/181068.html
评论