use of org.codice.ddf.spatial.ogc.wfs.catalog.metacardtype.registry.WfsMetacardTypeRegistry in project ddf by codice.
the class XStreamWfs11FeatureTransformerTest method mockMetacardTypeRegistry.
private WfsMetacardTypeRegistry mockMetacardTypeRegistry() throws IOException {
WfsMetacardTypeRegistry metacardTypeRegistry = mock(WfsMetacardTypeRegistry.class);
XmlSchemaCollection schemaCollection = new XmlSchemaCollection();
InputStream inputStream = getClass().getResourceAsStream("/Neverland_FeatureType.xsd");
XmlSchema schema = schemaCollection.read(new StreamSource(inputStream));
inputStream.close();
FeatureMetacardType featureMetacardType = new FeatureMetacardType(schema, PETER_PAN_NAME, Collections.emptySet(), Wfs11Constants.GML_3_1_1_NAMESPACE, FeatureMetacardType.DEFAULT_METACARD_TYPE_ENHANCER);
when(metacardTypeRegistry.lookupMetacardTypeBySimpleName(SOURCE_ID, PETER_PAN_NAME.getLocalPart())).thenReturn(Optional.of(featureMetacardType));
return metacardTypeRegistry;
}
Aggregations