use of org.talend.components.api.container.RuntimeContainer in project components by Talend.
the class SnowflakeCloseSourceOrSinkTest method testValidateFailedToClose.
@Test
public void testValidateFailedToClose() throws SQLException {
RuntimeContainer container = Mockito.mock(RuntimeContainer.class);
Connection connection = Mockito.mock(Connection.class);
Mockito.doThrow(new SQLException("Failed to close connection")).when(connection).close();
Mockito.when(container.getComponentData(Mockito.anyString(), Mockito.anyString())).thenReturn(connection);
Assert.assertEquals(ValidationResult.Result.ERROR, closeSourceOrSink.validate(container).getStatus());
}
Aggregations