use of org.talend.components.marklogic.tmarklogicclose.MarkLogicCloseProperties in project components by Talend.
the class MarkLogicSourceOrSinkTest method testInitializeWrongProperties.
@Test
public void testInitializeWrongProperties() {
// not io
MarkLogicCloseProperties closeProperties = new MarkLogicCloseProperties("closeProperties");
closeProperties.init();
ValidationResult vr = sourceOrSink.initialize(null, closeProperties);
assertEquals(ValidationResult.Result.ERROR, vr.getStatus());
assertFalse(vr.getMessage().isEmpty());
}
use of org.talend.components.marklogic.tmarklogicclose.MarkLogicCloseProperties in project components by Talend.
the class TMarkLogicCloseStandaloneTest method testCloseSuccess.
@Test
public void testCloseSuccess() {
MarkLogicCloseProperties closeProperties = new MarkLogicCloseProperties("close");
closeProperties.referencedComponent.componentInstanceId.setValue("referenced1");
RuntimeContainer container = Mockito.mock(RuntimeContainer.class);
closeStandalone.initialize(container, closeProperties);
DatabaseClient client = Mockito.mock(DatabaseClient.class);
Mockito.when(container.getComponentData(closeProperties.getReferencedComponentId(), MarkLogicConnection.CONNECTION)).thenReturn(client);
closeStandalone.runAtDriver(container);
Mockito.verify(container, Mockito.only()).getComponentData(closeProperties.getReferencedComponentId(), MarkLogicConnection.CONNECTION);
Mockito.verify(client).release();
}
Aggregations