AuthenticationServiceClient extends AbstractClient { public List<Organization> getOrganizations() { Response response = get(baseUri, ORGANIZATIONS); Type listType = new TypeToken<ArrayList<Organization>>() {}.getType(); List<Organization> organizationList = new Gson().fromJson(response.readEntity(String.class), listType); return organizationList; } AuthenticationServiceClient(String baseUri);  AuthenticationServiceClient(String baseUri, Boolean saveState); String getBearerToken(Credentials credentials); String getBearerTokenForConnectedApp(ConnectedAppCredentials connectedApp); UserInfo getMe(); List<Organization> getOrganizations(); List<Environment> getEnvironments(String organizationId); static final String AUTHORIZATION_HEADER; static final String ANYPOINT_SEESION_EXTEND; static final String LOGIN; static final String BASE; static final String TOKEN; static final String ME; static final String ORGANIZATIONS; static final String ENVIRONMENTS; }
@Ignore @Test public void getOrganizations() { client.getBearerToken(credentials); List<Organization> organizations = client.getOrganizations(); System.out.println(organizations.get(0).id); }