TopicAccessManager { public void checkAccessTopic(UserContext ctx, String topic) throws IllegalAccessException { boolean tacPresent0 = checkAccessTopicGlobalAC(ctx, topic); boolean tacPresent1 = checkAccessTopicFromJsTopicControl(ctx, topic); boolean tacPresent2 = checkAccessTopicFromJsTopicControls(ctx, topic); if (logger.isDebugEnabled() && !(tacPresent0 | tacPresent1 | tacPresent2)) { logger.debug("No '{}' access control found in project, add {} implementation annotated with {}({}) in your project for add subscription security.", topic, JsTopicAccessController.class, JsTopicControl.class, topic); } }  void checkAccessTopic(UserContext ctx, String topic);  }
@Test public void checkAccessTopicTest() throws IllegalAccessException { System.out.println("checkAccessTopic"); UserContext userContext = mock(UserContext.class); doReturn(Boolean.TRUE).when(instance).checkAccessTopicGlobalAC(eq(userContext), eq(TOPIC1)); doReturn(Boolean.FALSE).when(instance).checkAccessTopicFromJsTopicControl(eq(userContext), eq(TOPIC1)); doReturn(Boolean.FALSE).when(instance).checkAccessTopicFromJsTopicControls(eq(userContext), eq(TOPIC1)); instance.checkAccessTopic(userContext, TOPIC1); doReturn(Boolean.FALSE).when(instance).checkAccessTopicGlobalAC(eq(userContext), eq(TOPIC1)); doReturn(Boolean.TRUE).when(instance).checkAccessTopicFromJsTopicControl(eq(userContext), eq(TOPIC1)); doReturn(Boolean.FALSE).when(instance).checkAccessTopicFromJsTopicControls(eq(userContext), eq(TOPIC1)); instance.checkAccessTopic(userContext, TOPIC1); doReturn(Boolean.FALSE).when(instance).checkAccessTopicGlobalAC(eq(userContext), eq(TOPIC1)); doReturn(Boolean.FALSE).when(instance).checkAccessTopicFromJsTopicControl(eq(userContext), eq(TOPIC1)); doReturn(Boolean.TRUE).when(instance).checkAccessTopicFromJsTopicControls(eq(userContext), eq(TOPIC1)); instance.checkAccessTopic(userContext, TOPIC1); verify(logger, never()).info(anyString(), any(), any()); }