use of com.marklogic.client.DatabaseClient in project components by Talend.
the class MarkLogicRowProcessorTest method testOpen.
@Test
public void testOpen() throws IOException {
DatabaseClient mockedClient = mock(DatabaseClient.class);
MarkLogicInputSink mockedSink = mock(MarkLogicInputSink.class);
MarkLogicInputProperties inputProperties = new MarkLogicInputProperties("inputProps");
inputProperties.init();
MarkLogicInputWriteOperation writeOperation = new MarkLogicInputWriteOperation(mockedSink, inputProperties);
MarkLogicRowProcessor rowProcessor = writeOperation.createWriter(null);
when(mockedSink.connect(any(RuntimeContainer.class))).thenReturn(mockedClient);
rowProcessor.open("123");
assertNotNull(rowProcessor.docContentReader);
}
Aggregations