From f735f89046efcd60aba451129aa8e9a1dfba2e00 Mon Sep 17 00:00:00 2001 From: Luciano Balmaceda Date: Tue, 7 Apr 2020 17:41:10 -0300 Subject: [PATCH] add missing failure scenario tests --- .../com/auth0/client/mgmt/JobsEntityTest.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/test/java/com/auth0/client/mgmt/JobsEntityTest.java b/src/test/java/com/auth0/client/mgmt/JobsEntityTest.java index 53434b00..20418a83 100644 --- a/src/test/java/com/auth0/client/mgmt/JobsEntityTest.java +++ b/src/test/java/com/auth0/client/mgmt/JobsEntityTest.java @@ -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 request = api.jobs().requestUsersExport("con_123456789", null); assertThat(request, is(notNullValue())); @@ -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 request = api.jobs().requestUsersExport("con_123456789", filter); @@ -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 request = api.jobs().requestUsersExport("con_123456789", filter); @@ -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 fields = new ArrayList<>(); fields.add(new UsersExportField("full_name")); @@ -146,7 +153,7 @@ public void shouldRequestAUsersExportWithFields() throws Exception { } @Test - public void shouldSendAUserAVerificationEmail() throws Exception { + public void shouldSendUserAVerificationEmail() throws Exception { Request request = api.jobs().sendVerificationEmail("google-oauth2|1234", null); assertThat(request, is(notNullValue())); @@ -166,7 +173,7 @@ public void shouldSendAUserAVerificationEmail() throws Exception { } @Test - public void shouldSendUserAVerificationEmailWithClientId() throws Exception { + public void shouldSendUserVerificationEmailWithClientId() throws Exception { Request request = api.jobs().sendVerificationEmail("google-oauth2|1234", "AaiyAPdpYdesoKnqjj8HJqRn4T5titww"); assertThat(request, is(notNullValue())); @@ -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);