### Question:
StepWithMappingMeta extends BaseStepMeta { public static TransMeta loadMappingMeta( StepWithMappingMeta mappingMeta, Repository rep, IMetaStore metaStore, VariableSpace space ) throws KettleException { return loadMappingMeta( mappingMeta, rep, metaStore, space, true ); }  static TransMeta loadMappingMeta( StepWithMappingMeta mappingMeta, Repository rep,
                                           IMetaStore metaStore, VariableSpace space ); static synchronized TransMeta loadMappingMeta( StepWithMappingMeta executorMeta, Repository rep,
                                                        IMetaStore metaStore, VariableSpace space, boolean share ); ObjectLocationSpecificationMethod getSpecificationMethod(); void setSpecificationMethod( ObjectLocationSpecificationMethod specificationMethod ); String getDirectoryPath(); void setDirectoryPath( String directoryPath ); String getFileName(); void setFileName( String fileName ); String getTransName(); void setTransName( String transName ); ObjectId getTransObjectId(); void setTransObjectId( ObjectId transObjectId );  }### Answer:
@Test public void loadMappingMeta() throws Exception { String variablePath = "Internal.Entry.Current.Directory"; String virtualDir = "/testFolder/CDA-91"; String fileName = "testTrans.ktr"; VariableSpace variables = new Variables(); variables.setVariable( variablePath, virtualDir ); StepWithMappingMeta mappingMetaMock = mock( StepWithMappingMeta.class ); when( mappingMetaMock.getSpecificationMethod() ).thenReturn( ObjectLocationSpecificationMethod.FILENAME ); when( mappingMetaMock.getFileName() ).thenReturn( "${" + variablePath + "}/" + fileName ); Repository rep = mock( Repository.class ); Mockito.doAnswer( new Answer<TransMeta>() { @Override public TransMeta answer( final InvocationOnMock invocation ) throws Throwable { final String originalArgument = (String) ( invocation.getArguments() )[ 0 ]; assertEquals( originalArgument, virtualDir ); return null; } } ).when( rep ).findDirectory( anyString() ); Mockito.doAnswer( new Answer<TransMeta>() { @Override public TransMeta answer( final InvocationOnMock invocation ) throws Throwable { final String originalArgument = (String) ( invocation.getArguments() )[ 0 ]; assertEquals( originalArgument, fileName ); return mock( TransMeta.class ); } } ).when( rep ).loadTransformation( anyString(), any( RepositoryDirectoryInterface.class ), any( ProgressMonitorListener.class ), anyBoolean(), anyString() ); StepWithMappingMeta.loadMappingMeta( mappingMetaMock, rep, null, variables, true ); }