AuthenticationServiceClient extends AbstractClient { public List<Environment> getEnvironments(String organizationId) { Environments environments = get(baseUri, String.format(ENVIRONMENTS, organizationId), Environments.class); return Arrays.asList(environments.data); } 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 getEnvironments() { client.getBearerToken(credentials); UserInfo userInfo = client.getMe(); List<Environment> environments = client.getEnvironments(userInfo.user.organization.id); System.out.println(environments.get(0).id); System.out.println(environments.get(0).name); System.out.println(environments.get(0).isProduction); }