use of net.opengis.cat.csw.v_2_0_2.GetRecordByIdType in project ddf by codice.
the class TestCswEndpoint 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 TestCswEndpoint 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 TestCswEndpoint method testPostRetrieveProductGetRecordById.
@Test
public void testPostRetrieveProductGetRecordById() 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, null);
assertThat(cswRecordCollection.getResource(), is(notNullValue()));
}
use of net.opengis.cat.csw.v_2_0_2.GetRecordByIdType in project ddf by codice.
the class TestCswEndpoint method testPostRetrieveProductGetRecordByIdWithInvalidRange.
@Test(expected = CswException.class)
public void testPostRetrieveProductGetRecordByIdWithInvalidRange() 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);
csw.getRecordById(getRecordByIdType, "100");
}
use of net.opengis.cat.csw.v_2_0_2.GetRecordByIdType in project ddf by codice.
the class TestCswEndpoint method testPostRetrieveProductGetRecordByIdIncorrectOutputFormat.
@Test(expected = CswException.class)
public void testPostRetrieveProductGetRecordByIdIncorrectOutputFormat() throws CswException, FederationException, SourceUnavailableException, UnsupportedQueryException, ResourceNotFoundException, IOException, ResourceNotSupportedException {
final GetRecordByIdType getRecordByIdType = new GetRecordByIdType();
getRecordByIdType.setOutputFormat(MediaType.APPLICATION_XML);
getRecordByIdType.setOutputSchema(OCTET_STREAM_OUTPUT_SCHEMA);
getRecordByIdType.setId(Collections.singletonList("123"));
csw.getRecordById(getRecordByIdType, null);
}
Aggregations