### Question:
LdapInput extends BaseTransform<LdapInputMeta, LdapInputData> implements ITransform<LdapInputMeta, LdapInputData> { @Override public boolean init() { if ( super.init() ) { data.rownr = 1L; data.multiValuedFieldSeparator = environmentSubstitute( meta.getMultiValuedSeparator() ); data.nrFields = meta.getInputFields().length; data.staticFilter = environmentSubstitute( meta.getFilterString() ); data.staticSearchBase = environmentSubstitute( meta.getSearchBase() ); data.dynamic = ( meta.isDynamicSearch() || meta.isDynamicFilter() ); try { connectServerLdap(); return true; } catch ( Exception e ) { logError( BaseMessages.getString( PKG, "LdapInput.ErrorInit", e.toString() ) ); stopAll(); setErrors( 1 ); } } return false; } LdapInput( TransformMeta transformMeta, LdapInputMeta meta,  LdapInputData data, int copyNr, PipelineMeta pipelineMeta,
                    Pipeline pipeline ); @Override boolean processRow(); @Override boolean init(); @Override void dispose();  }### Answer:
@Test public void testRowProcessing() throws Exception { LdapInputMeta meta = mock( LdapInputMeta.class ); LdapInputData data = new LdapInputData(); LdapInput ldapInput = new LdapInput(mockHelper.transformMeta, meta, data, 0, mockHelper.pipelineMeta, mockHelper.pipeline ); LdapInputField[] fields = new LdapInputField[] { new LdapInputField( "dn" ), new LdapInputField( "cn" ), new LdapInputField( "role" ) }; int sortedField = 1; fields[ sortedField ].setSortedKey( true ); meta.setInputFields(fields); when( meta.getInputFields() ).thenReturn( fields ); when( meta.getProtocol() ).thenReturn( LdapMockProtocol.getName() ); when( meta.getHost() ).thenReturn( "host.mock" ); when( meta.getDerefAliases() ).thenReturn( "never" ); when( meta.getReferrals() ).thenReturn( "ignore" ); LdapMockProtocol.setup(); try { assertTrue( "Input Initialization Failed", ldapInput.init()); assertEquals( "Field not marked as sorted", 1, data.connection.getSortingAttributes().size() ); assertEquals( "Field not marked as sorted", data.attrReturned[ sortedField ], data.connection.getSortingAttributes().get( 0 ) ); assertNotNull( data.attrReturned[ sortedField ] ); } finally { LdapMockProtocol.cleanup(); } }