MessageGeneratorUtils { public AssertionType clone(AssertionType assertion) { QName qName = new QName(NHINC_COMMON_URN, "Assertion"); Marshaller marshaller = new Marshaller(); Element jaxbElement = marshaller.marshal(assertion, NHINC_COMMON_CONTEXT, qName); return (AssertionType) marshaller.unmarshallJaxbElement(jaxbElement, NHINC_COMMON_CONTEXT); } protected  MessageGeneratorUtils(); static MessageGeneratorUtils getInstance(); NhinTargetSystemType convertFirstToNhinTargetSystemType(NhinTargetCommunitiesType targets); NhinTargetSystemType convertToNhinTargetSystemType(NhinTargetCommunityType target); AssertionType clone(AssertionType assertion); AssertionType cloneWithNewMsgId(AssertionType assertion); AdhocQueryRequest clone(AdhocQueryRequest adhocQueryRequest); PRPAIN201305UV02 clone(PRPAIN201305UV02 request); AssertionType generateMessageId(AssertionType assertion); RegistryResponseType createRegistryErrorResponse(String errorMsg, String errorCode, String status); RegistryResponseType createFailedPolicyCheckResponse(); RegistryResponseType createRegistryErrorResponse(); XDRAcknowledgementType createXDRAckWithRegistryErrorResponse(); RegistryResponseType createMissingDocumentRegistryResponse(); RegistryResponseType createRegistryErrorResponseWithAckFailure(String errorMsg); RegistryResponseType createRegistryBusyErrorResponse(String errorMsg); XDRAcknowledgementType createRegistryErrorXDRAcknowledgementType(String errorMsg); XDRAcknowledgementType createMissingDocumentXDRAcknowledgementType(); XDRAcknowledgementType createFailedPolicyCheckXDRAcknowledgementType(); RegistryResponseType createRegistryResponseSuccess();  }
@Test public void cloneAssertion() { AssertionType assertion = new AssertionType(); assertion.setMessageId("11111"); AssertionType copyAssertion = msgUtils.clone(assertion); assertion.setMessageId("22222"); assertEquals("11111", copyAssertion.getMessageId()); }
@Test public void cloneAdhocQueryRequest() { AdhocQueryRequest request = new AdhocQueryRequest(); request.setId("11111"); AdhocQueryRequest clonedRequest = msgUtils.clone(request); request.setId("22222"); assertEquals("11111", clonedRequest.getId()); }
@Test public void clonePRPAIN201305UV02() { PRPAIN201305UV02 request = new PRPAIN201305UV02(); request.setITSVersion("11111"); PRPAIN201305UV02 clonedRequest = msgUtils.clone(request); request.setITSVersion("22222"); assertEquals("11111", clonedRequest.getITSVersion()); }