MongodbInputParameterGeneration implements ParameterGenerationService { @Override public void pushDown( Condition condition, ParameterGeneration parameterGeneration, StepInterface stepInterface ) throws PushDownOptimizationException { if ( !"MongoDbInput".equals( stepInterface.getStepMeta().getTypeId() ) ) { throw new PushDownOptimizationException( "Unable to push down to type " + stepInterface.getClass() ); } stepInterface.setVariable( parameterGeneration.getParameterName(), getMongodbPredicate( condition, getFieldMappings( stepInterface ) ).asFilterCriteria() ); } MongodbInputParameterGeneration( ValueMetaResolver resolver );  MongodbInputParameterGeneration(); @Override void pushDown( Condition condition, ParameterGeneration parameterGeneration, StepInterface stepInterface ); @Override String getParameterDefault(); @Override OptimizationImpactInfo preview( Condition pushDownCondition,
                                         ParameterGeneration parameterGeneration, StepInterface stepInterface );  }
@Test( expected = PushDownOptimizationException.class ) public void testPushDownThrowsWithInvalidType() throws Exception { when( stepInterface.getStepMeta().getTypeId() ).thenReturn( "InvalidType" ); pushDown( condition, parameterGeneration, stepInterface ); }
@Test public void testPushDownSetsParameter() throws Exception { pushDown( condition, parameterGeneration, stepInterface ); verify( stepInterface ).setVariable( "paramName", "mockedFilter" ); }