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
11 changes: 11 additions & 0 deletions src/main/java/com/auth0/json/mgmt/client/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
14 changes: 14 additions & 0 deletions src/test/java/com/auth0/json/mgmt/client/ClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
}