Source:
<code>public void transformRequestToAuditMsg() throws ConnectionManagerException, UnknownHostException, JAXBException { <START> DocDataSubmissionAuditTransforms transforms = new DocDataSubmissionAuditTransforms() { <END> @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; } }; RegisterDocumentSetRequestType request = createRegisterDocumentSetRequestType(); 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 ServiceName mismatch", auditRequest.getEventType(), NhincConstants.NHINC_XDR_SERVICE_NAME); }</code><technical_language>Duplicated code. extracted a constructor method. Duplicated line 118</technical_language>

Target:
public void transformRequestToAuditMsg() throws ConnectionManagerException, UnknownHostException, JAXBException { DocDataSubmissionAuditTransforms transforms = makeTransformer(); RegisterDocumentSetRequestType request = createRegisterDocumentSetRequestType(); 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 ServiceName mismatch", auditRequest.getEventType(), NhincConstants.NHINC_XDR_SERVICE_NAME); }