From 8c291d85ec297f298dd06e005d6dac280534fe6f Mon Sep 17 00:00:00 2001 From: tanya732 Date: Thu, 14 Nov 2024 14:44:44 +0530 Subject: [PATCH] added new field is_signup_enabled --- .../mgmt/organizations/EnabledConnection.java | 17 +++++++++++++++++ .../EnabledConnectionsPageTest.java | 4 ++++ .../organizations/EnabledConnectionsTest.java | 3 +++ 3 files changed, 24 insertions(+) diff --git a/src/main/java/com/auth0/json/mgmt/organizations/EnabledConnection.java b/src/main/java/com/auth0/json/mgmt/organizations/EnabledConnection.java index af9d0588..ba144f46 100644 --- a/src/main/java/com/auth0/json/mgmt/organizations/EnabledConnection.java +++ b/src/main/java/com/auth0/json/mgmt/organizations/EnabledConnection.java @@ -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() {} @@ -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; + } } diff --git a/src/test/java/com/auth0/json/mgmt/organizations/EnabledConnectionsPageTest.java b/src/test/java/com/auth0/json/mgmt/organizations/EnabledConnectionsPageTest.java index d52e0112..8bfe7529 100644 --- a/src/test/java/com/auth0/json/mgmt/organizations/EnabledConnectionsPageTest.java +++ b/src/test/java/com/auth0/json/mgmt/organizations/EnabledConnectionsPageTest.java @@ -12,6 +12,7 @@ public class EnabledConnectionsPageTest extends JsonTest " {\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" + @@ -20,6 +21,7 @@ public class EnabledConnectionsPageTest extends JsonTest " {\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" + @@ -32,6 +34,7 @@ public class EnabledConnectionsPageTest extends JsonTest " {\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" + @@ -40,6 +43,7 @@ public class EnabledConnectionsPageTest extends JsonTest " {\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" + diff --git a/src/test/java/com/auth0/json/mgmt/organizations/EnabledConnectionsTest.java b/src/test/java/com/auth0/json/mgmt/organizations/EnabledConnectionsTest.java index b232c627..49017692 100644 --- a/src/test/java/com/auth0/json/mgmt/organizations/EnabledConnectionsTest.java +++ b/src/test/java/com/auth0/json/mgmt/organizations/EnabledConnectionsTest.java @@ -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())); @@ -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" + @@ -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"));