}
private MockControl mockAuditLogs( String action, List<String> resources )
{
MockControl control = MockControl.createControl( AuditListener.class );
AuditListener listener = (AuditListener) control.getMock();
boolean matcherSet = false;
for ( String resource : resources )
{
listener.auditEvent( new AuditEvent( REPOSITORY_ID, "guest", resource, action ) );
if ( !matcherSet )
{
control.setMatcher( new AuditEventArgumentsMatcher() );
matcherSet = true;
}