LoggingInterceptorTest.java 文件源码

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

项目:GitHub 作者:
@Test
public void testLogArray() throws Exception {

    final TiLog.Logger logger = mock(TiLog.Logger.class);
    final LoggingInterceptor loggingInterceptor = new LoggingInterceptor(logger);
    final TestView view = loggingInterceptor.intercept(new TestViewImpl());

    final ArgumentCaptor<String> msgCaptor = ArgumentCaptor.forClass(String.class);

    final String[] array = new String[]{"Buenos Aires", "Córdoba", "La Plata"};
    view.twoArgs(array, "B");
    verify(logger).log(anyInt(), anyString(), msgCaptor.capture());

    assertThat(msgCaptor.getValue())
            .matches("twoArgs\\(\\{String\\[\\]\\[3\\]@[\\da-f]{1,8}\\} \\"
                    + "[Buenos Aires, Córdoba, La Plata\\], B\\)");
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号