use of org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.lcm.SubmitObjectsRequest in project ipf by oehf.
the class Ebrs30MarshalingTest method verifyExtraMetadataWithJaxbBinding.
@Test
public void verifyExtraMetadataWithJaxbBinding() throws Exception {
var file = new File(getClass().getClassLoader().getResource("SubmitObjectsRequest_ebrs3_extra_metadata.xml").toURI());
var unmarshaller = context.createUnmarshaller();
unmarshaller.setListener(new XdsJaxbDataBinding().getUnmarshallerListener());
var unmarshalled = unmarshaller.unmarshal(file);
var original = (SubmitObjectsRequest) unmarshalled;
int numberOfSlotsInFirstDoc = new EbXMLSubmitObjectsRequest30(original).getExtrinsicObjects().get(0).getSlots().size();
var marshaller = context.createMarshaller();
marshaller.setListener(new XdsJaxbDataBinding().getMarshallerListener());
StringWriter writer = new StringWriter();
marshaller.marshal(original, writer);
var unmarshalledSecond = (SubmitObjectsRequest) unmarshaller.unmarshal(new StringReader(writer.toString()));
int numberOfSlotsInSecondDoc = new EbXMLSubmitObjectsRequest30(unmarshalledSecond).getExtrinsicObjects().get(0).getSlots().size();
assertEquals(numberOfSlotsInFirstDoc, numberOfSlotsInSecondDoc, "Number of slots after Marshalling and Unmarsshalling does not match");
}
use of org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.lcm.SubmitObjectsRequest in project ipf by oehf.
the class CxfFeatureTest method testFeatureEndpointWithPolicy.
@Disabled("fails with java 9")
@Test
public void testFeatureEndpointWithPolicy() {
var bf = new SpringBusFactory();
var bus = bf.createBus("feature-test-resources/client-context.xml");
SpringBusFactory.setDefaultBus(bus);
SpringBusFactory.setThreadDefaultBus(bus);
var client = getClient("feature-test-resources/iti42-with-policy.wsdl", "http://localhost:" + getPort() + "/xds-iti42");
var requestContext = ((BindingProvider) client).getRequestContext();
// STSClient stsClient = (STSClient) requestContext.get(SecurityConstants.STS_CLIENT);
var stsClient = (STSClient) requestContext.get("ws-security.sts.client");
stsClient.setWsdlLocation("http://localhost:" + getPort() + "/X509?wsdl");
try {
client.documentRegistryRegisterDocumentSetB(new SubmitObjectsRequest());
} catch (SOAPFaultException ex) {
// ex.printStackTrace();
fail();
} finally {
SpringBusFactory.setThreadDefaultBus(null);
SpringBusFactory.setDefaultBus(null);
}
}
use of org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.lcm.SubmitObjectsRequest in project ipf by oehf.
the class XdsSubmitAuditStrategy30 method enrichAuditDatasetFromRequest.
@Override
public XdsSubmitAuditDataset enrichAuditDatasetFromRequest(XdsSubmitAuditDataset auditDataset, Object pojo, Map<String, Object> parameters) {
if (pojo instanceof SubmitObjectsRequest) {
var submitObjectsRequest = (SubmitObjectsRequest) pojo;
EbXMLSubmitObjectsRequest ebXML = new EbXMLSubmitObjectsRequest30(submitObjectsRequest);
enrichDatasetFromSubmitObjectsRequest(auditDataset, ebXML);
}
return auditDataset;
}
use of org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.lcm.SubmitObjectsRequest in project ipf by oehf.
the class Ebrs30MarshalingTest method testFromRealEbXML.
@Test
public void testFromRealEbXML() throws Exception {
var file = new File(getClass().getClassLoader().getResource("SubmitObjectsRequest_ebrs30.xml").toURI());
var unmarshaller = context.createUnmarshaller();
var unmarshalled = unmarshaller.unmarshal(file);
var original = (SubmitObjectsRequest) unmarshalled;
var transformer = new RegisterDocumentSetTransformer(factory);
var result = transformer.fromEbXML(new EbXMLSubmitObjectsRequest30(original));
var documentEntry = result.getDocumentEntries().get(0);
assertEquals("Document01", documentEntry.getEntryUuid());
assertEquals(DocumentEntryType.STABLE, documentEntry.getType());
assertEquals("Gerald Smitty", documentEntry.getAuthors().get(0).getAuthorPerson().getId().getId());
var submissionSet = result.getSubmissionSet();
assertEquals("SubmissionSet01", submissionSet.getEntryUuid());
assertEquals(1, submissionSet.getAuthors().size());
assertEquals("Sherry Dopplemeyer", submissionSet.getAuthors().get(0).getAuthorPerson().getId().getId());
assertEquals(result.getAssociations().get(0).getAssociationType(), AssociationType.HAS_MEMBER);
assertEquals(result.getAssociations().get(1).getAssociationType(), AssociationType.IS_SNAPSHOT_OF);
}
use of org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.lcm.SubmitObjectsRequest in project ipf by oehf.
the class Ebrs30MarshalingTest method setUp.
@BeforeEach
public void setUp() throws JAXBException {
factory = new EbXMLFactory30();
objectLibrary = factory.createObjectLibrary();
context = JAXBContext.newInstance("org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rs");
request = new SubmitObjectsRequest();
var objListElement = new RegistryObjectListType();
request.setRegistryObjectList(objListElement);
var objList = objListElement.getIdentifiable();
docEntry = factory.createExtrinsic("Document01", objectLibrary);
docEntry.setObjectType(DocumentEntryType.STABLE.getUuid());
objList.add(new ObjectFactory().createExtrinsicObject(((EbXMLExtrinsicObject30) docEntry).getInternal()));
}
Aggregations