TableInputValidation implements StepValidation { @Override public void checkStep( CheckStepsExtension checkStepExtension, DataServiceMeta dataServiceMeta, LogChannelInterface log ) { checkMissingDefinedParam( checkStepExtension, dataServiceMeta ); checkPushdownParameter( checkStepExtension ); }  @Override boolean supportsStep( StepMeta step, LogChannelInterface log ); @Override void checkStep(
      CheckStepsExtension checkStepExtension, DataServiceMeta dataServiceMeta, LogChannelInterface log );  }
@Test public void testCheckNoParamSQLisNull() { tableInputValidation.checkStep( checkStepsExtension, dataServiceMeta, log ); verify( remarks, times( 1 ) ).add( any( CheckResultInterface.class ) ); }
@Test public void testCheckNoParam() { when( tableInputMeta.getSQL() ).thenReturn( "SELECT foo FROM bar" ); tableInputValidation.checkStep( checkStepsExtension, dataServiceMeta, log ); verify( remarks, times( 1 ) ).add( any( CheckResultInterface.class ) ); }
@Test public void testCheckNoWarningsWithParam() { when( tableInputMeta.getSQL() ).thenReturn( "SELECT foo FROM bar WHERE ${baz}" ); space.setVariable( "baz", "foo='123'" ); tableInputValidation.checkStep( checkStepsExtension, dataServiceMeta, log ); verify( remarks, never() ).add( any( CheckResultInterface.class ) ); }
@Test public void testCheckNoParamForDefinedOpt() { when( tableInputMeta.getSQL() ).thenReturn( "SELECT foo FROM bar" ); setupMockedParamGen( "testParam", "testStep" ); when( stepMeta.getName() ) .thenReturn( "testStep" ); tableInputValidation.checkStep( checkStepsExtension, dataServiceMeta, log ); verify( remarks, times( 2 ) ).add( any( CheckResultInterface.class ) ); }
@Test public void testCheckOkWithParam() { when( tableInputMeta.getSQL() ).thenReturn( "SELECT foo FROM bar ${testParam}" ); space.setVariable( "testParam", "foo='123'" ); setupMockedParamGen( "testParam", "testStep" ); when( stepMeta.getName() ) .thenReturn( "testStep" ); tableInputValidation.checkStep( checkStepsExtension, dataServiceMeta, log ); verify( remarks, never() ).add( any( CheckResultInterface.class ) ); }