TestBLOBHandler.java 文件源码

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

项目:flume-release-1.7.0 作者:
@SuppressWarnings({ "rawtypes" })
@Test(expected = IllegalArgumentException.class)
public void testMissingParameters() throws Exception {
  Map requestParameterMap = new HashMap();

  HttpServletRequest req = mock(HttpServletRequest.class);
  final String tabData = "a\tb\tc";

  ServletInputStream servletInputStream = new DelegatingServletInputStream(
      new ByteArrayInputStream(tabData.getBytes()));

  when(req.getInputStream()).thenReturn(servletInputStream);
  when(req.getParameterMap()).thenReturn(requestParameterMap);

  Context context = mock(Context.class);
  when(
      context.getString(BLOBHandler.MANDATORY_PARAMETERS,
          BLOBHandler.DEFAULT_MANDATORY_PARAMETERS)).thenReturn("param1");

  handler.configure(context);

  handler.getEvents(req);

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号