### Question:
FlowEngineAuditProcessor { public FlowEngineAuditEvent getEvent(String methodName, String retVal, FlowEngineDomain domain, OperationType operation) { log.debug("getEvent for operation " + methodName + " and return value " + retVal); String userId = getUserId(domain); FlowEngineAuditEventBuilder builder = FlowEngineAuditEvent.builder(); ResultOperationType resultOperation = null; String message = null; if (!"OK".equals(retVal)) { builder.message(retVal); message = retVal; resultOperation = ResultOperationType.ERROR; } else { message = "Executed operation " + methodName + " for domain " + domain.getDomain() + " by user " + userId; resultOperation = ResultOperationType.SUCCESS; } return getEvent(domain.getDomain(), userId, operation, message, resultOperation); }  String getUserId(String domainId); String getUserId(FlowEngineDomain domain); FlowEngineAuditEvent getEvent(String methodName, String retVal, FlowEngineDomain domain,
			OperationType operation); FlowEngineAuditEvent getEvent(String methodName, String domainId, OperationType operation); FlowEngineAuditEvent getQueryEvent(String ontology, String query, String queryType, String retVal,
			String domainName); FlowEngineAuditEvent getInsertEvent(String ontology, String data, String retVal, String domainName); FlowEngineAuditEvent getEvent(String ontology, String query, String queryType, String data, String message,
			String domainName, OperationType operation); FlowEngineAuditEvent getEvent(String domain, String user, OperationType operation, String message,
			ResultOperationType result); OPAuditError getErrorEvent(String methodName, FlowEngineDomain domain, Exception ex); OPAuditError getErrorEvent(String message, String domainName, Exception ex); OPAuditError getErrorEvent(String method, String message, String domain, Exception ex); OPAuditError createErrorEvent(String userId, String message, Exception ex);  }### Answer:
@Test public void given_get_event_incorrect_credentials() { when(domainService.getFlowDomainById(DOMAIN_ID)).thenThrow(new NotAuthorizedException("")); FlowEngineAuditEvent event = flowEngineAuditProcessor.getEvent(ONTOLOGY_ID, "", QueryType.NATIVE.name(), null, "message", DOMAIN_ID, OperationType.QUERY); Assert.assertNull(event); }