Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added is_signup_enabled field to OrganizationConnection #677

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading