use of org.codice.ddf.spatial.ogc.csw.catalog.endpoint.transformer.CswRecordMap in project ddf by codice.
the class CswQueryFactoryTest method setUp.
@org.junit.Before
public void setUp() throws URISyntaxException, SourceUnavailableException, UnsupportedQueryException, FederationException, ParseException, IngestException {
FilterBuilder filterBuilder = new GeotoolsFilterBuilder();
FilterAdapter filterAdapter = new GeotoolsFilterAdapterImpl();
CswRecordMap cswRecordMap = new MetacardCswRecordMap();
queryFactory = new CswQueryFactory(cswRecordMap, filterBuilder, filterAdapter, new PermissionsImpl());
AttributeRegistryImpl attributeRegistry = new AttributeRegistryImpl();
attributeRegistry.registerMetacardType(getCswMetacardType());
queryFactory.setAttributeRegistry(attributeRegistry);
polygon = new WKTReader().read(POLYGON_STR);
gmlObjectFactory = new net.opengis.gml.v_3_1_1.ObjectFactory();
filterObjectFactory = new ObjectFactory();
queryFilterTransformerProvider = mock(QueryFilterTransformerProvider.class);
QueryFilterTransformer cswQueryFilter = new CswQueryFilterTransformer(new MetacardCswRecordMap(), attributeRegistry);
when(queryFilterTransformerProvider.getTransformer(new QName(CswConstants.CSW_OUTPUT_SCHEMA, "Record"))).thenReturn(Optional.of(cswQueryFilter));
when(queryFilterTransformerProvider.getTransformer(anyString())).thenReturn(Optional.of(cswQueryFilter));
queryFactory.setQueryFilterTransformerProvider(queryFilterTransformerProvider);
}
Aggregations