use of org.codice.ddf.spatial.ogc.wfs.v1_0_0.catalog.common.DescribeFeatureTypeRequest in project ddf by codice.
the class WfsSourceTest method testConfigureFeatureTypesDescribeFeatureException.
@Test
public void testConfigureFeatureTypesDescribeFeatureException() throws WfsException {
ArgumentCaptor<DescribeFeatureTypeRequest> captor = ArgumentCaptor.forClass(DescribeFeatureTypeRequest.class);
WfsSource source = getWfsSource(ONE_TEXT_PROPERTY_SCHEMA, MockWfsServer.getFilterCapabilities(), 1, true);
final String SAMPLE_FEATURE_NAME0 = SAMPLE_FEATURE_NAME + "0";
verify(mockWfs).describeFeatureType(captor.capture());
DescribeFeatureTypeRequest describeFeatureType = captor.getValue();
// sample feature 0 does not have a prefix
assertThat(SAMPLE_FEATURE_NAME0, equalTo(describeFeatureType.getTypeName()));
assertTrue(source.featureTypeFilters.isEmpty());
assertTrue(source.getContentTypes().isEmpty());
}
use of org.codice.ddf.spatial.ogc.wfs.v1_0_0.catalog.common.DescribeFeatureTypeRequest in project ddf by codice.
the class WfsSourceTest method testConfigureFeatureTypes.
@Test
public void testConfigureFeatureTypes() throws WfsException {
ArgumentCaptor<DescribeFeatureTypeRequest> captor = ArgumentCaptor.forClass(DescribeFeatureTypeRequest.class);
WfsSource source = getWfsSource(ONE_TEXT_PROPERTY_SCHEMA, MockWfsServer.getFilterCapabilities(), 1);
final String SAMPLE_FEATURE_NAME0 = SAMPLE_FEATURE_NAME + "0";
verify(mockWfs).describeFeatureType(captor.capture());
DescribeFeatureTypeRequest describeFeatureType = captor.getValue();
// sample feature 0 does not have a prefix
assertThat(SAMPLE_FEATURE_NAME0, equalTo(describeFeatureType.getTypeName()));
assertTrue(source.isAvailable());
assertThat(source.featureTypeFilters.size(), is(1));
WfsFilterDelegate delegate = source.featureTypeFilters.get(new QName(SAMPLE_FEATURE_NAME0));
assertThat(delegate, notNullValue());
assertThat(source.getContentTypes().size(), is(1));
List<ContentType> types = new ArrayList<>();
types.addAll(source.getContentTypes());
assertTrue(SAMPLE_FEATURE_NAME0.equals(types.get(0).getName()));
}
Aggregations