Skip to content

Commit 7e939c8

Browse files
authored
Merge branch 'master' into adenix/client-is-token-endpoint-id-header-trusted
2 parents ceb8efa + e721c31 commit 7e939c8

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

src/main/java/com/auth0/json/mgmt/client/Client.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,17 @@ public Client(@JsonProperty("name") String name) {
156156
this.name = name;
157157
}
158158

159+
/**
160+
* Creates a new Application instance setting the name and client id properties.
161+
*
162+
* @param name of the application.
163+
* @param clientId the client id of the application.
164+
*/
165+
public Client(String name, String clientId) {
166+
this.name = name;
167+
this.clientId = clientId;
168+
}
169+
159170
/**
160171
* Getter for the name of the application.
161172
*

src/test/java/com/auth0/json/mgmt/client/ClientTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,4 +381,18 @@ public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception {
381381
assertThat(client.isHerokuApp(), is(true));
382382
assertThat(client.getSigningKeys(), is(notNullValue()));
383383
}
384+
385+
@Test
386+
public void shouldCreateClientWithNameOnly() {
387+
Client client = new Client("My App");
388+
assertThat(client.getName(), is("My App"));
389+
assertThat(client.getClientId(), is(nullValue()));
390+
}
391+
392+
@Test
393+
public void shouldCreateClientWithNameAndClientId() {
394+
Client client = new Client("My App", "client123");
395+
assertThat(client.getName(), is("My App"));
396+
assertThat(client.getClientId(), is("client123"));
397+
}
384398
}

0 commit comments

Comments
 (0)