Skip to content
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
14 changes: 13 additions & 1 deletion src/main/java/com/auth0/json/mgmt/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public class Connection {
private String strategy;
@JsonProperty("enabled_clients")
private List<String> enabledClients = null;
@JsonProperty("provisioning_ticket_url")
private String provisioningTicketUrl;

public Connection() {
}
Expand Down Expand Up @@ -105,5 +107,15 @@ public List<String> getEnabledClients() {
public void setEnabledClients(List<String> enabledClients) {
this.enabledClients = enabledClients;
}

/**
* Getter for the ad/ldap connection's ticket url.
*
* @return the provisioning ticket url.
*/
@JsonProperty("provisioning_ticket_url")
public String getProvisioningTicketUrl() {
return provisioningTicketUrl;
}

}
}
16 changes: 16 additions & 0 deletions src/test/java/com/auth0/json/mgmt/ConnectionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public class ConnectionTest extends JsonTest<Connection> {
private static final String json = "{\"name\":\"my-connection\",\"strategy\":\"auth0\",\"options\":{},\"enabled_clients\":[\"client1\",\"client2\"]}";
private static final String readOnlyJson = "{\"id\":\"connectionId\"}";

private static final String jsonAd = "{\"name\":\"my-ad-connection\",\"strategy\":\"ad\",\"provisioning_ticket_url\":\"https://demo.auth0.com/p/ad/ddQTRlVt\",\"options\":{},\"enabled_clients\":[\"client1\",\"client2\"]}";

@Test
public void shouldSerialize() throws Exception {
Connection connection = new Connection("my-connection", "auth0");
Expand All @@ -27,6 +29,7 @@ public void shouldSerialize() throws Exception {
assertThat(serialized, JsonMatcher.hasEntry("strategy", "auth0"));
assertThat(serialized, JsonMatcher.hasEntry("options", notNullValue()));
assertThat(serialized, JsonMatcher.hasEntry("enabled_clients", Arrays.asList("client1", "client2")));
assertThat(serialized, JsonMatcher.hasEntry("provisioning_ticket_url", null));
}

@Test
Expand All @@ -38,6 +41,19 @@ public void shouldDeserialize() throws Exception {
assertThat(connection.getOptions(), is(notNullValue()));
assertThat(connection.getStrategy(), is("auth0"));
assertThat(connection.getEnabledClients(), contains("client1", "client2"));
assertThat(connection.getProvisioningTicketUrl(), is(nullValue()));
}

@Test
public void shouldDeserializeAd() throws Exception {
Connection connection = fromJSON(jsonAd, Connection.class);

assertThat(connection, is(notNullValue()));
assertThat(connection.getName(), is("my-ad-connection"));
assertThat(connection.getOptions(), is(notNullValue()));
assertThat(connection.getStrategy(), is("ad"));
assertThat(connection.getEnabledClients(), contains("client1", "client2"));
assertThat(connection.getProvisioningTicketUrl(), is("https://demo.auth0.com/p/ad/ddQTRlVt"));
}

@Test
Expand Down