PatientCorrelationServiceUnsecured implements
gov.hhs.fha.nhinc.nhinccomponentpatientcorrelation.PatientCorrelationPortType { @Override public RetrievePatientCorrelationsResponseType retrievePatientCorrelations( RetrievePatientCorrelationsRequestType retrievePatientCorrelationsRequest) { AssertionType assertionType = SAML2AssertionExtractor.getInstance().extractSamlAssertion(context); if (retrievePatientCorrelationsRequest != null && retrievePatientCorrelationsRequest.getAssertion() != null) { retrievePatientCorrelationsRequest.getAssertion().setMessageId(createMessageId(context)); } return service.retrievePatientCorrelations(retrievePatientCorrelationsRequest, assertionType); } PatientCorrelationServiceUnsecured();  PatientCorrelationServiceUnsecured(
        PatientCorrelationServiceFactory<RetrievePatientCorrelationsRequestType, RetrievePatientCorrelationsResponseType, AddPatientCorrelationRequestType, AddPatientCorrelationResponseType> factory); @Override RetrievePatientCorrelationsResponseType retrievePatientCorrelations(
        RetrievePatientCorrelationsRequestType retrievePatientCorrelationsRequest); @Override AddPatientCorrelationResponseType addPatientCorrelation(
        AddPatientCorrelationRequestType addPatientCorrelationRequest); @Override SimplePatientCorrelationResponseType addPatientCorrelationPLQ(AddPatientCorrelationPLQRequestType request);  }
@Test public void retrievePatientCorrelation() { final RetrievePatientCorrelationsRequestType request = new RetrievePatientCorrelationsRequestType(); final RetrievePatientCorrelationsResponseType expectedResponse = new RetrievePatientCorrelationsResponseType(); context.checking(new Expectations() { { oneOf(mockFactory).createPatientCorrelationService(); will(returnValue(mockService)); oneOf(mockService).retrievePatientCorrelations(with(same(request)), with(aNull(AssertionType.class))); will(returnValue(expectedResponse)); } }); PatientCorrelationServiceUnsecured serviceUnderTest = new PatientCorrelationServiceUnsecured(mockFactory); RetrievePatientCorrelationsResponseType actualResponse = serviceUnderTest.retrievePatientCorrelations(request); assertSame(expectedResponse, actualResponse); }