@@ -0,0 +1,2336 @@
+/*! ******************************************************************************%0A *%0A * Pentaho Data Integration%0A *%0A * Copyright (C) 2002-2016 by Pentaho : http://www.pentaho.com%0A *%0A *******************************************************************************%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with%0A * the License. You may obtain a copy of the License at%0A *%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A *%0A ******************************************************************************/%0A%0Apackage org.pentaho.di.trans.steps.jsoninput;%0A%0Aimport static org.junit.Assert.assertNotNull;%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0Aimport org.pentaho.di.core.KettleEnvironment;%0Aimport org.pentaho.di.core.RowMetaAndData;%0Aimport org.pentaho.di.core.exception.KettleException;%0Aimport org.pentaho.di.core.variables.Variables;%0Aimport org.pentaho.di.trans.TransMeta;%0Aimport org.pentaho.di.trans.TransTestFactory;%0A%0Apublic class JsonInputIntTest %7B%0A%0A  @BeforeClass%0A  public static void setUpBeforeClass() throws KettleException %7B%0A    KettleEnvironment.init( false );%0A  %7D%0A%0A  @Test%0A  public void testNoInput() throws KettleException %7B%0A    String stepName = %22noInputStep%22;%0A    JsonInputMeta meta = new JsonInputMeta();%0A    meta.setInFields( true );%0A    meta.setFieldValue( %22myJSONStringField%22 );%0A    JsonInputField field = new JsonInputField( %22test%22 );%0A    field.setPath( %22$.value%22 );%0A    meta.setInputFields( new JsonInputField%5B%5D%7B field %7D );%0A%0A    TransMeta transMeta = TransTestFactory.generateTestTransformation( new Variables(), meta, stepName );%0A    List%3CRowMetaAndData%3E result = TransTestFactory.executeTestTransformation( transMeta,%0A      TransTestFactory.INJECTOR_STEPNAME, stepName, TransTestFactory.DUMMY_STEPNAME, new ArrayList%3CRowMetaAndData%3E() );%0A%0A    assertNotNull( result );%0A    assertTrue( result.isEmpty() );%0A  %7D%0A%7D%0A

Test Case