Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
federicaagostini committed Sep 11, 2023
1 parent acb14fb commit 27597ec
Showing 1 changed file with 25 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,47 +42,52 @@ public class ClientRegistrationTestSupport {
public static final String LEGACY_REGISTER_ENDPOINT = "/register";

public static class ClientJsonStringBuilder {

static final Joiner JOINER = Joiner.on(RegisteredClientFields.SCOPE_SEPARATOR);

String name = "test_client";
Set<String> redirectUris = Sets.newHashSet("http://localhost:9090");
Set<String> grantTypes = Sets.newHashSet("client_credentials");
Set<String> scopes = Sets.newHashSet();
Set<String> responseTypes = Sets.newHashSet();

private ClientJsonStringBuilder() {
}
int accessTokenValiditySeconds = 3600;

private ClientJsonStringBuilder() {}

public static ClientJsonStringBuilder builder() {
return new ClientJsonStringBuilder();
}

public ClientJsonStringBuilder name(String name) {
this.name = name;
return this;
}
public ClientJsonStringBuilder redirectUris(String...uris) {

public ClientJsonStringBuilder redirectUris(String... uris) {
this.redirectUris = Sets.newHashSet(uris);
return this;
}
public ClientJsonStringBuilder grantTypes(String...grantTypes) {

public ClientJsonStringBuilder grantTypes(String... grantTypes) {
this.grantTypes = Sets.newHashSet(grantTypes);
return this;
}
public ClientJsonStringBuilder scopes(String...scopes) {

public ClientJsonStringBuilder scopes(String... scopes) {
this.scopes = Sets.newHashSet(scopes);
return this;
}
public ClientJsonStringBuilder responseTypes(String...responseTypes) {

public ClientJsonStringBuilder responseTypes(String... responseTypes) {
this.responseTypes = Sets.newHashSet(responseTypes);
return this;
}


public ClientJsonStringBuilder accessTokenValiditySeconds(int accessTokenValiditySeconds) {
this.accessTokenValiditySeconds = accessTokenValiditySeconds;
return this;
}

public String build() {
JsonObject json = new JsonObject();
json.addProperty(CLIENT_NAME, name);
Expand All @@ -93,12 +98,12 @@ public String build() {
json.add(CLAIMS_REDIRECT_URIS, getAsArray(newHashSet(), true));
json.add(REQUEST_URIS, getAsArray(newHashSet(), true));
json.add(CONTACTS, getAsArray(newHashSet("[email protected]")));

json.addProperty("access_token_validity_seconds", accessTokenValiditySeconds);
return json.toString();
}



}

protected String setToString(Set<String> scopes) {
Expand Down

0 comments on commit 27597ec

Please sign in to comment.