use of ddf.catalog.federation.layered.replication.RestReplicatorPlugin in project ddf by codice.
the class TestPlugin method setup.
@Before
public void setup() {
// given
plugin = new RestReplicatorPlugin(ENDPOINT_ADDRESS);
transformer = mock(MetacardTransformer.class);
BinaryContent bc = mock(BinaryContent.class);
byte[] bytes = { 86 };
try {
when(bc.getByteArray()).thenReturn(bytes);
when(transformer.transform(isA(Metacard.class), isA(Map.class))).thenReturn(bc);
} catch (Exception e) {
Assert.fail(e.getLocalizedMessage());
}
plugin.setTransformer(transformer);
metacard = getMockMetacard();
}
use of ddf.catalog.federation.layered.replication.RestReplicatorPlugin in project ddf by codice.
the class TestPlugin method testCreateNullTransformer.
@Test
@Ignore
public void testCreateNullTransformer() throws PluginExecutionException, IngestException, SourceUnavailableException {
// given
plugin = new RestReplicatorPlugin(null);
CreateResponse createResponse = new CreateResponseImpl(new CreateRequestImpl(metacard), null, Arrays.asList(metacard));
// when
plugin.process(createResponse);
// then
verify(endpoint, never()).addDocument(isA(HttpHeaders.class), isA(UriInfo.class), isA(InputStream.class));
}
Aggregations