use of ddf.catalog.transformer.api.MetacardMarshaller in project ddf by codice.
the class TestXmlResponseQueueTransformer method testMetacardMarshallThrowsXmlPullParserException.
@Test(expected = CatalogTransformerException.class)
public void testMetacardMarshallThrowsXmlPullParserException() throws IOException, CatalogTransformerException, XmlPullParserException, MimeTypeParseException {
SourceResponse response = givenSourceResponse(new MetacardStub("source1", "id1"));
PrintWriterProvider pwp = new PrintWriterProviderImpl();
MetacardMarshaller mockMetacardMarshaller = mock(MetacardMarshaller.class);
when(mockMetacardMarshaller.marshal(any(Metacard.class), any(Map.class))).thenThrow(new XmlPullParserException(""));
XmlResponseQueueTransformer xrqt = new XmlResponseQueueTransformer(parser, FJP, pwp, mockMetacardMarshaller, getMimeType());
xrqt.setThreshold(2);
BinaryContent bc = xrqt.transform(response, null);
// then exception
}
Aggregations