AuditQueryLogImpl { public QueryAuditEventsResponseType queryAuditEvents(QueryAuditEventsRequestType request) { return getQueryAuditEventResponse( getAuditRepositoryDao().queryByAuditOptions(getEventTypes(request.getEventTypeList()), request.getUserId(), getRemoteHcids(request.getRemoteHcidList()), getRequestDate(request.getEventBeginDate()), getRequestDate(request.getEventEndDate()))); }  QueryAuditEventsResponseType queryAuditEvents(QueryAuditEventsRequestType request); QueryAuditEventsResponseType queryAuditEventsByMessageIdAndRelatesTo(
        QueryAuditEventsRequestByRequestMessageId request); QueryAuditEventsBlobResponse queryAuditEventsById(QueryAuditEventsBlobRequest request);  }
@Test public void testRetrieveAuditsBasedOnUserId() { when(mockSession.createCriteria(AuditRepositoryRecord.class)).thenReturn(mockCriteria); when(mockCriteria.list()).thenReturn(getAuditRepositoryRecordList()); QueryAuditEventsRequestType request = new QueryAuditEventsRequestType(); request.setUserId("testUserId"); QueryAuditEventsResponseType response = auditRetrieve.queryAuditEvents(request); assertEquals("Response Object size mismatch", response.getQueryAuditEventsResults().size(), 1); QueryAuditEventsResults obj = response.getQueryAuditEventsResults().get(0); assertEquals("QueryAuditEventsResults.Direction mismatch", obj.getDirection(), DIRECTION); assertEquals("QueryAuditEventsResults.RemoteHcid mismatch", obj.getRemoteHcid(), REMOTE_HCID); assertEquals("QueryAuditEventsResults.EventType mismatch", obj.getEventType(), EVENT_TYPE); assertEquals("QueryAuditEventsResults.getEventId mismatch", obj.getEventId(), EVENT_ID); assertEquals("QueryAuditEventsResults.RequestMessageId mismatch", obj.getRequestMessageId(), MESSAGE_ID); assertEquals("QueryAuditEventsResults.RelatesTo(mismatch", obj.getRelatesTo(), RELATES_TO); assertEquals("QueryAuditEventsResults.UserId mismatch", obj.getUserId(), USER_ID); assertEquals("QueryAuditEventsResults.id mismatch", obj.getId(), ID.longValue()); assertEquals("QueryAuditEventsResults.EventTimestamp mismatch", obj.getEventTimestamp().toGregorianCalendar().getTime(), EVENT_TIMESTAMP); }