@SuppressWarnings( "unchecked" )
  public JSONArray getDatabases() {
    JSONArray list = new JSONArray();
    for ( int i = 0; i < repositoriesMeta.nrDatabases(); i++ ) {
      JSONObject databaseJSON = new JSONObject();
      databaseJSON.put( "name", repositoriesMeta.getDatabase( i ).getName() );
      list.add( databaseJSON );
    }
    return list;
  }
@Test
  public void testGetDatabases() throws Exception {
    when( repositoriesMeta.nrDatabases() ).thenReturn( 1 );
    when( repositoriesMeta.getDatabase( 0 ) ).thenReturn( databaseMeta );
    when( databaseMeta.getName() ).thenReturn( DATABASE_NAME );

    String databases = controller.getDatabases().toString();
    assertEquals( "[{\"name\":\"DATABASE NAME\"}]", databases );
  }