use of org.pentaho.di.trans.step.StepDataInterface in project pentaho-kettle by pentaho.
the class PDI5436Test method testCacheAllTable.
@Test
public void testCacheAllTable() throws KettleException {
DatabaseLookup stepSpy = spy(new DatabaseLookup(smh.stepMeta, smh.stepDataInterface, 0, smh.transMeta, smh.trans));
Database database = mockDatabase();
doReturn(database).when(stepSpy).getDatabase(any(DatabaseMeta.class));
stepSpy.addRowSetToInputRowSets(mockInputRowSet());
stepSpy.setInputRowMeta(mockInputRowMeta());
RowSet outputRowSet = new QueueRowSet();
stepSpy.addRowSetToOutputRowSets(outputRowSet);
StepMetaInterface meta = mockStepMeta();
StepDataInterface data = smh.initStepDataInterface;
Assert.assertTrue("Step init failed", stepSpy.init(meta, data));
Assert.assertTrue("Error processing row", stepSpy.processRow(meta, data));
Assert.assertEquals("Cache lookup failed", "value", outputRowSet.getRow()[2]);
}
Aggregations