### Question:
AbstractTextAccessLogPublisher extends AccessLogPublisher<T> { protected final boolean isResponseLoggable(final Operation o) { return filter.isResponseLoggable(o); }  @Override final void close(); @Override final DN getDN();  }### Answer:
@Test public void testCriteriaFilterResponseEtimeGreaterThan() throws Exception { final AccessLogFilteringCriteriaCfg cfg = mockCriteriaFilterCfg(); when(cfg.getResponseEtimeGreaterThan()).thenReturn(100); final CriteriaFilter filter = new CriteriaFilter(cfg); final SearchOperation operation = mockAnonymousSearchOperation(); when(operation.getProcessingTime()).thenReturn(50L, 150L); assertThat(filter.isResponseLoggable(operation)).isFalse(); assertThat(filter.isResponseLoggable(operation)).isTrue(); }
@Test public void testCriteriaFilterResponseEtimeLessThan() throws Exception { final AccessLogFilteringCriteriaCfg cfg = mockCriteriaFilterCfg(); when(cfg.getResponseEtimeLessThan()).thenReturn(100); final CriteriaFilter filter = new CriteriaFilter(cfg); final SearchOperation operation = mockAnonymousSearchOperation(); when(operation.getProcessingTime()).thenReturn(50L, 150L); assertThat(filter.isResponseLoggable(operation)).isTrue(); assertThat(filter.isResponseLoggable(operation)).isFalse(); }
@Test public void testCriteriaFilterResponseResultCodeEqualTo() throws Exception { final AccessLogFilteringCriteriaCfg cfg = mockCriteriaFilterCfg(); when(cfg.getResponseResultCodeEqualTo()).thenReturn(newTreeSet(32)); final CriteriaFilter filter = new CriteriaFilter(cfg); final SearchOperation operation = mockAnonymousSearchOperation(); when(operation.getResultCode()).thenReturn(ResultCode.NO_SUCH_OBJECT, ResultCode.SUCCESS); assertThat(filter.isResponseLoggable(operation)).isTrue(); assertThat(filter.isResponseLoggable(operation)).isFalse(); }
@Test public void testCriteriaFilterResponseResultCodeNotEqualTo() throws Exception { final AccessLogFilteringCriteriaCfg cfg = mockCriteriaFilterCfg(); when(cfg.getResponseResultCodeNotEqualTo()).thenReturn(newTreeSet(32)); final CriteriaFilter filter = new CriteriaFilter(cfg); final SearchOperation operation = mockAnonymousSearchOperation(); when(operation.getResultCode()).thenReturn(ResultCode.NO_SUCH_OBJECT, ResultCode.SUCCESS); assertThat(filter.isResponseLoggable(operation)).isFalse(); assertThat(filter.isResponseLoggable(operation)).isTrue(); }