use of org.pentaho.di.trans.steps.metainject.RepositoryImporterExtension in project pentaho-kettle by pentaho.
the class RepositoryImporterTest method testPatchTransSteps_with_meta_inject_step.
@Test
public void testPatchTransSteps_with_meta_inject_step() throws Exception {
Repository repository = mock(Repository.class);
LogChannelInterface log = mock(LogChannelInterface.class);
RepositoryImporter importer = spy(new RepositoryImporter(repository, log));
importer.setBaseDirectory(mock(RepositoryDirectoryInterface.class));
doReturn("TEST_PATH").when(importer).resolvePath(anyString(), anyString());
MetaInjectMeta metaInjectMeta = mock(MetaInjectMeta.class);
doReturn(ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME).when(metaInjectMeta).getSpecificationMethod();
StepMeta stepMeta = mock(StepMeta.class);
doReturn(metaInjectMeta).when(stepMeta).getStepMetaInterface();
doReturn(true).when(stepMeta).isEtlMetaInject();
TransMeta transMeta = mock(TransMeta.class);
doReturn(Collections.singletonList(stepMeta)).when(transMeta).getSteps();
Object[] object = new Object[4];
object[0] = "TEST_PATH";
object[1] = mock(RepositoryDirectoryInterface.class);
object[2] = stepMeta;
object[3] = true;
RepositoryImporterExtension repositoryImporterExtension = new RepositoryImporterExtension();
repositoryImporterExtension.callExtensionPoint(log, object);
verify(metaInjectMeta).setDirectoryPath("TEST_PATH");
}
Aggregations