Skip to content

Commit 0549138

Browse files
authored
[SDK-4769] - add show_as_button to Organization Enabled Connections (#631)
2 parents 8042b5f + 8bd6f5b commit 0549138

5 files changed

Lines changed: 30 additions & 3 deletions

File tree

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public class EnabledConnection {
1818
private boolean assignMembershipOnLogin;
1919
@JsonProperty("connection_id")
2020
private String connectionId;
21+
@JsonProperty("show_as_button")
22+
private Boolean showAsButton;
2123

2224
public EnabledConnection() {}
2325

@@ -77,4 +79,20 @@ public String getConnectionId() {
7779
public void setConnectionId(String connectionId) {
7880
this.connectionId = connectionId;
7981
}
82+
83+
/**
84+
* @return the value of the {@code show_as_button} field.
85+
*/
86+
public Boolean getShowAsButton() {
87+
return showAsButton;
88+
}
89+
90+
/**
91+
* Sets the {@code show_as_button} value.
92+
*
93+
* @param showAsButton the value for {@code show_as_button}.
94+
*/
95+
public void setShowAsButton(Boolean showAsButton) {
96+
this.showAsButton = showAsButton;
97+
}
8098
}

src/test/java/com/auth0/client/mgmt/OrganizationEntityTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,7 @@ public void shouldAddConnection() throws Exception {
584584
EnabledConnection connection = new EnabledConnection();
585585
connection.setAssignMembershipOnLogin(false);
586586
connection.setConnectionId("con_123");
587+
connection.setShowAsButton(true);
587588

588589
Request<EnabledConnection> request = api.organizations().addConnection("org_abc", connection);
589590
assertThat(request, is(notNullValue()));
@@ -597,9 +598,10 @@ public void shouldAddConnection() throws Exception {
597598
assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken"));
598599

599600
Map<String, Object> body = bodyFromRequest(recordedRequest);
600-
assertThat(body, aMapWithSize(2));
601+
assertThat(body, aMapWithSize(3));
601602
assertThat(body, hasEntry("connection_id", "con_123"));
602603
assertThat(body, hasEntry("assign_membership_on_login", false));
604+
assertThat(body, hasEntry("show_as_button", true));
603605
}
604606

605607
@Test
@@ -656,6 +658,7 @@ public void shouldThrowOnUpdateConnectionWhenConnectionIsNull() {
656658
public void shouldUpdateOrgConnection() throws Exception {
657659
EnabledConnection connection = new EnabledConnection();
658660
connection.setAssignMembershipOnLogin(true);
661+
connection.setShowAsButton(false);
659662

660663
Request<EnabledConnection> request = api.organizations().updateConnection("org_abc", "con_123", connection);
661664
assertThat(request, is(notNullValue()));
@@ -669,8 +672,9 @@ public void shouldUpdateOrgConnection() throws Exception {
669672
assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken"));
670673

671674
Map<String, Object> body = bodyFromRequest(recordedRequest);
672-
assertThat(body, aMapWithSize(1));
675+
assertThat(body, aMapWithSize(2));
673676
assertThat(body, hasEntry("assign_membership_on_login", true));
677+
assertThat(body, hasEntry("show_as_button", false));
674678
}
675679

676680
// Organization roles
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"connection_id": "con_At4BWXhV3lKv82jd",
3-
"assign_membership_on_login": false
3+
"assign_membership_on_login": false,
4+
"show_as_button": true
45
}

src/test/resources/mgmt/organization_connections_list.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{
33
"connection_id": "con_At4BWXhV3lKv82jd",
44
"assign_membership_on_login": false,
5+
"show_as_button": true,
56
"connection": {
67
"name": "google-oauth2",
78
"strategy": "google-oauth2"
@@ -10,6 +11,7 @@
1011
{
1112
"connection_id": "con_kai93HmEDCs8ai3d",
1213
"assign_membership_on_login": true,
14+
"show_as_button": true,
1315
"connection": {
1416
"name": "Username-Password-Authentication",
1517
"strategy": "auth0"

src/test/resources/mgmt/organization_connections_paged_list.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{
44
"connection_id": "con_At4BWXhV3lKv82jd",
55
"assign_membership_on_login": false,
6+
"show_as_button": true,
67
"connection": {
78
"name": "google-oauth2",
89
"strategy": "google-oauth2"
@@ -11,6 +12,7 @@
1112
{
1213
"connection_id": "con_kai93HmEDCs8ai3d",
1314
"assign_membership_on_login": true,
15+
"show_as_button": true,
1416
"connection": {
1517
"name": "Username-Password-Authentication",
1618
"strategy": "auth0"

0 commit comments

Comments
 (0)