/** * This method sets various internal kettle variables. */ public abstract void setInternalKettleVariables( VariableSpace var );
/** * Sets the directory. * * @param directory The directory to set. */ @Override public void setRepositoryDirectory( RepositoryDirectoryInterface directory ) { this.directory = directory; setInternalKettleVariables(); }
@Test public void testFieldSubstitute() throws Exception { // This is just a delegate method, verify it's called VariableSpace vars = mock( VariableSpace.class ); // This method is reused by the stub to set the mock as the variables object meta.setInternalKettleVariables( vars ); RowMetaInterface rowMeta = mock( RowMetaInterface.class ); Object[] data = new Object[0]; meta.fieldSubstitute( "?{param}", rowMeta, data ); verify( vars, times( 1 ) ).fieldSubstitute( "?{param}", rowMeta, data ); }
@Test public void testEnvironmentSubstitute() throws Exception { // This is just a delegate method, verify it's called VariableSpace vars = mock( VariableSpace.class ); // This method is reused by the stub to set the mock as the variables object meta.setInternalKettleVariables( vars ); meta.environmentSubstitute( "${param}" ); verify( vars, times( 1 ) ).environmentSubstitute( "${param}" ); String[] params = new String[]{ "${param}" }; meta.environmentSubstitute( params ); verify( vars, times( 1 ) ).environmentSubstitute( params ); }