我们可以使用什么断言来代替verifyException()

随 测试交流评论67字数 1120阅读模式
摘要我正在编写测试,但我没有填写我可以使用什么断言来代替verifyException() public void test0()抛出可丢弃的{ CustomHeaderInterce...

我正在编写测试,但我没有填写我可以使用什么断言来代替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

玩技站长微信
添加好友自动发送入群邀请
weinxin
rainbow-shownow
玩技官方公众号
官方微信公众号
weinxin
PLAYEZU
 
  • 版权提示:本站仅供存储任何法律责任由作者承担▷诈骗举报◁▷新闻不符◁▷我要投稿◁
    风险通知:非原创文章均为网络投稿真实性无法判断,侵权联系2523030730
    免责声明:内容来自用户上传发布或新闻客户端自媒体,切勿!切勿!切勿!添加联系方式以免受骗。
  • 原创转载:https://www.playezu.com/181068.html
    转载说明: 点我前往阅读>>>
匿名

发表评论

匿名网友
确定