@Test public void scopes() { final SphereClientConfig config = SphereClientConfigBuilder .ofKeyIdSecret("projectKey", "clientId", "clientSecret") .scopes(asList(SphereProjectScope.MANAGE_CUSTOMERS, SphereProjectScope.VIEW_ORDERS)) .build(); assertThat(config.getScopes()).containsExactly("manage_customers", "view_orders"); }
public SphereClientConfig withAuthUrl(final String authUrl) { return new SphereClientConfig(getProjectKey(), getClientId(), getClientSecret(), authUrl, getApiUrl(), getScopes(), getCorrelationIdGenerator()); }
public SphereClientConfig withApiUrl(final String apiUrl) { return new SphereClientConfig(getProjectKey(), getClientId(), getClientSecret(), getAuthUrl(), apiUrl, getScopes(), getCorrelationIdGenerator()); }
public static SphereClientConfigBuilder ofClientConfig(final SphereClientConfig config) { return ofKeyIdSecret(config.getProjectKey(), config.getClientId(), config.getClientSecret()) .authUrl(config.getAuthUrl()) .apiUrl(config.getApiUrl()) .scopeStrings(config.getScopes()) .correlationIdGenerator(config.getCorrelationIdGenerator()); }