@Test public void failureIsLoggedIfAceRequiresFailureAudit() throws Exception { when(ace.isAuditFailure()).thenReturn(true); logger.logIfNeeded(false, ace); assertThat(bytes.toString().startsWith("DENIED due to ACE")).isTrue(); }
@Test public void failureIsntLoggedIfAceDoesntRequireFailureAudit() throws Exception { when(ace.isAuditFailure()).thenReturn(false); logger.logIfNeeded(false, ace); assertThat(bytes.size()).isEqualTo(0); }