ac.setProxyUsername( proxyUsername );
ac.setRemoteIp( remoteIp );
ac.setRemoteHostname( remoteHostname );
ac.setTargetServiceName( targetServiceName );
CorrelationContext cc = correlationService.createContext();
cc.setRequestId( UUID.randomUUID().toString() );
cc.setParentRequestId( UUID.randomUUID().toString() );
cc.setRootRequestId( UUID.randomUUID().toString() );
auditor.audit( "action", "resource", "resource type", "outcome", "message" );
auditService.detachContext();
correlationService.detachContext();
assertThat( CollectAppender.queue.size(), is( 1 ) );
LoggingEvent event = CollectAppender.queue.iterator().next();
checkLogEventContexts( event, cc, ac );
CollectAppender.queue.clear();
ac = auditService.createContext();
ac.setUsername( username + "1" );
ac.setProxyUsername( proxyUsername + "1" );
ac.setRemoteIp( remoteIp + "1" );
ac.setRemoteHostname( remoteHostname + "1" );
ac.setTargetServiceName( targetServiceName + "1" );
cc = correlationService.createContext();
cc.setRequestId( UUID.randomUUID().toString() );
cc.setParentRequestId( UUID.randomUUID().toString() );
cc.setRootRequestId( UUID.randomUUID().toString() );
auditor.audit( "action", "resource", "resource type", "outcome", "message" );
auditService.detachContext();
correlationService.detachContext();