use of net.opengis.cat.csw.v_2_0_2.GetRecordByIdType in project ddf by codice.
the class CswEndpointTest method testPostRetrieveProductGetRecordByIdWithMultiIds.
@Test(expected = CswException.class)
public void testPostRetrieveProductGetRecordByIdWithMultiIds() throws CswException, FederationException, SourceUnavailableException, UnsupportedQueryException, ResourceNotFoundException, IOException, ResourceNotSupportedException {
final GetRecordByIdType getRecordByIdType = new GetRecordByIdType();
getRecordByIdType.setOutputFormat(MediaType.APPLICATION_OCTET_STREAM);
getRecordByIdType.setOutputSchema(OCTET_STREAM_OUTPUT_SCHEMA);
getRecordByIdType.setId(Arrays.asList("123", "124"));
csw.getRecordById(getRecordByIdType, null);
}
use of net.opengis.cat.csw.v_2_0_2.GetRecordByIdType in project ddf by codice.
the class CswEndpointTest method testPostRetrieveProductGetRecordByIdIncorrectSchema.
@Test(expected = CswException.class)
public void testPostRetrieveProductGetRecordByIdIncorrectSchema() throws CswException, FederationException, SourceUnavailableException, UnsupportedQueryException, ResourceNotFoundException, IOException, ResourceNotSupportedException {
final GetRecordByIdType getRecordByIdType = new GetRecordByIdType();
getRecordByIdType.setOutputFormat(MediaType.APPLICATION_OCTET_STREAM);
getRecordByIdType.setOutputSchema(CswConstants.CSW_OUTPUT_SCHEMA);
getRecordByIdType.setId(Collections.singletonList("123"));
csw.getRecordById(getRecordByIdType, null);
}
use of net.opengis.cat.csw.v_2_0_2.GetRecordByIdType in project ddf by codice.
the class CswEndpointTest method testPostRetrieveProductGetRecordByIdWithNoResource.
@Test(expected = CswException.class)
public void testPostRetrieveProductGetRecordByIdWithNoResource() throws CswException, FederationException, SourceUnavailableException, UnsupportedQueryException, ResourceNotFoundException, IOException, ResourceNotSupportedException {
final GetRecordByIdType getRecordByIdType = new GetRecordByIdType();
getRecordByIdType.setOutputFormat(MediaType.APPLICATION_OCTET_STREAM);
getRecordByIdType.setOutputSchema(OCTET_STREAM_OUTPUT_SCHEMA);
getRecordByIdType.setId(Collections.singletonList("123"));
when(catalogFramework.getLocalResource(any(ResourceRequest.class))).thenThrow(ResourceNotFoundException.class);
csw.getRecordById(getRecordByIdType, null);
}
use of net.opengis.cat.csw.v_2_0_2.GetRecordByIdType in project ddf by codice.
the class CswEndpointTest method testPostRetrieveProductGetRecordByIdWithNoMimeType.
@Test
public void testPostRetrieveProductGetRecordByIdWithNoMimeType() throws IOException, ResourceNotFoundException, ResourceNotSupportedException, CswException {
final GetRecordByIdType getRecordByIdType = new GetRecordByIdType();
getRecordByIdType.setOutputFormat(MediaType.APPLICATION_OCTET_STREAM);
getRecordByIdType.setOutputSchema(OCTET_STREAM_OUTPUT_SCHEMA);
getRecordByIdType.setId(Collections.singletonList("123"));
setUpMocksForProductRetrieval(false);
CswRecordCollection cswRecordCollection = csw.getRecordById(getRecordByIdType, null);
assertThat(cswRecordCollection.getResource(), is(notNullValue()));
assertThat(cswRecordCollection.getResource().getMimeType().toString(), is(MediaType.APPLICATION_OCTET_STREAM));
}
use of net.opengis.cat.csw.v_2_0_2.GetRecordByIdType in project ddf by codice.
the class CswEndpointTest method testPostRetrieveProductGetRecordByIdWithRange.
@Test
public void testPostRetrieveProductGetRecordByIdWithRange() throws IOException, ResourceNotFoundException, ResourceNotSupportedException, CswException {
final GetRecordByIdType getRecordByIdType = new GetRecordByIdType();
getRecordByIdType.setOutputFormat(MediaType.APPLICATION_OCTET_STREAM);
getRecordByIdType.setOutputSchema(OCTET_STREAM_OUTPUT_SCHEMA);
getRecordByIdType.setId(Collections.singletonList("123"));
setUpMocksForProductRetrieval(true);
CswRecordCollection cswRecordCollection = csw.getRecordById(getRecordByIdType, RANGE_VALUE);
assertThat(cswRecordCollection.getResource(), is(notNullValue()));
}
Aggregations