use of com.evolveum.midpoint.xml.ns._public.common.common_3.CapabilitiesType in project ddf by codice.
the class CswEndpointTest method testGetCapabilitiesTypeOperationsMetadata.
@Test
public void testGetCapabilitiesTypeOperationsMetadata() {
// Should only return the OperationsMetadata section
GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
SectionsType stv = new SectionsType();
stv.setSection(Arrays.asList(CswEndpoint.OPERATIONS_METADATA));
gct.setSections(stv);
CapabilitiesType ct = null;
try {
ct = csw.getCapabilities(gct);
} catch (CswException e) {
fail("CswException caught during getCapabilities GET request: " + e.getMessage());
}
assertThat(ct, notNullValue());
verifyOperationsMetadata(ct);
verifyFilterCapabilities(ct);
assertThat(ct.getServiceIdentification(), nullValue());
assertThat(ct.getServiceProvider(), nullValue());
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.CapabilitiesType in project ddf by codice.
the class CswEndpointTest method testGetCapabilitiesTypeNoSections.
@Test
public void testGetCapabilitiesTypeNoSections() {
// Should return all sections
GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
gct.setSections(null);
CapabilitiesType ct = null;
try {
ct = csw.getCapabilities(gct);
} catch (CswException e) {
fail("CswException caught during getCapabilities GET request: " + e.getMessage());
}
assertThat(ct, notNullValue());
verifyOperationsMetadata(ct);
verifyServiceIdentification(ct);
verifyServiceProvider(ct);
verifyFilterCapabilities(ct);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.CapabilitiesType in project ddf by codice.
the class CswSourceTest method testCswSourceNoFilterCapabilities.
@Test(expected = UnsupportedQueryException.class)
public void testCswSourceNoFilterCapabilities() throws CswException, UnsupportedQueryException, SecurityServiceException {
// Setup
CapabilitiesType mockCapabilitiesType = mock(CapabilitiesType.class);
when(mockCsw.getCapabilities(any(GetCapabilitiesRequest.class))).thenReturn(mockCapabilitiesType);
AbstractCswSource cswSource = getCswSource(mockCsw, mockContext);
cswSource.setCswUrl(URL);
cswSource.setId(ID);
QueryImpl propertyIsLikeQuery = new QueryImpl(builder.attribute(Metacard.ANY_TEXT).is().like().text("junk"));
propertyIsLikeQuery.setPageSize(10);
cswSource.query(getQueryRequestWithSubject(propertyIsLikeQuery));
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.CapabilitiesType in project ddf by codice.
the class CswEndpointTest method testCapabilitiesRequestBadSection.
@Test
public void testCapabilitiesRequestBadSection() {
// Shouldn't return any sections
GetCapabilitiesRequest gcr = createDefaultGetCapabilitiesRequest();
gcr.setSections("bad");
CapabilitiesType ct = null;
try {
ct = csw.getCapabilities(gcr);
} catch (CswException e) {
fail("CswException caught during getCapabilities GET request: " + e.getMessage());
}
assertThat(ct, notNullValue());
assertThat(ct.getOperationsMetadata(), nullValue());
assertThat(ct.getServiceIdentification(), nullValue());
assertThat(ct.getServiceProvider(), nullValue());
verifyFilterCapabilities(ct);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.CapabilitiesType in project ddf by codice.
the class CswEndpointTest method testGetCapabilitiesTypeAllSections.
@Test
public void testGetCapabilitiesTypeAllSections() {
// Should return all sections
GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
SectionsType stv = new SectionsType();
stv.setSection(Arrays.asList(CswEndpoint.SERVICE_IDENTIFICATION, CswEndpoint.SERVICE_PROVIDER, CswEndpoint.OPERATIONS_METADATA, CswEndpoint.FILTER_CAPABILITIES));
gct.setSections(stv);
CapabilitiesType ct = null;
try {
ct = csw.getCapabilities(gct);
} catch (CswException e) {
fail("CswException caught during getCapabilities GET request: " + e.getMessage());
}
assertThat(ct, notNullValue());
verifyOperationsMetadata(ct);
verifyServiceIdentification(ct);
verifyServiceProvider(ct);
verifyFilterCapabilities(ct);
}
Aggregations