HttpServletRequestAdapterTest.java 文件源码

java
阅读 12 收藏 0 点赞 0 评论 0

项目:opengse 作者:
@Test
public void testSetCharacterEncoding_allowsExceptionToPassBack()
    throws UnsupportedEncodingException {
  final UnsupportedEncodingException expected
      = new UnsupportedEncodingException();
  mockSubset.setCharacterEncoding(EasyMock.eq(VALUE));
  EasyMock.expectLastCall().andThrow(expected);
  EasyMock.replay(mockSubset);
  try {
    adapter.setCharacterEncoding(VALUE);
    fail("Should pass exception through");
  } catch (UnsupportedEncodingException actual) {
    assertThat(actual, sameInstance(expected));
  }
  EasyMock.verify(mockSubset);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号