Skip to content

Commit

Permalink
Changes made based on PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
minhlongdo committed Jun 8, 2018
1 parent 56173d6 commit 8af65bd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/auth0/client/mgmt/JobsEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class JobsEntity extends BaseManagementEntity {
* @return a Request to execute.
*/
public Request<Job> sendVerificationEmail(String userId, String clientId) {
Asserts.assertNotNull(userId, "recipient");
Asserts.assertNotNull(userId, "user id");

String url = baseUrl
.newBuilder()
Expand All @@ -47,7 +47,7 @@ public Request<Job> sendVerificationEmail(String userId, String clientId) {
CustomRequest<Job> request = new CustomRequest<>(client, url, "POST", new TypeReference<Job>() {
});
request.addHeader("Authorization", "Bearer " + apiToken);
request.setBody((Object) requestBody);
request.setBody(requestBody);
return request;
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/auth0/client/mgmt/ManagementAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public ResourceServerEntity resourceServers() {
}

/**
* Getter for Jobs entity.
* Getter for the Jobs entity.
*
* @return the Jobs entity.
*/
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/com/auth0/client/mgmt/JobsEntityTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void shouldSendAUserAVerificationEmail() throws Exception {

@Test
public void shouldSendUserAVerificationEmailWithClientId() throws Exception {
Request<Job> request = api.jobs().sendVerificationEmail("google-oauth2|1234", "google-oauth2|client-id");
Request<Job> request = api.jobs().sendVerificationEmail("google-oauth2|1234", "AaiyAPdpYdesoKnqjj8HJqRn4T5titww");
assertThat(request, is(notNullValue()));

server.jsonResponse(MGMT_JOB_POST_VERIFICATION_EMAIL, 200);
Expand All @@ -53,15 +53,15 @@ public void shouldSendUserAVerificationEmailWithClientId() throws Exception {
Map<String, Object> body = bodyFromRequest(recordedRequest);
assertThat(body.size(), is(2));
assertThat(body, hasEntry("user_id", (Object) "google-oauth2|1234"));
assertThat(body, hasEntry("client_id", (Object) "google-oauth2|client-id"));
assertThat(body, hasEntry("client_id", (Object) "AaiyAPdpYdesoKnqjj8HJqRn4T5titww"));

assertThat(response, is(notNullValue()));
}

@Test
public void shouldThrowOnNullEmailRecipient() throws Exception {
public void shouldThrowOnNullUserId() throws Exception {
exception.expect(IllegalArgumentException.class);
exception.expectMessage("'recipient' cannot be null!");
exception.expectMessage("'user id' cannot be null!");
api.jobs().sendVerificationEmail(null, null);
}
}

0 comments on commit 8af65bd

Please sign in to comment.