public JSONObject getRepository( String name ) {
    RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( name );
    if ( repositoryMeta != null ) {
      currentRepository = repositoryMeta;
      return repositoryMeta.toJSONObject();
    }
    return null;
  }
@Test
  public void testGetRepository() throws Exception {
    KettleFileRepositoryMeta kettleFileRepositoryMeta = new KettleFileRepositoryMeta();
    kettleFileRepositoryMeta.setId( REPOSITORY_ID );
    kettleFileRepositoryMeta.setDescription( REPOSITORY_DESCRIPTION );
    kettleFileRepositoryMeta.setName( REPOSITORY_NAME );

    when( repositoriesMeta.findRepository( REPOSITORY_NAME ) ).thenReturn( kettleFileRepositoryMeta );

    JSONObject output = controller.getRepository( REPOSITORY_NAME );
    String outputString = output.toJSONString();

    assertEquals( true, outputString.contains( REPOSITORY_ID ) );
    assertEquals( true, outputString.contains( REPOSITORY_DESCRIPTION ) );
    assertEquals( true, outputString.contains( REPOSITORY_NAME ) );
  }