use of oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryPackageType in project ddf by codice.
the class RegistryReportBuilderTest method getRegistryPackageFromResource.
private RegistryPackageType getRegistryPackageFromResource(String path) throws ParserException {
RegistryPackageType registryPackage = null;
JAXBElement<RegistryPackageType> jaxbRegistryObject = parser.unmarshal(configurator, JAXBElement.class, getClass().getResourceAsStream(path));
if (jaxbRegistryObject != null) {
registryPackage = jaxbRegistryObject.getValue();
}
return registryPackage;
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryPackageType in project ddf by codice.
the class RegistryPackageTypeHelperTest method testGetExtrinsicObjectTypesFromRegistryObjectList.
@Test
public void testGetExtrinsicObjectTypesFromRegistryObjectList() throws Exception {
RegistryObjectListType registryObjectList = ((RegistryPackageType) registryObject).getRegistryObjectList();
List<ExtrinsicObjectType> extrinsicObjects = rptHelper.getExtrinsicObjects(registryObjectList);
assertExtrinsicObjects(extrinsicObjects);
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryPackageType in project ddf by codice.
the class RegistryPackageTypeHelperTest method testGetObjectsAssociatedToServiceFromRegistryObjectList.
@Test
public void testGetObjectsAssociatedToServiceFromRegistryObjectList() throws Exception {
String testServiceId = "urn:service:id0";
RegistryObjectListType registryObjectList = ((RegistryPackageType) registryObject).getRegistryObjectList();
List<OrganizationType> organizations = rptHelper.getAssociatedObjects(registryObjectList, testServiceId, OrganizationType.class);
assertThat(organizations, hasSize(1));
assertThat(organizations.get(0).getId(), is(equalTo("urn:organization:id0")));
List<PersonType> contacts = rptHelper.getAssociatedObjects(testServiceId, PersonType.class);
assertThat(contacts, hasSize(1));
assertThat(contacts.get(0).getId(), is(equalTo("urn:contact:id1")));
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryPackageType in project ddf by codice.
the class FederationAdminServiceImplTest method testGetLocalRegistryObjects.
@Test
public void testGetLocalRegistryObjects() throws Exception {
Metacard localMetacardOne = testMetacard;
Metacard localMetacardTwo = testMetacard;
List<Metacard> localMetacards = new ArrayList<>();
localMetacards.add(localMetacardOne);
localMetacards.add(localMetacardTwo);
doReturn(localMetacards).when(federationAdminServiceImpl).getLocalRegistryMetacards();
JAXBElement<RegistryPackageType> jaxbRegistryPackage = EbrimConstants.RIM_FACTORY.createRegistryPackage(getTestRegistryPackage());
when(parser.unmarshal(any(ParserConfigurator.class), eq(JAXBElement.class), any(InputStream.class))).thenReturn(jaxbRegistryPackage);
List<RegistryPackageType> packages = federationAdminServiceImpl.getLocalRegistryObjects();
assertThat(packages, hasSize(2));
verify(parser, times(2)).unmarshal(any(ParserConfigurator.class), eq(JAXBElement.class), any(InputStream.class));
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryPackageType in project ddf by codice.
the class FederationAdminServiceImplTest method testGetRegistryObjects.
@Test
public void testGetRegistryObjects() throws Exception {
Metacard metacardOne = testMetacard;
Metacard metacardTwo = testMetacard;
JAXBElement<RegistryPackageType> jaxbRegistryPackage = EbrimConstants.RIM_FACTORY.createRegistryPackage(getTestRegistryPackage());
QueryRequest request = getTestQueryRequest();
QueryResponse response = getPopulatedTestQueryResponse(request, metacardOne, metacardTwo);
when(catalogFramework.query(any(QueryRequest.class))).thenReturn(response);
when(parser.unmarshal(any(ParserConfigurator.class), eq(JAXBElement.class), any(InputStream.class))).thenReturn(jaxbRegistryPackage);
List<RegistryPackageType> regObjects = federationAdminServiceImpl.getRegistryObjects();
assertThat(regObjects, hasSize(2));
verify(catalogFramework).query(any(QueryRequest.class));
verify(parser, times(2)).unmarshal(any(ParserConfigurator.class), eq(JAXBElement.class), any(InputStream.class));
}
Aggregations