PixOperationsServiceImpl implements PixOperationsService { @Override public MCCIIN000002UV01 addPatientRegistryRecord(String c32xml) { final PixOperation pixOperation = PixOperation.ADD; return pidFeed(pixOperation, c32xml); }  @Override MCCIIN000002UV01 addPatientRegistryRecord(String c32xml); @Override String addPerson(String reqXMLPath); SimpleMarshaller getMarshaller(); XdsbRepositoryService getXdsbRepository(); XmlAttributeSetter getXmlAttributeSetter(); @Override RegistryResponse provideAndRegisterClinicalDocument(String c32xml); @Override PixManagerBean queryPerson(String xmlFilePath); @Override MCCIIN000002UV01 revisePatientRegistryRecord(String c32xml); void setMarshaller(SimpleMarshaller marshaller); void setPixManagerTransformService(
			PixManagerTransformService pixManagerTransformService); void setPixMgrService(PixManagerService pixMgrService); void setRequestXMLToJava(PixManagerRequestXMLToJava requestXMLToJava); void setXdsbRegistryGetter(XdsbRegistryGetter xdsbRegistryGetter); void setXdsbRepository(XdsbRepositoryService xdsbRepository); void setXmlAttributeSetter(XmlAttributeSetter xmlAttributeSetter); @Override String updatePatientAndAuthorId(String c32xml); @Override String updatePerson(String reqXMLPath);  }
@Test public void testAddPatientRegistryRecord() throws Throwable { final String c32XmlMock = "c32XmlMock"; final String hl7v3XmlMock = "hl7v3XmlMock"; final String eIdMock = "eIdMock"; final String addMsgMock = "addMsgMock"; final MCCIIN000002UV01 expectedResponseMock = mock(MCCIIN000002UV01.class); final Map<String, String> queryMapMock = new HashMap<String, String>(); queryMapMock.put(PixManagerConstants.GLOBAL_DOMAIN_ID, eIdMock); sut.setPixManagerTransformService(pixManagerTransformServiceMock); sut.setPixMgrService(pixMgrServiceMock); sut.setRequestXMLToJava(requestXMLToJavaMock); sut.setPixManagerTransformService(pixManagerTransformServiceMock); sut.setXdsbRegistryGetter(xdsbRegistryGetterMock); sut.setMarshaller(marshallerMock); when( pixManagerTransformServiceMock.getPixXml(PixOperation.QUERY, c32XmlMock)).thenReturn(hl7v3XmlMock); when( pixManagerTransformServiceMock.getPixXml(PixOperation.ADD, c32XmlMock)).thenReturn(hl7v3XmlMock); when( xdsbRegistryGetterMock.pidFeed(PixOperation.ADD, hl7v3XmlMock, eIdMock, PixManagerConstants.GLOBAL_DOMAIN_ID)) .thenReturn(addMsgMock); when( marshallerMock.unmarshalFromXml(MCCIIN000002UV01.class, addMsgMock)).thenReturn(expectedResponseMock); when(pixMgrBeanMock.getQueryIdMap()).thenReturn(queryMapMock); doReturn(pixMgrBeanMock).when(sut).queryPerson(hl7v3XmlMock); final MCCIIN000002UV01 actRetResponse = sut .addPatientRegistryRecord(c32XmlMock); assertEquals(expectedResponseMock, actRetResponse); }