use of ddf.catalog.transform.QueryFilterTransformerProvider 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);
}
use of ddf.catalog.transform.QueryFilterTransformerProvider in project ddf by codice.
the class ValidatorTest method setUp.
@Before
public void setUp() throws Exception {
QName[] qname = { new QName(CswConstants.CSW_OUTPUT_SCHEMA, CswConstants.CSW_RECORD_LOCAL_NAME) };
qNameList = Arrays.asList(qname);
transformerManager = mock(TransformerManager.class);
validator = new Validator();
QueryFilterTransformerProvider transformerProvider = mock(QueryFilterTransformerProvider.class);
QueryFilterTransformer transformer = mock(QueryFilterTransformer.class);
when(transformerProvider.getTransformer(any(QName.class))).thenReturn(Optional.empty());
when(transformerProvider.getTransformer(qname[0])).thenReturn(Optional.of(transformer));
validator.setQueryFilterTransformerProvider(transformerProvider);
}
Aggregations