Source:
public void transformRequestToAuditMsg() throws ConnectionManagerException, UnknownHostException, JAXBException { DocSubmissionAuditTransforms transforms = new DocSubmissionAuditTransforms() { @Override protected String getLocalHostAddress() { return LOCAL_IP; } @Override protected String getRemoteHostAddress(Properties webContextProeprties) { if (webContextProeprties != null && !webContextProeprties.isEmpty() && webContextProeprties. getProperty(NhincConstants.REMOTE_HOST_ADDRESS) != null) { return webContextProeprties.getProperty(NhincConstants.REMOTE_HOST_ADDRESS); } return AuditTransformsConstants.ACTIVE_PARTICIPANT_UNKNOWN_IP_ADDRESS; } @Override protected String getWebServiceUrlFromRemoteObject(NhinTargetSystemType target, String serviceName) { return WS_REQUEST_URL; } }; ProvideAndRegisterDocumentSetRequestType request = createProvideAndRegisterDocumentSetRequestType(); AssertionType assertion = createAssertion(); LogEventRequestType auditRequest = transforms.transformRequestToAuditMsg(request, assertion, createNhinTarget(), NhincConstants.AUDIT_LOG_INBOUND_DIRECTION, NhincConstants.AUDIT_LOG_NHIN_INTERFACE, Boolean.TRUE, null, NhincConstants.NHINC_XDR_SERVICE_NAME); testGetEventIdentificationType(auditRequest, NhincConstants.NHINC_XDR_SERVICE_NAME, Boolean.TRUE); testCreateActiveParticipantFromUser(auditRequest, Boolean.TRUE, assertion); testGetActiveParticipantDestination(auditRequest, Boolean.TRUE, null, WS_REQUEST_URL, REMOTE_IP); testAuditSourceIdentification(auditRequest.getAuditMessage().getAuditSourceIdentification(), assertion); testGetActiveParticipantSource(auditRequest, Boolean.TRUE, null, LOCAL_IP); assertParticipantObjectIdentification(auditRequest.getAuditMessage()); }

Target:
public void transformRequestToAuditMsg() throws ConnectionManagerException, UnknownHostException, JAXBException { DocSubmissionAuditTransforms transforms = new DocSubmissionAuditTransforms() { @Override protected String getLocalHostAddress() { return LOCAL_IP; } @Override protected String getRemoteHostAddress(Properties webContextProeprties) { if (webContextProeprties != null && !webContextProeprties.isEmpty() && webContextProeprties. getProperty(NhincConstants.REMOTE_HOST_ADDRESS) != null) { return webContextProeprties.getProperty(NhincConstants.REMOTE_HOST_ADDRESS); } return AuditTransformsConstants.ACTIVE_PARTICIPANT_UNKNOWN_IP_ADDRESS; } @Override protected String getWebServiceUrlFromRemoteObject(NhinTargetSystemType target, String serviceName) { return WS_REQUEST_URL; } }; ProvideAndRegisterDocumentSetRequestType request = createProvideAndRegisterDocumentSetRequestType(); AssertionType assertion = createAssertion(); LogEventRequestType auditRequest = transforms.transformRequestToAuditMsg(request, assertion, createNhinTarget(), NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION, NhincConstants.AUDIT_LOG_NHIN_INTERFACE, Boolean.TRUE, null, NhincConstants.NHINC_XDR_SERVICE_NAME); testGetEventIdentificationType(auditRequest, NhincConstants.NHINC_XDR_SERVICE_NAME, Boolean.TRUE); testCreateActiveParticipantFromUser(auditRequest, Boolean.TRUE, assertion); testGetActiveParticipantDestination(auditRequest, Boolean.TRUE, null, WS_REQUEST_URL, REMOTE_IP); testAuditSourceIdentification(auditRequest.getAuditMessage().getAuditSourceIdentification(), assertion); testGetActiveParticipantSource(auditRequest, Boolean.TRUE, null, LOCAL_IP); assertParticipantObjectIdentification(auditRequest.getAuditMessage()); assertEquals("AuditMessage.Request direction mismatch", auditRequest.getDirection(), NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION); assertEquals("AuditMessage.Request interface mismatch", auditRequest.getInterface(), NhincConstants.AUDIT_LOG_NHIN_INTERFACE); }