use of org.pentaho.di.trans.step.StepIOMeta in project pentaho-kettle by pentaho.
the class StreamLookupTest method mockProcessRowMeta.
private StreamLookupMeta mockProcessRowMeta(boolean memoryPreservationActive) throws KettleStepException {
StreamLookupMeta meta = smh.processRowsStepMetaInterface;
StepMeta lookupStepMeta = when(mock(StepMeta.class).getName()).thenReturn("Lookup").getMock();
doReturn(lookupStepMeta).when(smh.transMeta).findStep("Lookup");
StepIOMeta stepIOMeta = new StepIOMeta(true, true, false, false, false, false);
stepIOMeta.addStream(new Stream(StreamInterface.StreamType.INFO, lookupStepMeta, null, StreamIcon.INFO, null));
doReturn(stepIOMeta).when(meta).getStepIOMeta();
doReturn(new String[] { "Id" }).when(meta).getKeylookup();
doReturn(new String[] { "Id" }).when(meta).getKeystream();
doReturn(new String[] { "Value" }).when(meta).getValue();
doReturn(memoryPreservationActive).when(meta).isMemoryPreservationActive();
doReturn(false).when(meta).isUsingSortedList();
doReturn(false).when(meta).isUsingIntegerPair();
doReturn(new int[] { -1 }).when(meta).getValueDefaultType();
doReturn(new String[] { "" }).when(meta).getValueDefault();
doReturn(new String[] { "Value" }).when(meta).getValueName();
doReturn(new String[] { "Value" }).when(meta).getValue();
doCallRealMethod().when(meta).getFields(any(RowMetaInterface.class), anyString(), any(RowMetaInterface[].class), any(StepMeta.class), any(VariableSpace.class), any(Repository.class), any(IMetaStore.class));
return meta;
}
Aggregations