use of org.javers.core.diff.Diff in project fhir-bridge by ehrbase.
the class ClinicalTrialParticipationIT method testMapping.
@Override
public void testMapping(String resourcePath, String paragonPath) throws IOException {
Observation observation = (Observation) super.testFileLoader.loadResource(resourcePath);
ClinicalTrialParticipationCompositionConverter clinicalTrialParticipationCompositionConverter = new ClinicalTrialParticipationCompositionConverter();
GECCOStudienteilnahmeComposition mapped = clinicalTrialParticipationCompositionConverter.convert(observation);
Diff diff = compareCompositions(getJavers(), paragonPath, mapped);
assertEquals(0, diff.getChanges().size());
}
use of org.javers.core.diff.Diff in project fhir-bridge by ehrbase.
the class QuestionnaireResponseIT method testMapping.
@Override
public void testMapping(String resourcePath, String paragonPath) throws IOException {
QuestionnaireResponse resource = (QuestionnaireResponse) super.testFileLoader.loadResource(resourcePath);
D4lQuestionnaireCompositionConverter d4lQuestionnaireCompositionConverter = new D4lQuestionnaireCompositionConverter();
D4LQuestionnaireComposition mappedD4LQuestionnaireComposition = d4lQuestionnaireCompositionConverter.convert(resource);
Diff diff = compareCompositions(getJavers(), paragonPath, mappedD4LQuestionnaireComposition);
assertEquals(0, diff.getChanges().size());
}
use of org.javers.core.diff.Diff in project fhir-bridge by ehrbase.
the class GenericTherapyIT method testMapping.
public void testMapping(String resourcePath, String paragonPath) throws IOException {
Procedure procedure = (Procedure) super.testFileLoader.loadResource(resourcePath);
TherapyCompositionConverter therapyCompositionConverter = new TherapyCompositionConverter();
GECCOProzedurComposition mappedProzedurComposition = therapyCompositionConverter.convert(procedure);
Diff diff = compareCompositions(getJavers(), paragonPath, mappedProzedurComposition);
assertEquals(diff.getChanges().size(), 0);
}
use of org.javers.core.diff.Diff in project fhir-bridge by ehrbase.
the class SmokingstatusIT method testMapping.
@Override
public void testMapping(String resourcePath, String paragonPath) throws IOException {
Observation observation = (Observation) super.testFileLoader.loadResource(resourcePath);
RaucherstatusCompositionConverter raucherstatusCompositionConverter = new RaucherstatusCompositionConverter();
RaucherstatusComposition mapped = raucherstatusCompositionConverter.convert(observation);
Diff diff = compareCompositions(getJavers(), paragonPath, mapped);
assertEquals(0, diff.getChanges().size());
}
use of org.javers.core.diff.Diff in project jag-pcss-civil by bcgov.
the class TestService method compare.
public <T, G> boolean compare(T response, G request) {
Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
DualProtocolSaajSoapMessageFactory saajSoapMessageFactory = new DualProtocolSaajSoapMessageFactory();
saajSoapMessageFactory.setSoapVersion(SoapVersion.SOAP_12);
saajSoapMessageFactory.afterPropertiesSet();
HttpComponentsMessageSender httpComponentsMessageSender = new HttpComponentsMessageSender();
httpComponentsMessageSender.setCredentials(new UsernamePasswordCredentials(username, password));
webServiceTemplate.setMessageSender(webServiceSenderWithAuth);
webServiceTemplate.setMessageFactory(saajSoapMessageFactory);
jaxb2Marshaller.setContextPaths("ca.bc.gov.open.pcss.one", "ca.bc.gov.open.pcss.three");
webServiceTemplate.setMarshaller(jaxb2Marshaller);
webServiceTemplate.setUnmarshaller(jaxb2Marshaller);
webServiceTemplate.afterPropertiesSet();
T resultObjectWM = null;
T resultObjectAPI = null;
try {
resultObjectWM = (T) webServiceTemplate.marshalSendAndReceive(wmHost, request);
resultObjectAPI = (T) webServiceTemplate.marshalSendAndReceive(apiHost, request);
Thread.sleep(5000);
} catch (Exception e) {
System.out.println("ERROR: Failed to send request... " + e);
fileOutput.println("ERROR: Failed to send request... " + e);
}
Diff diff = javers.compare(resultObjectAPI, resultObjectWM);
String responseClassName = response.getClass().getName();
if (diff.hasChanges()) {
printDiff(diff);
return false;
} else {
if (resultObjectAPI == null && resultObjectWM == null)
System.out.println("WARN: " + responseClassName.substring(responseClassName.lastIndexOf('.') + 1) + ": NULL responses");
else
System.out.println("INFO: " + responseClassName.substring(responseClassName.lastIndexOf('.') + 1) + ": No Diff Detected");
return true;
}
}
Aggregations