Skip to content

Commit

Permalink
add missing failure scenario tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lbalmaceda committed Apr 14, 2020
1 parent dfa8ef9 commit f735f89
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/test/java/com/auth0/client/mgmt/JobsEntityTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ public void shouldGetJob() throws Exception {
}

@Test
public void shouldRequestAUsersExport() throws Exception {
public void shouldThrowOnRequestUsersExportWithNullConnectionId() {
exception.expect(IllegalArgumentException.class);
exception.expectMessage("'connection id' cannot be null!");
api.jobs().requestUsersExport(null, null);
}

@Test
public void shouldRequestUsersExport() throws Exception {
Request<Job> request = api.jobs().requestUsersExport("con_123456789", null);
assertThat(request, is(notNullValue()));

Expand All @@ -68,7 +75,7 @@ public void shouldRequestAUsersExport() throws Exception {
}

@Test
public void shouldRequestAUsersExportWithLimit() throws Exception {
public void shouldRequestUsersExportWithLimit() throws Exception {
UsersExportFilter filter = new UsersExportFilter();
filter.withLimit(82);
Request<Job> request = api.jobs().requestUsersExport("con_123456789", filter);
Expand All @@ -91,7 +98,7 @@ public void shouldRequestAUsersExportWithLimit() throws Exception {
}

@Test
public void shouldRequestAUsersExportWithFormat() throws Exception {
public void shouldRequestUsersExportWithFormat() throws Exception {
UsersExportFilter filter = new UsersExportFilter();
filter.withFormat("csv");
Request<Job> request = api.jobs().requestUsersExport("con_123456789", filter);
Expand All @@ -114,7 +121,7 @@ public void shouldRequestAUsersExportWithFormat() throws Exception {
}

@Test
public void shouldRequestAUsersExportWithFields() throws Exception {
public void shouldRequestUsersExportWithFields() throws Exception {
UsersExportFilter filter = new UsersExportFilter();
ArrayList<UsersExportField> fields = new ArrayList<>();
fields.add(new UsersExportField("full_name"));
Expand Down Expand Up @@ -146,7 +153,7 @@ public void shouldRequestAUsersExportWithFields() throws Exception {
}

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

Expand All @@ -166,7 +173,7 @@ public void shouldSendAUserAVerificationEmail() throws Exception {
}

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

Expand All @@ -187,7 +194,7 @@ public void shouldSendUserAVerificationEmailWithClientId() throws Exception {
}

@Test
public void shouldThrowOnNullUserId() {
public void shouldThrowOnSendUserVerificationEmailWithNullUserId() {
exception.expect(IllegalArgumentException.class);
exception.expectMessage("'user id' cannot be null!");
api.jobs().sendVerificationEmail(null, null);
Expand Down

0 comments on commit f735f89

Please sign in to comment.