diff --git a/src/main/java/com/auth0/json/mgmt/client/Client.java b/src/main/java/com/auth0/json/mgmt/client/Client.java index 35be65d26..fdac12210 100644 --- a/src/main/java/com/auth0/json/mgmt/client/Client.java +++ b/src/main/java/com/auth0/json/mgmt/client/Client.java @@ -154,6 +154,17 @@ public Client(@JsonProperty("name") String name) { this.name = name; } + /** + * Creates a new Application instance setting the name and client id properties. + * + * @param name of the application. + * @param clientId the client id of the application. + */ + public Client(String name, String clientId) { + this.name = name; + this.clientId = clientId; + } + /** * Getter for the name of the application. * diff --git a/src/test/java/com/auth0/json/mgmt/client/ClientTest.java b/src/test/java/com/auth0/json/mgmt/client/ClientTest.java index 301976258..e9ac5233b 100644 --- a/src/test/java/com/auth0/json/mgmt/client/ClientTest.java +++ b/src/test/java/com/auth0/json/mgmt/client/ClientTest.java @@ -377,4 +377,18 @@ public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { assertThat(client.isHerokuApp(), is(true)); assertThat(client.getSigningKeys(), is(notNullValue())); } + + @Test + public void shouldCreateClientWithNameOnly() { + Client client = new Client("My App"); + assertThat(client.getName(), is("My App")); + assertThat(client.getClientId(), is(nullValue())); + } + + @Test + public void shouldCreateClientWithNameAndClientId() { + Client client = new Client("My App", "client123"); + assertThat(client.getName(), is("My App")); + assertThat(client.getClientId(), is("client123")); + } }