Skip to content

Commit a05e32b

Browse files
authored
Added is_signup_enabled field to OrganizationConnection (#677)
1 parent bc505ca commit a05e32b

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

src/main/java/com/auth0/json/mgmt/organizations/EnabledConnection.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ public class EnabledConnection {
2020
private String connectionId;
2121
@JsonProperty("show_as_button")
2222
private Boolean showAsButton;
23+
@JsonProperty("is_signup_enabled")
24+
private Boolean isSignupEnabled;
2325

2426
public EnabledConnection() {}
2527

@@ -95,4 +97,19 @@ public Boolean getShowAsButton() {
9597
public void setShowAsButton(Boolean showAsButton) {
9698
this.showAsButton = showAsButton;
9799
}
100+
101+
/**
102+
* @return whether signup is enabled for this connection.
103+
*/
104+
public Boolean getSignupEnabled() {
105+
return isSignupEnabled;
106+
}
107+
108+
/**
109+
* Sets whether signup is enabled for this connection.
110+
* @param signupEnabled {@code true} to enable signup, {@code false} to disable it.
111+
*/
112+
public void setSignupEnabled(Boolean signupEnabled) {
113+
isSignupEnabled = signupEnabled;
114+
}
98115
}

src/test/java/com/auth0/json/mgmt/organizations/EnabledConnectionsPageTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class EnabledConnectionsPageTest extends JsonTest<EnabledConnectionsPage>
1212
" {\n" +
1313
" \"connection_id\": \"con_1\",\n" +
1414
" \"assign_membership_on_login\": false,\n" +
15+
" \"is_signup_enabled\": true,\n" +
1516
" \"connection\": {\n" +
1617
" \"name\": \"google-oauth2\",\n" +
1718
" \"strategy\": \"google-oauth2\"\n" +
@@ -20,6 +21,7 @@ public class EnabledConnectionsPageTest extends JsonTest<EnabledConnectionsPage>
2021
" {\n" +
2122
" \"connection_id\": \"con_2\",\n" +
2223
" \"assign_membership_on_login\": true,\n" +
24+
" \"is_signup_enabled\": true,\n" +
2325
" \"connection\": {\n" +
2426
" \"name\": \"Username-Password-Authentication\",\n" +
2527
" \"strategy\": \"auth0\"\n" +
@@ -32,6 +34,7 @@ public class EnabledConnectionsPageTest extends JsonTest<EnabledConnectionsPage>
3234
" {\n" +
3335
" \"connection_id\": \"con_1\",\n" +
3436
" \"assign_membership_on_login\": false,\n" +
37+
" \"is_signup_enabled\": true,\n" +
3538
" \"connection\": {\n" +
3639
" \"name\": \"google-oauth2\",\n" +
3740
" \"strategy\": \"google-oauth2\"\n" +
@@ -40,6 +43,7 @@ public class EnabledConnectionsPageTest extends JsonTest<EnabledConnectionsPage>
4043
" {\n" +
4144
" \"connection_id\": \"con_2\",\n" +
4245
" \"assign_membership_on_login\": true,\n" +
46+
" \"is_signup_enabled\": true,\n" +
4347
" \"connection\": {\n" +
4448
" \"name\": \"Username-Password-Authentication\",\n" +
4549
" \"strategy\": \"auth0\"\n" +

src/test/java/com/auth0/json/mgmt/organizations/EnabledConnectionsTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public void shouldSerialize() throws Exception {
2222
EnabledConnection enabledConnection = new EnabledConnection();
2323
enabledConnection.setAssignMembershipOnLogin(true);
2424
enabledConnection.setConnection(connection);
25+
enabledConnection.setSignupEnabled(true);
2526

2627
String serialized = toJSON(enabledConnection);
2728
assertThat(serialized, is(notNullValue()));
@@ -39,6 +40,7 @@ public void shouldDeserialize() throws Exception {
3940
String json = "{\n" +
4041
" \"connection_id\": \"con_id\",\n" +
4142
" \"assign_membership_on_login\": false,\n" +
43+
" \"is_signup_enabled\": true,\n" +
4244
" \"connection\": {\n" +
4345
" \"name\": \"google-oauth2\",\n" +
4446
" \"strategy\": \"google-oauth2\"\n" +
@@ -49,6 +51,7 @@ public void shouldDeserialize() throws Exception {
4951
assertThat(enabledConnection, is(notNullValue()));
5052
assertThat(enabledConnection.getConnectionId(), is("con_id"));
5153
assertThat(enabledConnection.isAssignMembershipOnLogin(), is(false));
54+
assertThat(enabledConnection.getSignupEnabled(), is(true));
5255
assertThat(enabledConnection.getConnection(), is(notNullValue()));
5356
assertThat(enabledConnection.getConnection().getName(), is("google-oauth2"));
5457
assertThat(enabledConnection.getConnection().getStrategy(), is("google-oauth2"));

0 commit comments

Comments
 (0)