Search in sources :

Example 6 with TSnowflakeRowProperties

use of org.talend.components.snowflake.tsnowflakerow.TSnowflakeRowProperties in project components by Talend.

the class SnowflakeRowWriterTest method setup.

@Before
public void setup() throws IOException {
    connection = Mockito.mock(Connection.class);
    rowProperties = new TSnowflakeRowProperties("rowProperties");
    rowProperties.commitCount.setValue(1);
    rowProperties.setupProperties();
    sink = Mockito.mock(SnowflakeRowSink.class);
    Mockito.when(sink.getRowProperties()).thenReturn(rowProperties);
    Mockito.when(sink.createConnection(null)).thenReturn(connection);
    Mockito.when(sink.getQuery()).thenReturn(query);
    operation = Mockito.mock(SnowflakeRowWriteOperation.class);
    Mockito.when(operation.getSink()).thenReturn(sink);
    writer = new SnowflakeRowWriter(null, operation);
    rs = Mockito.mock(ResultSet.class);
}
Also used : TSnowflakeRowProperties(org.talend.components.snowflake.tsnowflakerow.TSnowflakeRowProperties) Connection(java.sql.Connection) ResultSet(java.sql.ResultSet) Before(org.junit.Before)

Aggregations

TSnowflakeRowProperties (org.talend.components.snowflake.tsnowflakerow.TSnowflakeRowProperties)6 Before (org.junit.Before)4 Connection (java.sql.Connection)3 Test (org.junit.Test)2 RuntimeContainer (org.talend.components.api.container.RuntimeContainer)2 ResultSet (java.sql.ResultSet)1 Schema (org.apache.avro.Schema)1 Result (org.talend.components.api.component.runtime.Result)1 ValidationResult (org.talend.daikon.properties.ValidationResult)1