Skip to content

Commit

Permalink
Merge branch 'master' into sdk-5182-pn-as-identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
tanya732 committed Dec 3, 2024
2 parents ebc882a + a05e32b commit a176d3f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public class EnabledConnection {
private String connectionId;
@JsonProperty("show_as_button")
private Boolean showAsButton;
@JsonProperty("is_signup_enabled")
private Boolean isSignupEnabled;

public EnabledConnection() {}

Expand Down Expand Up @@ -95,4 +97,19 @@ public Boolean getShowAsButton() {
public void setShowAsButton(Boolean showAsButton) {
this.showAsButton = showAsButton;
}

/**
* @return whether signup is enabled for this connection.
*/
public Boolean getSignupEnabled() {
return isSignupEnabled;
}

/**
* Sets whether signup is enabled for this connection.
* @param signupEnabled {@code true} to enable signup, {@code false} to disable it.
*/
public void setSignupEnabled(Boolean signupEnabled) {
isSignupEnabled = signupEnabled;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class EnabledConnectionsPageTest extends JsonTest<EnabledConnectionsPage>
" {\n" +
" \"connection_id\": \"con_1\",\n" +
" \"assign_membership_on_login\": false,\n" +
" \"is_signup_enabled\": true,\n" +
" \"connection\": {\n" +
" \"name\": \"google-oauth2\",\n" +
" \"strategy\": \"google-oauth2\"\n" +
Expand All @@ -20,6 +21,7 @@ public class EnabledConnectionsPageTest extends JsonTest<EnabledConnectionsPage>
" {\n" +
" \"connection_id\": \"con_2\",\n" +
" \"assign_membership_on_login\": true,\n" +
" \"is_signup_enabled\": true,\n" +
" \"connection\": {\n" +
" \"name\": \"Username-Password-Authentication\",\n" +
" \"strategy\": \"auth0\"\n" +
Expand All @@ -32,6 +34,7 @@ public class EnabledConnectionsPageTest extends JsonTest<EnabledConnectionsPage>
" {\n" +
" \"connection_id\": \"con_1\",\n" +
" \"assign_membership_on_login\": false,\n" +
" \"is_signup_enabled\": true,\n" +
" \"connection\": {\n" +
" \"name\": \"google-oauth2\",\n" +
" \"strategy\": \"google-oauth2\"\n" +
Expand All @@ -40,6 +43,7 @@ public class EnabledConnectionsPageTest extends JsonTest<EnabledConnectionsPage>
" {\n" +
" \"connection_id\": \"con_2\",\n" +
" \"assign_membership_on_login\": true,\n" +
" \"is_signup_enabled\": true,\n" +
" \"connection\": {\n" +
" \"name\": \"Username-Password-Authentication\",\n" +
" \"strategy\": \"auth0\"\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public void shouldSerialize() throws Exception {
EnabledConnection enabledConnection = new EnabledConnection();
enabledConnection.setAssignMembershipOnLogin(true);
enabledConnection.setConnection(connection);
enabledConnection.setSignupEnabled(true);

String serialized = toJSON(enabledConnection);
assertThat(serialized, is(notNullValue()));
Expand All @@ -39,6 +40,7 @@ public void shouldDeserialize() throws Exception {
String json = "{\n" +
" \"connection_id\": \"con_id\",\n" +
" \"assign_membership_on_login\": false,\n" +
" \"is_signup_enabled\": true,\n" +
" \"connection\": {\n" +
" \"name\": \"google-oauth2\",\n" +
" \"strategy\": \"google-oauth2\"\n" +
Expand All @@ -49,6 +51,7 @@ public void shouldDeserialize() throws Exception {
assertThat(enabledConnection, is(notNullValue()));
assertThat(enabledConnection.getConnectionId(), is("con_id"));
assertThat(enabledConnection.isAssignMembershipOnLogin(), is(false));
assertThat(enabledConnection.getSignupEnabled(), is(true));
assertThat(enabledConnection.getConnection(), is(notNullValue()));
assertThat(enabledConnection.getConnection().getName(), is("google-oauth2"));
assertThat(enabledConnection.getConnection().getStrategy(), is("google-oauth2"));
Expand Down

0 comments on commit a176d3f

Please sign in to comment.