diff --git a/src/test/java/com/auth0/client/auth/AuthAPITest.java b/src/test/java/com/auth0/client/auth/AuthAPITest.java index f8cd87f0..0b3e0951 100644 --- a/src/test/java/com/auth0/client/auth/AuthAPITest.java +++ b/src/test/java/com/auth0/client/auth/AuthAPITest.java @@ -62,7 +62,7 @@ public void tearDown() throws Exception { // Configuration @Test - public void shouldAcceptDomainWithNoScheme() throws Exception { + public void shouldAcceptDomainWithNoScheme() { AuthAPI api = new AuthAPI("me.something.com", CLIENT_ID, CLIENT_SECRET); assertThat(api.getBaseUrl(), is(notNullValue())); @@ -70,7 +70,7 @@ public void shouldAcceptDomainWithNoScheme() throws Exception { } @Test - public void shouldAcceptDomainWithHttpScheme() throws Exception { + public void shouldAcceptDomainWithHttpScheme() { AuthAPI api = new AuthAPI("http://me.something.com", CLIENT_ID, CLIENT_SECRET); assertThat(api.getBaseUrl(), is(notNullValue())); @@ -78,28 +78,28 @@ public void shouldAcceptDomainWithHttpScheme() throws Exception { } @Test - public void shouldThrowWhenDomainIsInvalid() throws Exception { + public void shouldThrowWhenDomainIsInvalid() { exception.expect(IllegalArgumentException.class); exception.expectMessage("The domain had an invalid format and couldn't be parsed as an URL."); new AuthAPI("", CLIENT_ID, CLIENT_SECRET); } @Test - public void shouldThrowWhenDomainIsNull() throws Exception { + public void shouldThrowWhenDomainIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'domain' cannot be null!"); new AuthAPI(null, CLIENT_ID, CLIENT_SECRET); } @Test - public void shouldThrowWhenClientIdIsNull() throws Exception { + public void shouldThrowWhenClientIdIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'client id' cannot be null!"); new AuthAPI(DOMAIN, null, CLIENT_SECRET); } @Test - public void shouldThrowWhenClientSecretIsNull() throws Exception { + public void shouldThrowWhenClientSecretIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'client secret' cannot be null!"); new AuthAPI(DOMAIN, CLIENT_ID, null); @@ -223,7 +223,7 @@ public void proxyShouldNotProcessAlreadyAuthenticatedRequest() throws Exception } @Test - public void shouldUseCustomTelemetry() throws Exception { + public void shouldUseCustomTelemetry() { AuthAPI api = new AuthAPI(DOMAIN, CLIENT_ID, CLIENT_SECRET); assertThat(api.getClient().interceptors(), hasItem(isA(TelemetryInterceptor.class))); @@ -250,7 +250,7 @@ public void shouldUseCustomTelemetry() throws Exception { } @Test - public void shouldAddAndEnableTelemetryInterceptor() throws Exception { + public void shouldAddAndEnableTelemetryInterceptor() { AuthAPI api = new AuthAPI(DOMAIN, CLIENT_ID, CLIENT_SECRET); assertThat(api.getClient().interceptors(), hasItem(isA(TelemetryInterceptor.class))); @@ -263,7 +263,7 @@ public void shouldAddAndEnableTelemetryInterceptor() throws Exception { } @Test - public void shouldDisableTelemetryInterceptor() throws Exception { + public void shouldDisableTelemetryInterceptor() { AuthAPI api = new AuthAPI(DOMAIN, CLIENT_ID, CLIENT_SECRET); assertThat(api.getClient().interceptors(), hasItem(isA(TelemetryInterceptor.class))); api.doNotSendTelemetry(); @@ -277,7 +277,7 @@ public void shouldDisableTelemetryInterceptor() throws Exception { } @Test - public void shouldAddAndDisableLoggingInterceptor() throws Exception { + public void shouldAddAndDisableLoggingInterceptor() { AuthAPI api = new AuthAPI(DOMAIN, CLIENT_ID, CLIENT_SECRET); assertThat(api.getClient().interceptors(), hasItem(isA(HttpLoggingInterceptor.class))); @@ -290,7 +290,7 @@ public void shouldAddAndDisableLoggingInterceptor() throws Exception { } @Test - public void shouldEnableLoggingInterceptor() throws Exception { + public void shouldEnableLoggingInterceptor() { AuthAPI api = new AuthAPI(DOMAIN, CLIENT_ID, CLIENT_SECRET); assertThat(api.getClient().interceptors(), hasItem(isA(HttpLoggingInterceptor.class))); api.setLoggingEnabled(true); @@ -304,7 +304,7 @@ public void shouldEnableLoggingInterceptor() throws Exception { } @Test - public void shouldDisableLoggingInterceptor() throws Exception { + public void shouldDisableLoggingInterceptor() { AuthAPI api = new AuthAPI(DOMAIN, CLIENT_ID, CLIENT_SECRET); assertThat(api.getClient().interceptors(), hasItem(isA(HttpLoggingInterceptor.class))); api.setLoggingEnabled(false); @@ -320,27 +320,27 @@ public void shouldDisableLoggingInterceptor() throws Exception { //Authorize @Test - public void shouldThrowWhenAuthorizeUrlBuilderRedirectUriIsNull() throws Exception { + public void shouldThrowWhenAuthorizeUrlBuilderRedirectUriIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'redirect uri' must be a valid URL!"); api.authorizeUrl(null); } @Test - public void shouldThrowWhenAuthorizeUrlBuilderRedirectUriIsNotValidURL() throws Exception { + public void shouldThrowWhenAuthorizeUrlBuilderRedirectUriIsNotValidURL() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'redirect uri' must be a valid URL!"); api.authorizeUrl("notvalid.url"); } @Test - public void shouldGetAuthorizeUrlBuilder() throws Exception { + public void shouldGetAuthorizeUrlBuilder() { AuthorizeUrlBuilder builder = api.authorizeUrl("https://domain.auth0.com/callback"); assertThat(builder, is(notNullValue())); } @Test - public void shouldSetAuthorizeUrlBuilderDefaultValues() throws Exception { + public void shouldSetAuthorizeUrlBuilderDefaultValues() { AuthAPI api = new AuthAPI("domain.auth0.com", CLIENT_ID, CLIENT_SECRET); String url = api.authorizeUrl("https://domain.auth0.com/callback").build(); @@ -355,27 +355,27 @@ public void shouldSetAuthorizeUrlBuilderDefaultValues() throws Exception { //Logout @Test - public void shouldThrowWhenLogoutUrlBuilderReturnToUrlIsNull() throws Exception { + public void shouldThrowWhenLogoutUrlBuilderReturnToUrlIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'return to url' must be a valid URL!"); api.logoutUrl(null, true); } @Test - public void shouldThrowWhenLogoutUrlBuilderRedirectUriIsNotValidURL() throws Exception { + public void shouldThrowWhenLogoutUrlBuilderRedirectUriIsNotValidURL() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'return to url' must be a valid URL!"); api.logoutUrl("notvalid.url", true); } @Test - public void shouldGetLogoutUrlBuilder() throws Exception { + public void shouldGetLogoutUrlBuilder() { LogoutUrlBuilder builder = api.logoutUrl("https://domain.auth0.com/callback", true); assertThat(builder, is(notNullValue())); } @Test - public void shouldSetLogoutUrlBuilderDefaultValues() throws Exception { + public void shouldSetLogoutUrlBuilderDefaultValues() { AuthAPI api = new AuthAPI("domain.auth0.com", CLIENT_ID, CLIENT_SECRET); String url = api.logoutUrl("https://my.domain.com/welcome", false).build(); @@ -385,7 +385,7 @@ public void shouldSetLogoutUrlBuilderDefaultValues() throws Exception { } @Test - public void shouldSetLogoutUrlBuilderDefaultValuesAndClientId() throws Exception { + public void shouldSetLogoutUrlBuilderDefaultValuesAndClientId() { AuthAPI api = new AuthAPI("domain.auth0.com", CLIENT_ID, CLIENT_SECRET); String url = api.logoutUrl("https://my.domain.com/welcome", true).build(); @@ -398,7 +398,7 @@ public void shouldSetLogoutUrlBuilderDefaultValuesAndClientId() throws Exception //UserInfo @Test - public void shouldThrowOnUserInfoWithNullAccessToken() throws Exception { + public void shouldThrowOnUserInfoWithNullAccessToken() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'access token' cannot be null!"); api.userInfo(null); @@ -442,14 +442,14 @@ public void shouldCreateUserInfoRequest() throws Exception { //Reset Password @Test - public void shouldThrowOnResetPasswordWithNullEmail() throws Exception { + public void shouldThrowOnResetPasswordWithNullEmail() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'email' cannot be null!"); api.resetPassword(null, "my-connection"); } @Test - public void shouldThrowOnResetPasswordWithNullConnection() throws Exception { + public void shouldThrowOnResetPasswordWithNullConnection() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'connection' cannot be null!"); api.resetPassword("me@auth0.com", null); @@ -481,7 +481,7 @@ public void shouldCreateResetPasswordRequest() throws Exception { @SuppressWarnings("deprecation") @Test - public void shouldThrowOnSignUpWithNullEmail() throws Exception { + public void shouldThrowOnSignUpWithNullEmail() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'email' cannot be null!"); api.signUp(null, "p455w0rd", "my-connection"); @@ -489,14 +489,14 @@ public void shouldThrowOnSignUpWithNullEmail() throws Exception { @SuppressWarnings("deprecation") @Test - public void shouldThrowOnSignUpWithNullPasswordString() throws Exception { + public void shouldThrowOnSignUpWithNullPasswordString() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'password' cannot be null!"); api.signUp("me@auth0.com", (String) null, "my-connection"); } @Test - public void shouldThrowOnSignUpWithNullPasswordCharArray() throws Exception { + public void shouldThrowOnSignUpWithNullPasswordCharArray() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'password' cannot be null!"); api.signUp("me@auth0.com", (char[]) null, "my-connection"); @@ -504,7 +504,7 @@ public void shouldThrowOnSignUpWithNullPasswordCharArray() throws Exception { @SuppressWarnings("deprecation") @Test - public void shouldThrowOnSignUpWithNullConnection() throws Exception { + public void shouldThrowOnSignUpWithNullConnection() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'connection' cannot be null!"); api.signUp("me@auth0.com", "p455w0rd", null); @@ -512,7 +512,7 @@ public void shouldThrowOnSignUpWithNullConnection() throws Exception { @SuppressWarnings("deprecation") @Test - public void shouldThrowOnUsernameSignUpWithNullEmail() throws Exception { + public void shouldThrowOnUsernameSignUpWithNullEmail() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'email' cannot be null!"); api.signUp(null, "me", "p455w0rd", "my-connection"); @@ -520,7 +520,7 @@ public void shouldThrowOnUsernameSignUpWithNullEmail() throws Exception { @SuppressWarnings("deprecation") @Test - public void shouldThrowOnUsernameSignUpWithNullUsername() throws Exception { + public void shouldThrowOnUsernameSignUpWithNullUsername() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'username' cannot be null!"); api.signUp("me@auth0.com", null, "p455w0rd", "my-connection"); @@ -528,14 +528,14 @@ public void shouldThrowOnUsernameSignUpWithNullUsername() throws Exception { @SuppressWarnings("deprecation") @Test - public void shouldThrowOnUsernameSignUpWithNullPasswordString() throws Exception { + public void shouldThrowOnUsernameSignUpWithNullPasswordString() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'password' cannot be null!"); api.signUp("me@auth0.com", "me", (String) null, "my-connection"); } @Test - public void shouldThrowOnUsernameSignUpWithNullPasswordCharArray() throws Exception { + public void shouldThrowOnUsernameSignUpWithNullPasswordCharArray() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'password' cannot be null!"); api.signUp("me@auth0.com", "me", (char[]) null, "my-connection"); @@ -543,7 +543,7 @@ public void shouldThrowOnUsernameSignUpWithNullPasswordCharArray() throws Except @SuppressWarnings("deprecation") @Test - public void shouldThrowOnUsernameSignUpWithNullConnection() throws Exception { + public void shouldThrowOnUsernameSignUpWithNullConnection() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'connection' cannot be null!"); api.signUp("me@auth0.com", "me", "p455w0rd", null); @@ -667,14 +667,14 @@ public void shouldCreateSignUpRequestWithCustomParameters() throws Exception { //Log In with AuthorizationCode Grant @Test - public void shouldThrowOnLogInWithAuthorizationCodeGrantAndRedirectUriWithNullCode() throws Exception { + public void shouldThrowOnLogInWithAuthorizationCodeGrantAndRedirectUriWithNullCode() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'code' cannot be null!"); api.exchangeCode(null, "https://domain.auth0.com/callback"); } @Test - public void shouldThrowOnLogInWithAuthorizationCodeGrantAndRedirectUriWithNullRedirectUri() throws Exception { + public void shouldThrowOnLogInWithAuthorizationCodeGrantAndRedirectUriWithNullRedirectUri() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'redirect uri' cannot be null!"); api.exchangeCode("code", null); @@ -745,7 +745,7 @@ public void shouldCreateLogInWithAuthorizationCodeGrantRequestWithCustomParamete @SuppressWarnings("deprecation") @Test - public void shouldThrowOnLogInWithPasswordWithNullUsername() throws Exception { + public void shouldThrowOnLogInWithPasswordWithNullUsername() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'email or username' cannot be null!"); api.login(null, "p455w0rd"); @@ -753,14 +753,14 @@ public void shouldThrowOnLogInWithPasswordWithNullUsername() throws Exception { @SuppressWarnings("deprecation") @Test - public void shouldThrowOnLogInWithPasswordWithNullPassword() throws Exception { + public void shouldThrowOnLogInWithPasswordWithNullPassword() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'password' cannot be null!"); api.login("me", (String) null); } @Test - public void shouldThrowOnLogInWithCharPasswordWithNullPassword() throws Exception { + public void shouldThrowOnLogInWithCharPasswordWithNullPassword() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'password' cannot be null!"); api.login("me", (char[]) null); @@ -860,7 +860,7 @@ public void shouldSetCustomHeaderWithPasswordlessRealmRequest() throws Exception @SuppressWarnings("deprecation") @Test - public void shouldThrowOnLogInWithPasswordRealmWithNullUsername() throws Exception { + public void shouldThrowOnLogInWithPasswordRealmWithNullUsername() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'email or username' cannot be null!"); api.login(null, "p455w0rd", "realm"); @@ -868,14 +868,14 @@ public void shouldThrowOnLogInWithPasswordRealmWithNullUsername() throws Excepti @SuppressWarnings("deprecation") @Test - public void shouldThrowOnLogInWithPasswordRealmWithNullPasswordString() throws Exception { + public void shouldThrowOnLogInWithPasswordRealmWithNullPasswordString() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'password' cannot be null!"); api.login("me", (String) null, "realm"); } @Test - public void shouldThrowOnLogInWithPasswordRealmWithNullPasswordCharArray() throws Exception { + public void shouldThrowOnLogInWithPasswordRealmWithNullPasswordCharArray() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'password' cannot be null!"); api.login("me", (char[]) null, "realm"); @@ -883,7 +883,7 @@ public void shouldThrowOnLogInWithPasswordRealmWithNullPasswordCharArray() throw @SuppressWarnings("deprecation") @Test - public void shouldThrowOnLogInWithPasswordRealmWithNullRealm() throws Exception { + public void shouldThrowOnLogInWithPasswordRealmWithNullRealm() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'realm' cannot be null!"); api.login("me", "p455w0rd", null); @@ -956,7 +956,7 @@ public void shouldCreateLogInWithPasswordRealmGrantRequestWithCustomParameters() //Log In with ClientCredentials grant @Test - public void shouldThrowOnLogInWithClientCredentialsWithNullAudience() throws Exception { + public void shouldThrowOnLogInWithClientCredentialsWithNullAudience() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'audience' cannot be null!"); api.requestToken(null); @@ -1016,14 +1016,14 @@ public void shouldCreateStartEmailPasswordlessFlowRequest() throws Exception { } @Test - public void startPasswordlessEmailFlowShouldThrowWhenEmailIsNull() throws Exception { + public void startPasswordlessEmailFlowShouldThrowWhenEmailIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'email' cannot be null!"); Request request = api.startPasswordlessEmailFlow(null, PasswordlessEmailType.CODE); } @Test - public void startPasswordlessEmailFlowShouldThrowWhenTypeIsNull() throws Exception { + public void startPasswordlessEmailFlowShouldThrowWhenTypeIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'type' cannot be null!"); Request request = api.startPasswordlessEmailFlow("user@domain.com", null); @@ -1121,7 +1121,7 @@ public void shouldCreateStartSmsPasswordlessFlowRequestWithCustomConnection() th } @Test - public void startPasswordlessSmsFlowShouldThrowWhenPhoneIsNull() throws Exception { + public void startPasswordlessSmsFlowShouldThrowWhenPhoneIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'phoneNumber' cannot be null!"); api.startPasswordlessSmsFlow(null); @@ -1157,7 +1157,7 @@ public void shouldCreateLoginWithPasswordlessCodeRequest() throws Exception { //Revoke a Token @Test - public void shouldThrowOnRevokeTokenWithNullToken() throws Exception { + public void shouldThrowOnRevokeTokenWithNullToken() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'refresh token' cannot be null!"); api.revokeToken(null); @@ -1187,7 +1187,7 @@ public void shouldCreateRevokeTokenRequest() throws Exception { //Renew Authentication using Refresh Token @Test - public void shouldThrowOnRenewAuthWithNullRefreshToken() throws Exception { + public void shouldThrowOnRenewAuthWithNullRefreshToken() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'refresh token' cannot be null!"); api.renewAuth(null); diff --git a/src/test/java/com/auth0/client/auth/AuthorizeUrlBuilderTest.java b/src/test/java/com/auth0/client/auth/AuthorizeUrlBuilderTest.java index 4d4a39fc..b93ef5aa 100644 --- a/src/test/java/com/auth0/client/auth/AuthorizeUrlBuilderTest.java +++ b/src/test/java/com/auth0/client/auth/AuthorizeUrlBuilderTest.java @@ -23,61 +23,61 @@ public class AuthorizeUrlBuilderTest { public ExpectedException exception = ExpectedException.none(); @Test - public void shouldThrowWhenBaseUrlIsNull() throws Exception { + public void shouldThrowWhenBaseUrlIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'base url' cannot be null!"); AuthorizeUrlBuilder.newInstance(null, CLIENT_ID, REDIRECT_URI); } @Test - public void shouldThrowWhenRedirectUriIsNull() throws Exception { + public void shouldThrowWhenRedirectUriIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'redirect uri' cannot be null!"); AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, null); } @Test - public void shouldThrowWhenClientIdIsNull() throws Exception { + public void shouldThrowWhenClientIdIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'client id' cannot be null!"); AuthorizeUrlBuilder.newInstance(DOMAIN, null, REDIRECT_URI); } @Test - public void shouldGetNewInstance() throws Exception { + public void shouldGetNewInstance() { AuthorizeUrlBuilder instance = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI); assertThat(instance, is(notNullValue())); } @Test - public void shouldBuildValidAuthorizeUrlWithHttp() throws Exception { + public void shouldBuildValidAuthorizeUrlWithHttp() { HttpUrl httpBaseUrl = HttpUrl.parse("http://domain.auth0.com"); String url = AuthorizeUrlBuilder.newInstance(httpBaseUrl, CLIENT_ID, REDIRECT_URI).build(); assertThat(url, isUrl("http", "domain.auth0.com", "/authorize")); } @Test - public void shouldBuildValidAuthorizeUrlWithHttps() throws Exception { + public void shouldBuildValidAuthorizeUrlWithHttps() { HttpUrl httpsBaseUrl = HttpUrl.parse("https://domain.auth0.com"); String url = AuthorizeUrlBuilder.newInstance(httpsBaseUrl, CLIENT_ID, REDIRECT_URI).build(); assertThat(url, isUrl("https", "domain.auth0.com", "/authorize")); } @Test - public void shouldAddResponseTypeCode() throws Exception { + public void shouldAddResponseTypeCode() { String url = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI).build(); assertThat(url, hasQueryParameter("response_type", "code")); } @Test - public void shouldAddClientId() throws Exception { + public void shouldAddClientId() { String url = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI).build(); assertThat(url, hasQueryParameter("client_id", CLIENT_ID)); } @Test - public void shouldAddRedirectUri() throws Exception { + public void shouldAddRedirectUri() { String url = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI).build(); assertThat(url, hasQueryParameter("redirect_uri", REDIRECT_URI)); } @@ -90,7 +90,7 @@ public void shouldNotEncodeTwiceTheRedirectUri() throws Exception { } @Test - public void shouldSetConnection() throws Exception { + public void shouldSetConnection() { String url = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) .withConnection("my-connection") .build(); @@ -98,7 +98,7 @@ public void shouldSetConnection() throws Exception { } @Test - public void shouldThrowWhenConnectionIsNull() throws Exception { + public void shouldThrowWhenConnectionIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'connection' cannot be null!"); AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) @@ -106,7 +106,7 @@ public void shouldThrowWhenConnectionIsNull() throws Exception { } @Test - public void shouldSetAudience() throws Exception { + public void shouldSetAudience() { String url = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) .withAudience("https://myapi.domain.com/users") .build(); @@ -114,7 +114,7 @@ public void shouldSetAudience() throws Exception { } @Test - public void shouldThrowWhenAudienceIsNull() throws Exception { + public void shouldThrowWhenAudienceIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'audience' cannot be null!"); AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) @@ -122,7 +122,7 @@ public void shouldThrowWhenAudienceIsNull() throws Exception { } @Test - public void shouldSetState() throws Exception { + public void shouldSetState() { String url = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) .withState("1234567890") .build(); @@ -130,7 +130,7 @@ public void shouldSetState() throws Exception { } @Test - public void shouldThrowWhenStateIsNull() throws Exception { + public void shouldThrowWhenStateIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'state' cannot be null!"); AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) @@ -138,7 +138,7 @@ public void shouldThrowWhenStateIsNull() throws Exception { } @Test - public void shouldSetScope() throws Exception { + public void shouldSetScope() { String url = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) .withScope("profile email contacts") .build(); @@ -146,7 +146,7 @@ public void shouldSetScope() throws Exception { } @Test - public void shouldThrowWhenScopeIsNull() throws Exception { + public void shouldThrowWhenScopeIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'scope' cannot be null!"); AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) @@ -154,7 +154,7 @@ public void shouldThrowWhenScopeIsNull() throws Exception { } @Test - public void shouldSetResponseType() throws Exception { + public void shouldSetResponseType() { String url = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) .withResponseType("token id_token") .build(); @@ -162,7 +162,7 @@ public void shouldSetResponseType() throws Exception { } @Test - public void shouldThrowWhenResponseTypeIsNull() throws Exception { + public void shouldThrowWhenResponseTypeIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'response type' cannot be null!"); AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) @@ -170,7 +170,7 @@ public void shouldThrowWhenResponseTypeIsNull() throws Exception { } @Test - public void shouldSetCustomParameter() throws Exception { + public void shouldSetCustomParameter() { String url = AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) .withParameter("name", "value") .build(); @@ -178,7 +178,7 @@ public void shouldSetCustomParameter() throws Exception { } @Test - public void shouldThrowWhenCustomParameterNameIsNull() throws Exception { + public void shouldThrowWhenCustomParameterNameIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'name' cannot be null!"); AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) @@ -186,10 +186,10 @@ public void shouldThrowWhenCustomParameterNameIsNull() throws Exception { } @Test - public void shouldThrowWhenCustomParameterValueIsNull() throws Exception { + public void shouldThrowWhenCustomParameterValueIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'value' cannot be null!"); AuthorizeUrlBuilder.newInstance(DOMAIN, CLIENT_ID, REDIRECT_URI) .withParameter("name", null); } -} \ No newline at end of file +} diff --git a/src/test/java/com/auth0/client/auth/LogoutUrlBuilderTest.java b/src/test/java/com/auth0/client/auth/LogoutUrlBuilderTest.java index af8656d2..59390a1a 100644 --- a/src/test/java/com/auth0/client/auth/LogoutUrlBuilderTest.java +++ b/src/test/java/com/auth0/client/auth/LogoutUrlBuilderTest.java @@ -23,46 +23,46 @@ public class LogoutUrlBuilderTest { public ExpectedException exception = ExpectedException.none(); @Test - public void shouldThrowWhenBaseUrlIsNull() throws Exception { + public void shouldThrowWhenBaseUrlIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'base url' cannot be null!"); LogoutUrlBuilder.newInstance(null, CLIENT_ID, RETURN_TO_URL, true); } @Test - public void shouldThrowWhenReturnToURLIsNull() throws Exception { + public void shouldThrowWhenReturnToURLIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'return to url' cannot be null!"); LogoutUrlBuilder.newInstance(DOMAIN, CLIENT_ID, null, true); } @Test - public void shouldNotThrowWhenClientIdIsNull() throws Exception { + public void shouldNotThrowWhenClientIdIsNull() { LogoutUrlBuilder.newInstance(DOMAIN, null, RETURN_TO_URL, true); } @Test - public void shouldGetNewInstance() throws Exception { + public void shouldGetNewInstance() { LogoutUrlBuilder instance = LogoutUrlBuilder.newInstance(DOMAIN, CLIENT_ID, RETURN_TO_URL, true); assertThat(instance, is(notNullValue())); } @Test - public void shouldBuildValidLogoutUrlWithHttp() throws Exception { + public void shouldBuildValidLogoutUrlWithHttp() { HttpUrl httpBaseUrl = HttpUrl.parse("http://domain.auth0.com"); String url = LogoutUrlBuilder.newInstance(httpBaseUrl, CLIENT_ID, RETURN_TO_URL, true).build(); assertThat(url, isUrl("http", "domain.auth0.com", "/v2/logout")); } @Test - public void shouldBuildValidLogoutUrlWithHttps() throws Exception { + public void shouldBuildValidLogoutUrlWithHttps() { HttpUrl httpsBaseUrl = HttpUrl.parse("https://domain.auth0.com"); String url = LogoutUrlBuilder.newInstance(httpsBaseUrl, CLIENT_ID, RETURN_TO_URL, true).build(); assertThat(url, isUrl("https", "domain.auth0.com", "/v2/logout")); } @Test - public void shouldAddReturnToURL() throws Exception { + public void shouldAddReturnToURL() { String url = LogoutUrlBuilder.newInstance(DOMAIN, CLIENT_ID, RETURN_TO_URL, true).build(); assertThat(url, hasQueryParameter("returnTo", RETURN_TO_URL)); } @@ -75,19 +75,19 @@ public void shouldNotEncodeTwiceTheReturnToURL() throws Exception { } @Test - public void shouldNotAddClientId() throws Exception { + public void shouldNotAddClientId() { String url = LogoutUrlBuilder.newInstance(DOMAIN, CLIENT_ID, RETURN_TO_URL, false).build(); assertThat(url, hasQueryParameter("client_id", null)); } @Test - public void shouldAddClientId() throws Exception { + public void shouldAddClientId() { String url = LogoutUrlBuilder.newInstance(DOMAIN, CLIENT_ID, RETURN_TO_URL, true).build(); assertThat(url, hasQueryParameter("client_id", CLIENT_ID)); } @Test - public void shouldUseFederated() throws Exception { + public void shouldUseFederated() { String url = LogoutUrlBuilder.newInstance(DOMAIN, CLIENT_ID, RETURN_TO_URL, true) .useFederated(true) .build(); @@ -95,11 +95,11 @@ public void shouldUseFederated() throws Exception { } @Test - public void shouldNotUseFederated() throws Exception { + public void shouldNotUseFederated() { String url = LogoutUrlBuilder.newInstance(DOMAIN, CLIENT_ID, RETURN_TO_URL, true) .useFederated(false) .build(); assertThat(url, hasQueryParameter("federated", null)); } -} \ No newline at end of file +} diff --git a/src/test/java/com/auth0/client/mgmt/BlacklistsEntityTest.java b/src/test/java/com/auth0/client/mgmt/BlacklistsEntityTest.java index 7a8f7797..95dbe018 100644 --- a/src/test/java/com/auth0/client/mgmt/BlacklistsEntityTest.java +++ b/src/test/java/com/auth0/client/mgmt/BlacklistsEntityTest.java @@ -16,7 +16,7 @@ public class BlacklistsEntityTest extends BaseMgmtEntityTest { @Test - public void shouldThrowOnGetBlacklistedTokensWithNullAudience() throws Exception { + public void shouldThrowOnGetBlacklistedTokensWithNullAudience() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'audience' cannot be null!"); api.blacklists().getBlacklist(null); @@ -53,7 +53,7 @@ public void shouldReturnEmptyBlacklistedTokens() throws Exception { } @Test - public void shouldThrowOnBlacklistTokensWithNullToken() throws Exception { + public void shouldThrowOnBlacklistTokensWithNullToken() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'token' cannot be null!"); api.blacklists().blacklistToken(null); diff --git a/src/test/java/com/auth0/client/mgmt/ClientGrantsEntityTest.java b/src/test/java/com/auth0/client/mgmt/ClientGrantsEntityTest.java index 7a34b3b0..b0949c0c 100644 --- a/src/test/java/com/auth0/client/mgmt/ClientGrantsEntityTest.java +++ b/src/test/java/com/auth0/client/mgmt/ClientGrantsEntityTest.java @@ -133,21 +133,21 @@ public void shouldReturnEmptyClientGrants() throws Exception { } @Test - public void shouldThrowOnCreateClientGrantWithNullClientId() throws Exception { + public void shouldThrowOnCreateClientGrantWithNullClientId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'client id' cannot be null!"); api.clientGrants().create(null, "audience", new String[]{"openid"}); } @Test - public void shouldThrowOnCreateClientGrantWithNullAudience() throws Exception { + public void shouldThrowOnCreateClientGrantWithNullAudience() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'audience' cannot be null!"); api.clientGrants().create("clientId", null, new String[]{"openid"}); } @Test - public void shouldThrowOnCreateClientGrantWithNullScope() throws Exception { + public void shouldThrowOnCreateClientGrantWithNullScope() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'scope' cannot be null!"); api.clientGrants().create("clientId", "audience", null); @@ -177,7 +177,7 @@ public void shouldCreateClientGrant() throws Exception { } @Test - public void shouldThrowOnDeleteClientGrantWithNullId() throws Exception { + public void shouldThrowOnDeleteClientGrantWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'client grant id' cannot be null!"); api.clientGrants().delete(null); @@ -198,14 +198,14 @@ public void shouldDeleteClientGrant() throws Exception { } @Test - public void shouldThrowOnUpdateClientGrantWithNullId() throws Exception { + public void shouldThrowOnUpdateClientGrantWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'client grant id' cannot be null!"); api.clientGrants().update(null, new String[]{}); } @Test - public void shouldThrowOnUpdateClientGrantWithNullScope() throws Exception { + public void shouldThrowOnUpdateClientGrantWithNullScope() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'scope' cannot be null!"); api.clientGrants().update("clientGrantId", null); diff --git a/src/test/java/com/auth0/client/mgmt/ClientsEntityTest.java b/src/test/java/com/auth0/client/mgmt/ClientsEntityTest.java index 1f5ef5b1..992e106d 100644 --- a/src/test/java/com/auth0/client/mgmt/ClientsEntityTest.java +++ b/src/test/java/com/auth0/client/mgmt/ClientsEntityTest.java @@ -153,7 +153,7 @@ public void shouldReturnEmptyClients() throws Exception { } @Test - public void shouldThrowOnGetClientWithNullId() throws Exception { + public void shouldThrowOnGetClientWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'client id' cannot be null!"); api.clients().get(null); @@ -176,7 +176,7 @@ public void shouldGetClient() throws Exception { } @Test - public void shouldThrowOnCreateClientWithNullData() throws Exception { + public void shouldThrowOnCreateClientWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'client' cannot be null!"); api.clients().create(null); @@ -203,7 +203,7 @@ public void shouldCreateClient() throws Exception { } @Test - public void shouldThrowOnDeleteClientWithNullId() throws Exception { + public void shouldThrowOnDeleteClientWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'client id' cannot be null!"); api.clients().delete(null); @@ -224,14 +224,14 @@ public void shouldDeleteClient() throws Exception { } @Test - public void shouldThrowOnUpdateClientWithNullId() throws Exception { + public void shouldThrowOnUpdateClientWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'client id' cannot be null!"); api.clients().update(null, new Client("name")); } @Test - public void shouldThrowOnUpdateClientWithNullData() throws Exception { + public void shouldThrowOnUpdateClientWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'client' cannot be null!"); api.clients().update("clientId", null); @@ -258,7 +258,7 @@ public void shouldUpdateClient() throws Exception { } @Test - public void shouldThrowOnRotateClientSecretWithNullId() throws Exception { + public void shouldThrowOnRotateClientSecretWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'client id' cannot be null!"); api.clients().rotateSecret(null); diff --git a/src/test/java/com/auth0/client/mgmt/ConnectionsEntityTest.java b/src/test/java/com/auth0/client/mgmt/ConnectionsEntityTest.java index a7cf9bf8..59dff1cb 100644 --- a/src/test/java/com/auth0/client/mgmt/ConnectionsEntityTest.java +++ b/src/test/java/com/auth0/client/mgmt/ConnectionsEntityTest.java @@ -195,7 +195,7 @@ public void shouldReturnEmptyConnections() throws Exception { } @Test - public void shouldThrowOnGetConnectionWithNullId() throws Exception { + public void shouldThrowOnGetConnectionWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'connection id' cannot be null!"); api.connections().get(null, null); @@ -237,7 +237,7 @@ public void shouldGetConnectionWithFields() throws Exception { } @Test - public void shouldThrowOnCreateConnectionWithNullData() throws Exception { + public void shouldThrowOnCreateConnectionWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'connection' cannot be null!"); api.connections().create(null); @@ -265,7 +265,7 @@ public void shouldCreateConnection() throws Exception { } @Test - public void shouldThrowOnDeleteConnectionWithNullId() throws Exception { + public void shouldThrowOnDeleteConnectionWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'connection id' cannot be null!"); api.connections().delete(null); @@ -286,14 +286,14 @@ public void shouldDeleteConnection() throws Exception { } @Test - public void shouldThrowOnUpdateConnectionWithNullId() throws Exception { + public void shouldThrowOnUpdateConnectionWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'connection id' cannot be null!"); api.connections().update(null, new Connection("my-connection", "auth0")); } @Test - public void shouldThrowOnUpdateConnectionWithNullData() throws Exception { + public void shouldThrowOnUpdateConnectionWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'connection' cannot be null!"); api.connections().update("1", null); @@ -321,14 +321,14 @@ public void shouldUpdateConnection() throws Exception { } @Test - public void shouldThrowOnDeleteConnectionUserWithNullId() throws Exception { + public void shouldThrowOnDeleteConnectionUserWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'connection id' cannot be null!"); api.connections().deleteUser(null, "user@domain.com"); } @Test - public void shouldThrowOnDeleteConnectionUserWithNullEmail() throws Exception { + public void shouldThrowOnDeleteConnectionUserWithNullEmail() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'email' cannot be null!"); api.connections().deleteUser("1", null); diff --git a/src/test/java/com/auth0/client/mgmt/DeviceCredentialsEntityTest.java b/src/test/java/com/auth0/client/mgmt/DeviceCredentialsEntityTest.java index 5e6149d1..ae602bdb 100644 --- a/src/test/java/com/auth0/client/mgmt/DeviceCredentialsEntityTest.java +++ b/src/test/java/com/auth0/client/mgmt/DeviceCredentialsEntityTest.java @@ -124,7 +124,7 @@ public void shouldReturnEmptyDeviceCredentials() throws Exception { } @Test - public void shouldThrowOnCreateDeviceCredentialsWithNullData() throws Exception { + public void shouldThrowOnCreateDeviceCredentialsWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'device credentials' cannot be null!"); api.deviceCredentials().create(null); @@ -155,7 +155,7 @@ public void shouldCreateDeviceCredentials() throws Exception { } @Test - public void shouldThrowOnDeleteDeviceCredentialsWithNullId() throws Exception { + public void shouldThrowOnDeleteDeviceCredentialsWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'device credentials id' cannot be null!"); api.deviceCredentials().delete(null); diff --git a/src/test/java/com/auth0/client/mgmt/EmailProviderEntityTest.java b/src/test/java/com/auth0/client/mgmt/EmailProviderEntityTest.java index d9e64244..c80628cb 100644 --- a/src/test/java/com/auth0/client/mgmt/EmailProviderEntityTest.java +++ b/src/test/java/com/auth0/client/mgmt/EmailProviderEntityTest.java @@ -51,7 +51,7 @@ public void shouldGetEmailProviderWithFields() throws Exception { } @Test - public void shouldThrowOnSetupEmailProviderWithNullData() throws Exception { + public void shouldThrowOnSetupEmailProviderWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'email provider' cannot be null!"); api.emailProvider().setup(null); @@ -92,7 +92,7 @@ public void shouldDeleteEmailProvider() throws Exception { } @Test - public void shouldThrowOnUpdateEmailProviderWithNullData() throws Exception { + public void shouldThrowOnUpdateEmailProviderWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'email provider' cannot be null!"); api.emailProvider().update(null); diff --git a/src/test/java/com/auth0/client/mgmt/GrantsEntityTest.java b/src/test/java/com/auth0/client/mgmt/GrantsEntityTest.java index b44283c8..e3563601 100644 --- a/src/test/java/com/auth0/client/mgmt/GrantsEntityTest.java +++ b/src/test/java/com/auth0/client/mgmt/GrantsEntityTest.java @@ -35,7 +35,7 @@ public void shouldListGrantsWithoutFilter() throws Exception { } @Test - public void shouldThrowOnListGrantsWithoutFilterWithNullUserId() throws Exception { + public void shouldThrowOnListGrantsWithoutFilterWithNullUserId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user id' cannot be null!"); api.grants().list(null, null); @@ -139,7 +139,7 @@ public void shouldListGrants() throws Exception { @SuppressWarnings("deprecation") @Test - public void shouldThrowOnListGrantsWithNullUserId() throws Exception { + public void shouldThrowOnListGrantsWithNullUserId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user id' cannot be null!"); api.grants().list(null); @@ -159,7 +159,7 @@ public void shouldReturnEmptyGrants() throws Exception { } @Test - public void shouldThrowOnDeleteGrantWithNullId() throws Exception { + public void shouldThrowOnDeleteGrantWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'grant id' cannot be null!"); api.grants().delete(null); @@ -180,7 +180,7 @@ public void shouldDeleteGrantById() throws Exception { } @Test - public void shouldThrowOnDeleteAllGrantsWithNullUserId() throws Exception { + public void shouldThrowOnDeleteAllGrantsWithNullUserId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user id' cannot be null!"); api.grants().deleteAll(null); diff --git a/src/test/java/com/auth0/client/mgmt/GuardianEntityTest.java b/src/test/java/com/auth0/client/mgmt/GuardianEntityTest.java index f240fa5b..18a51c6c 100644 --- a/src/test/java/com/auth0/client/mgmt/GuardianEntityTest.java +++ b/src/test/java/com/auth0/client/mgmt/GuardianEntityTest.java @@ -17,7 +17,7 @@ public class GuardianEntityTest extends BaseMgmtEntityTest { @Test - public void shouldThrowOnDeleteGuardianEnrollmentWithNullId() throws Exception { + public void shouldThrowOnDeleteGuardianEnrollmentWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'enrollment id' cannot be null!"); api.guardian().deleteEnrollment(null); @@ -38,7 +38,7 @@ public void shouldDeleteGuardianEnrollment() throws Exception { } @Test - public void shouldThrowOnCreateGuardianEnrollmentTicketWithNullData() throws Exception { + public void shouldThrowOnCreateGuardianEnrollmentTicketWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'enrollment ticket' cannot be null!"); api.guardian().createEnrollmentTicket(null); @@ -81,7 +81,7 @@ public void shouldGetGuardianTemplates() throws Exception { } @Test - public void shouldThrowOnUpdateGuardianTemplatesWithNullData() throws Exception { + public void shouldThrowOnUpdateGuardianTemplatesWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'guardian templates' cannot be null!"); api.guardian().updateTemplates(null); @@ -133,14 +133,14 @@ public void shouldReturnEmptyGuardianFactors() throws Exception { } @Test - public void shouldThrowOnUpdateGuardianFactorWithNullName() throws Exception { + public void shouldThrowOnUpdateGuardianFactorWithNullName() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'name' cannot be null!"); api.guardian().updateFactor(null, true); } @Test - public void shouldThrowOnUpdateGuardianFactorWithNullEnabled() throws Exception { + public void shouldThrowOnUpdateGuardianFactorWithNullEnabled() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'enabled' cannot be null!"); api.guardian().updateFactor("my-factor", null); @@ -199,7 +199,7 @@ public void shouldGetGuardianTwilioFactorProviderWithFrom() throws Exception { } @Test - public void shouldThrowOnUpdateGuardianTwilioFactorProviderWithNullData() throws Exception { + public void shouldThrowOnUpdateGuardianTwilioFactorProviderWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'provider' cannot be null!"); api.guardian().updateTwilioFactorProvider(null); @@ -299,7 +299,7 @@ public void shouldGetGuardianSnsFactorProvider() throws Exception { } @Test - public void shouldThrowOnUpdateGuardianSnsFactorProviderWithNullData() throws Exception { + public void shouldThrowOnUpdateGuardianSnsFactorProviderWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'provider' cannot be null!"); api.guardian().updateSNSFactorProvider(null); diff --git a/src/test/java/com/auth0/client/mgmt/LogEventsEntityTest.java b/src/test/java/com/auth0/client/mgmt/LogEventsEntityTest.java index 564cb7cb..dade5b05 100644 --- a/src/test/java/com/auth0/client/mgmt/LogEventsEntityTest.java +++ b/src/test/java/com/auth0/client/mgmt/LogEventsEntityTest.java @@ -165,7 +165,7 @@ public void shouldReturnEmptyLogEvents() throws Exception { } @Test - public void shouldThrowOnGetLogEventWithNullId() throws Exception { + public void shouldThrowOnGetLogEventWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'log event id' cannot be null!"); api.logEvents().get(null); diff --git a/src/test/java/com/auth0/client/mgmt/ManagementAPITest.java b/src/test/java/com/auth0/client/mgmt/ManagementAPITest.java index f74df9e4..7f6e9d52 100644 --- a/src/test/java/com/auth0/client/mgmt/ManagementAPITest.java +++ b/src/test/java/com/auth0/client/mgmt/ManagementAPITest.java @@ -47,7 +47,7 @@ public void tearDown() throws Exception { // Configuration @Test - public void shouldAcceptDomainWithNoScheme() throws Exception { + public void shouldAcceptDomainWithNoScheme() { ManagementAPI api = new ManagementAPI("me.something.com", API_TOKEN); assertThat(api.getBaseUrl(), is(notNullValue())); @@ -55,7 +55,7 @@ public void shouldAcceptDomainWithNoScheme() throws Exception { } @Test - public void shouldAcceptDomainWithHttpScheme() throws Exception { + public void shouldAcceptDomainWithHttpScheme() { ManagementAPI api = new ManagementAPI("http://me.something.com", API_TOKEN); assertThat(api.getBaseUrl(), is(notNullValue())); @@ -63,28 +63,28 @@ public void shouldAcceptDomainWithHttpScheme() throws Exception { } @Test - public void shouldThrowWhenDomainIsInvalid() throws Exception { + public void shouldThrowWhenDomainIsInvalid() { exception.expect(IllegalArgumentException.class); exception.expectMessage("The domain had an invalid format and couldn't be parsed as an URL."); new ManagementAPI("", API_TOKEN); } @Test - public void shouldThrowWhenDomainIsNull() throws Exception { + public void shouldThrowWhenDomainIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'domain' cannot be null!"); new ManagementAPI(null, API_TOKEN); } @Test - public void shouldThrowWhenApiTokenIsNull() throws Exception { + public void shouldThrowWhenApiTokenIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'api token' cannot be null!"); new ManagementAPI(DOMAIN, null); } @Test - public void shouldThrowOnUpdateWhenApiTokenIsNull() throws Exception { + public void shouldThrowOnUpdateWhenApiTokenIsNull() { ManagementAPI api = new ManagementAPI(DOMAIN, API_TOKEN); exception.expect(IllegalArgumentException.class); @@ -93,7 +93,7 @@ public void shouldThrowOnUpdateWhenApiTokenIsNull() throws Exception { } @Test - public void shouldUpdateApiToken() throws Exception { + public void shouldUpdateApiToken() { //Initialize with a token ManagementAPI api = new ManagementAPI(DOMAIN, "first token"); @@ -257,7 +257,7 @@ public void proxyShouldNotProcessAlreadyAuthenticatedRequest() throws Exception } @Test - public void shouldAddAndEnableTelemetryInterceptor() throws Exception { + public void shouldAddAndEnableTelemetryInterceptor() { ManagementAPI api = new ManagementAPI(DOMAIN, API_TOKEN); assertThat(api.getClient().interceptors(), hasItem(isA(TelemetryInterceptor.class))); @@ -270,7 +270,7 @@ public void shouldAddAndEnableTelemetryInterceptor() throws Exception { } @Test - public void shouldUseCustomTelemetry() throws Exception { + public void shouldUseCustomTelemetry() { ManagementAPI api = new ManagementAPI(DOMAIN, API_TOKEN); assertThat(api.getClient().interceptors(), hasItem(isA(TelemetryInterceptor.class))); @@ -297,7 +297,7 @@ public void shouldUseCustomTelemetry() throws Exception { } @Test - public void shouldDisableTelemetryInterceptor() throws Exception { + public void shouldDisableTelemetryInterceptor() { ManagementAPI api = new ManagementAPI(DOMAIN, API_TOKEN); assertThat(api.getClient().interceptors(), hasItem(isA(TelemetryInterceptor.class))); api.doNotSendTelemetry(); @@ -311,7 +311,7 @@ public void shouldDisableTelemetryInterceptor() throws Exception { } @Test - public void shouldAddAndDisableLoggingInterceptor() throws Exception { + public void shouldAddAndDisableLoggingInterceptor() { ManagementAPI api = new ManagementAPI(DOMAIN, API_TOKEN); assertThat(api.getClient().interceptors(), hasItem(isA(HttpLoggingInterceptor.class))); @@ -324,7 +324,7 @@ public void shouldAddAndDisableLoggingInterceptor() throws Exception { } @Test - public void shouldEnableLoggingInterceptor() throws Exception { + public void shouldEnableLoggingInterceptor() { ManagementAPI api = new ManagementAPI(DOMAIN, API_TOKEN); assertThat(api.getClient().interceptors(), hasItem(isA(HttpLoggingInterceptor.class))); api.setLoggingEnabled(true); @@ -338,7 +338,7 @@ public void shouldEnableLoggingInterceptor() throws Exception { } @Test - public void shouldDisableLoggingInterceptor() throws Exception { + public void shouldDisableLoggingInterceptor() { ManagementAPI api = new ManagementAPI(DOMAIN, API_TOKEN); assertThat(api.getClient().interceptors(), hasItem(isA(HttpLoggingInterceptor.class))); api.setLoggingEnabled(false); @@ -354,93 +354,93 @@ public void shouldDisableLoggingInterceptor() throws Exception { //Entities @Test - public void shouldGetBlacklists() throws Exception { + public void shouldGetBlacklists() { assertThat(api.blacklists(), notNullValue()); } @Test - public void shouldGetClientGrants() throws Exception { + public void shouldGetClientGrants() { assertThat(api.clientGrants(), notNullValue()); } @Test - public void shouldGetClients() throws Exception { + public void shouldGetClients() { assertThat(api.clients(), notNullValue()); } @Test - public void shouldGetConnections() throws Exception { + public void shouldGetConnections() { assertThat(api.connections(), notNullValue()); } @Test - public void shouldGetDeviceCredentials() throws Exception { + public void shouldGetDeviceCredentials() { assertThat(api.deviceCredentials(), notNullValue()); } @Test - public void shouldGetEmailProvider() throws Exception { + public void shouldGetEmailProvider() { assertThat(api.emailProvider(), notNullValue()); } @Test - public void shouldGetEmailTemplates() throws Exception { + public void shouldGetEmailTemplates() { assertThat(api.emailTemplates(), notNullValue()); } @Test - public void shouldGetGrants() throws Exception { + public void shouldGetGrants() { assertThat(api.grants(), notNullValue()); } @Test - public void shouldGetGuardian() throws Exception { + public void shouldGetGuardian() { assertThat(api.guardian(), notNullValue()); } @Test - public void shouldGetJobs() throws Exception { + public void shouldGetJobs() { assertThat(api.jobs(), notNullValue()); } @Test - public void shouldGetLogEvents() throws Exception { + public void shouldGetLogEvents() { assertThat(api.logEvents(), notNullValue()); } @Test - public void shouldGetResourceServers() throws Exception { + public void shouldGetResourceServers() { assertThat(api.resourceServers(), notNullValue()); } @Test - public void shouldGetRules() throws Exception { + public void shouldGetRules() { assertThat(api.rules(), notNullValue()); } @Test - public void shouldGetStats() throws Exception { + public void shouldGetStats() { assertThat(api.stats(), notNullValue()); } @Test - public void shouldGetTenants() throws Exception { + public void shouldGetTenants() { assertThat(api.tenants(), notNullValue()); } @Test - public void shouldGetTickets() throws Exception { + public void shouldGetTickets() { assertThat(api.tickets(), notNullValue()); } @Test - public void shouldGetUserBlocks() throws Exception { + public void shouldGetUserBlocks() { assertThat(api.userBlocks(), notNullValue()); } @Test - public void shouldGetUsers() throws Exception { + public void shouldGetUsers() { assertThat(api.users(), notNullValue()); } -} \ No newline at end of file +} diff --git a/src/test/java/com/auth0/client/mgmt/RolesEntityTest.java b/src/test/java/com/auth0/client/mgmt/RolesEntityTest.java index 52e778e6..cdda29ac 100644 --- a/src/test/java/com/auth0/client/mgmt/RolesEntityTest.java +++ b/src/test/java/com/auth0/client/mgmt/RolesEntityTest.java @@ -111,14 +111,14 @@ public void shouldGetRole() throws Exception { } @Test - public void shouldThrowOnGetRoleWithNullRoleId() throws Exception { + public void shouldThrowOnGetRoleWithNullRoleId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'role id' cannot be null!"); api.roles().get(null); } @Test - public void shouldThrowOnCreateRoleWithNullData() throws Exception { + public void shouldThrowOnCreateRoleWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user' cannot be null!"); api.users().create(null); @@ -147,14 +147,14 @@ public void shouldCreateRole() throws Exception { } @Test - public void shouldThrowOnUpdateRoleWithNullId() throws Exception { + public void shouldThrowOnUpdateRoleWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'role id' cannot be null!"); api.roles().update(null, new Role()); } @Test - public void shouldThrowOnUpdateRoleWithNullData() throws Exception { + public void shouldThrowOnUpdateRoleWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'role' cannot be null!"); api.roles().update("1", null); @@ -183,7 +183,7 @@ public void shouldUpdateRole() throws Exception { } @Test - public void shouldThrowOnDeleteRoleWithNullId() throws Exception { + public void shouldThrowOnDeleteRoleWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'role id' cannot be null!"); api.roles().delete(null); @@ -204,7 +204,7 @@ public void shouldDeleteRole() throws Exception { } @Test - public void shouldThrowOnListUsersWithNullId() throws Exception { + public void shouldThrowOnListUsersWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'role id' cannot be null!"); api.roles().listUsers(null, null); @@ -271,21 +271,21 @@ public void shouldListUsersWithTotals() throws Exception { } @Test - public void shouldThrowOnAssignUsersWithNullId() throws Exception { + public void shouldThrowOnAssignUsersWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'role id' cannot be null!"); api.roles().assignUsers(null, Collections.emptyList()); } @Test - public void shouldThrowOnAssignUsersWithNullList() throws Exception { + public void shouldThrowOnAssignUsersWithNullList() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user ids' cannot be null!"); api.roles().assignUsers("1", null); } @Test - public void shouldThrowOnAssignUsersWithEmptyList() throws Exception { + public void shouldThrowOnAssignUsersWithEmptyList() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user ids' cannot be empty!"); api.roles().assignUsers("1", Collections.emptyList()); @@ -374,21 +374,21 @@ public void shouldListPermissionsWithTotal() throws Exception { } @Test - public void shouldThrowOnAddPermissionsWithNullId() throws Exception { + public void shouldThrowOnAddPermissionsWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'role id' cannot be null!"); api.roles().addPermissions(null, Collections.emptyList()); } @Test - public void shouldThrowOnAddPermissionsWithNullList() throws Exception { + public void shouldThrowOnAddPermissionsWithNullList() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'permissions' cannot be null!"); api.roles().addPermissions("1", null); } @Test - public void shouldThrowOnAddPermissionsWithEmptyList() throws Exception { + public void shouldThrowOnAddPermissionsWithEmptyList() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'permissions' cannot be empty!"); api.roles().addPermissions("1", Collections.emptyList()); @@ -419,21 +419,21 @@ public void shouldAddPermissions() throws Exception { } @Test - public void shouldThrowOnRemovePermissionsWithNullId() throws Exception { + public void shouldThrowOnRemovePermissionsWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'role id' cannot be null!"); api.roles().removePermissions(null, Collections.emptyList()); } @Test - public void shouldThrowOnRemovePermissionsWithNullList() throws Exception { + public void shouldThrowOnRemovePermissionsWithNullList() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'permissions' cannot be null!"); api.roles().removePermissions("1", null); } @Test - public void shouldThrowOnRemovePermissionsWithEmptyList() throws Exception { + public void shouldThrowOnRemovePermissionsWithEmptyList() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'permissions' cannot be empty!"); api.roles().removePermissions("1", Collections.emptyList()); diff --git a/src/test/java/com/auth0/client/mgmt/RulesConfigsEntityTest.java b/src/test/java/com/auth0/client/mgmt/RulesConfigsEntityTest.java index 47219022..48c30109 100644 --- a/src/test/java/com/auth0/client/mgmt/RulesConfigsEntityTest.java +++ b/src/test/java/com/auth0/client/mgmt/RulesConfigsEntityTest.java @@ -46,7 +46,7 @@ public void shouldReturnEmptyRulesConfigs() throws Exception { } @Test - public void shouldThrowOnDeleteRulesConfigWithNullKey() throws Exception { + public void shouldThrowOnDeleteRulesConfigWithNullKey() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'rules config key' cannot be null!"); api.rulesConfigs().delete(null); @@ -67,14 +67,14 @@ public void shouldDeleteRulesConfig() throws Exception { } @Test - public void shouldThrowOnUpdateRulesConfigWithNullKey() throws Exception { + public void shouldThrowOnUpdateRulesConfigWithNullKey() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'rules config key' cannot be null!"); api.rulesConfigs().update(null, new RulesConfig("my-value")); } @Test - public void shouldThrowOnUpdateRulesConfigWithNullData() throws Exception { + public void shouldThrowOnUpdateRulesConfigWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'rules config' cannot be null!"); api.rulesConfigs().update("1", null); diff --git a/src/test/java/com/auth0/client/mgmt/RulesEntityTest.java b/src/test/java/com/auth0/client/mgmt/RulesEntityTest.java index 2dbf8661..b554f89b 100644 --- a/src/test/java/com/auth0/client/mgmt/RulesEntityTest.java +++ b/src/test/java/com/auth0/client/mgmt/RulesEntityTest.java @@ -173,7 +173,7 @@ public void shouldReturnEmptyRules() throws Exception { } @Test - public void shouldThrowOnGetRuleWithNullId() throws Exception { + public void shouldThrowOnGetRuleWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'rule id' cannot be null!"); api.rules().get(null, null); @@ -215,7 +215,7 @@ public void shouldGetRuleWithFields() throws Exception { } @Test - public void shouldThrowOnCreateRuleWithNullData() throws Exception { + public void shouldThrowOnCreateRuleWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'rule' cannot be null!"); api.rules().create(null); @@ -243,7 +243,7 @@ public void shouldCreateRule() throws Exception { } @Test - public void shouldThrowOnDeleteRuleWithNullId() throws Exception { + public void shouldThrowOnDeleteRuleWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'rule id' cannot be null!"); api.rules().delete(null); @@ -264,14 +264,14 @@ public void shouldDeleteRule() throws Exception { } @Test - public void shouldThrowOnUpdateRuleWithNullId() throws Exception { + public void shouldThrowOnUpdateRuleWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'rule id' cannot be null!"); api.rules().update(null, new Rule("my-rule", "function(){}")); } @Test - public void shouldThrowOnUpdateRuleWithNullData() throws Exception { + public void shouldThrowOnUpdateRuleWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'rule' cannot be null!"); api.rules().update("1", null); diff --git a/src/test/java/com/auth0/client/mgmt/StatsEntityTest.java b/src/test/java/com/auth0/client/mgmt/StatsEntityTest.java index 7c97a02b..c22e9ae1 100644 --- a/src/test/java/com/auth0/client/mgmt/StatsEntityTest.java +++ b/src/test/java/com/auth0/client/mgmt/StatsEntityTest.java @@ -33,14 +33,14 @@ public void shouldGetActiveUsersCount() throws Exception { } @Test - public void shouldThrowOnGetDailyStatsWithNullDateFrom() throws Exception { + public void shouldThrowOnGetDailyStatsWithNullDateFrom() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'date from' cannot be null!"); api.stats().getDailyStats(null, new Date()); } @Test - public void shouldThrowOnGetDailyStatsWithNullDateTo() throws Exception { + public void shouldThrowOnGetDailyStatsWithNullDateTo() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'date to' cannot be null!"); api.stats().getDailyStats(new Date(), null); @@ -85,7 +85,7 @@ public void shouldReturnEmptyDailyStats() throws Exception { } @Test - public void shouldFormatDateToYYYYMMDD() throws Exception { + public void shouldFormatDateToYYYYMMDD() { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.YEAR, 2010); //Calendar.MONTH starts at 0 being January diff --git a/src/test/java/com/auth0/client/mgmt/TenantsEntityTest.java b/src/test/java/com/auth0/client/mgmt/TenantsEntityTest.java index c3b5889d..e284580e 100644 --- a/src/test/java/com/auth0/client/mgmt/TenantsEntityTest.java +++ b/src/test/java/com/auth0/client/mgmt/TenantsEntityTest.java @@ -50,7 +50,7 @@ public void shouldGetTenantSettingsWithFields() throws Exception { } @Test - public void shouldThrowOnUpdateTenantSettingsWithNullData() throws Exception { + public void shouldThrowOnUpdateTenantSettingsWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'tenant' cannot be null!"); api.tenants().update(null); diff --git a/src/test/java/com/auth0/client/mgmt/TicketsEntityTest.java b/src/test/java/com/auth0/client/mgmt/TicketsEntityTest.java index 9466fcd9..3e9da7a7 100644 --- a/src/test/java/com/auth0/client/mgmt/TicketsEntityTest.java +++ b/src/test/java/com/auth0/client/mgmt/TicketsEntityTest.java @@ -17,7 +17,7 @@ public class TicketsEntityTest extends BaseMgmtEntityTest { @Test - public void shouldThrowOnCreateEmailVerificationTicketWithNullData() throws Exception { + public void shouldThrowOnCreateEmailVerificationTicketWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'email verification ticket' cannot be null!"); api.tickets().requestEmailVerification(null); @@ -50,7 +50,7 @@ public void shouldCreateEmailVerificationTicket() throws Exception { } @Test - public void shouldThrowOnCreatePasswordChangeTicketWithNullData() throws Exception { + public void shouldThrowOnCreatePasswordChangeTicketWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'password change ticket' cannot be null!"); api.tickets().requestPasswordChange(null); diff --git a/src/test/java/com/auth0/client/mgmt/UserBlocksEntityTest.java b/src/test/java/com/auth0/client/mgmt/UserBlocksEntityTest.java index 10e84f6b..d1c92044 100644 --- a/src/test/java/com/auth0/client/mgmt/UserBlocksEntityTest.java +++ b/src/test/java/com/auth0/client/mgmt/UserBlocksEntityTest.java @@ -14,7 +14,7 @@ public class UserBlocksEntityTest extends BaseMgmtEntityTest { @Test - public void shouldThrowOnGetUserBlocksByIdentifierWithNullId() throws Exception { + public void shouldThrowOnGetUserBlocksByIdentifierWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'identifier' cannot be null!"); api.userBlocks().getByIdentifier(null); @@ -38,7 +38,7 @@ public void shouldGetUserBlocksByIdentifier() throws Exception { } @Test - public void shouldThrowOnGetUserBlocksWithNullId() throws Exception { + public void shouldThrowOnGetUserBlocksWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user id' cannot be null!"); api.userBlocks().get(null); @@ -61,7 +61,7 @@ public void shouldGetUserBlocks() throws Exception { } @Test - public void shouldThrowOnDeleteUserBlocksByIdentifierWithNullId() throws Exception { + public void shouldThrowOnDeleteUserBlocksByIdentifierWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'identifier' cannot be null!"); api.userBlocks().deleteByIdentifier(null); @@ -83,7 +83,7 @@ public void shouldDeleteUserBlocksByIdentifier() throws Exception { } @Test - public void shouldThrowOnDeleteUserBlocksWithNullId() throws Exception { + public void shouldThrowOnDeleteUserBlocksWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user id' cannot be null!"); api.userBlocks().delete(null); diff --git a/src/test/java/com/auth0/client/mgmt/UsersEntityTest.java b/src/test/java/com/auth0/client/mgmt/UsersEntityTest.java index 385d1908..b4f2d7cc 100644 --- a/src/test/java/com/auth0/client/mgmt/UsersEntityTest.java +++ b/src/test/java/com/auth0/client/mgmt/UsersEntityTest.java @@ -233,7 +233,7 @@ public void shouldReturnEmptyUsers() throws Exception { } @Test - public void shouldThrowOnGetUserWithNullId() throws Exception { + public void shouldThrowOnGetUserWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user id' cannot be null!"); api.users().get(null, null); @@ -275,7 +275,7 @@ public void shouldGetUserWithFields() throws Exception { } @Test - public void shouldThrowOnCreateUserWithNullData() throws Exception { + public void shouldThrowOnCreateUserWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user' cannot be null!"); api.users().create(null); @@ -302,7 +302,7 @@ public void shouldCreateUser() throws Exception { } @Test - public void shouldThrowOnDeleteUserWithNullId() throws Exception { + public void shouldThrowOnDeleteUserWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user id' cannot be null!"); api.users().delete(null); @@ -323,14 +323,14 @@ public void shouldDeleteUser() throws Exception { } @Test - public void shouldThrowOnUpdateUserWithNullId() throws Exception { + public void shouldThrowOnUpdateUserWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user id' cannot be null!"); api.users().update(null, new User("auth0")); } @Test - public void shouldThrowOnUpdateUserWithNullData() throws Exception { + public void shouldThrowOnUpdateUserWithNullData() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user' cannot be null!"); api.users().update("1", null); @@ -358,7 +358,7 @@ public void shouldUpdateUser() throws Exception { @Test - public void shouldThrowOnGetUserGuardianEnrollmentsWithNullId() throws Exception { + public void shouldThrowOnGetUserGuardianEnrollmentsWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user id' cannot be null!"); api.users().getEnrollments(null); @@ -393,7 +393,7 @@ public void shouldReturnEmptyUserGuardianEnrollments() throws Exception { } @Test - public void shouldThrowOnGetUserLogEventsWithNullId() throws Exception { + public void shouldThrowOnGetUserLogEventsWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user id' cannot be null!"); api.users().getLogEvents(null, null); @@ -510,14 +510,14 @@ public void shouldReturnEmptyUserLogEvents() throws Exception { } @Test - public void shouldThrowOnDeleteUserMultifactorProviderWithNullId() throws Exception { + public void shouldThrowOnDeleteUserMultifactorProviderWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user id' cannot be null!"); api.users().deleteMultifactorProvider(null, "duo"); } @Test - public void shouldThrowOnDeleteUserMultifactorProviderWithNullProvider() throws Exception { + public void shouldThrowOnDeleteUserMultifactorProviderWithNullProvider() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'provider' cannot be null!"); api.users().deleteMultifactorProvider("1", null); @@ -538,7 +538,7 @@ public void shouldDeleteUserMultifactorProvider() throws Exception { } @Test - public void shouldThrowOnRotateUserRecoveryCodeWithNullId() throws Exception { + public void shouldThrowOnRotateUserRecoveryCodeWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user id' cannot be null!"); api.users().rotateRecoveryCode(null); @@ -561,35 +561,35 @@ public void shouldRotateUserRecoveryCode() throws Exception { } @Test - public void shouldThrowOnLinkUserIdentityWithNullPrimaryId() throws Exception { + public void shouldThrowOnLinkUserIdentityWithNullPrimaryId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'primary user id' cannot be null!"); api.users().linkIdentity(null, "2", "auth0", null); } @Test - public void shouldThrowOnLinkUserIdentityWithNullSecondaryId() throws Exception { + public void shouldThrowOnLinkUserIdentityWithNullSecondaryId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'secondary user id' cannot be null!"); api.users().linkIdentity("1", null, "auth0", null); } @Test - public void shouldThrowOnLinkUserIdentityWithNullSecondaryToken() throws Exception { + public void shouldThrowOnLinkUserIdentityWithNullSecondaryToken() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'secondary id token' cannot be null!"); api.users().linkIdentity("1", null); } @Test - public void shouldThrowOnLinkUserIdentityWithNullUserId() throws Exception { + public void shouldThrowOnLinkUserIdentityWithNullUserId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'primary user id' cannot be null!"); api.users().linkIdentity(null, "2"); } @Test - public void shouldThrowOnLinkUserIdentityWithNullProvider() throws Exception { + public void shouldThrowOnLinkUserIdentityWithNullProvider() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'provider' cannot be null!"); api.users().linkIdentity("1", "2", null, null); @@ -659,21 +659,21 @@ public void shouldLinkUserIdentityWithConnectionId() throws Exception { } @Test - public void shouldThrowOnUnlinkUserIdentityWithNullPrimaryId() throws Exception { + public void shouldThrowOnUnlinkUserIdentityWithNullPrimaryId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'primary user id' cannot be null!"); api.users().unlinkIdentity(null, "2", "auth0"); } @Test - public void shouldThrowOnUnlinkUserIdentityWithNullSecondaryId() throws Exception { + public void shouldThrowOnUnlinkUserIdentityWithNullSecondaryId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'secondary user id' cannot be null!"); api.users().unlinkIdentity("1", null, "auth0"); } @Test - public void shouldThrowOnUnlinkUserIdentityWithNullProvider() throws Exception { + public void shouldThrowOnUnlinkUserIdentityWithNullProvider() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'provider' cannot be null!"); api.users().unlinkIdentity("1", "2", null); @@ -696,7 +696,7 @@ public void shouldUnlinkUserIdentity() throws Exception { } @Test - public void shouldThrowOnListRolesWithNullId() throws Exception { + public void shouldThrowOnListRolesWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user id' cannot be null!"); api.users().listRoles(null, null); @@ -763,21 +763,21 @@ public void shouldListRolesWithTotals() throws Exception { } @Test - public void shouldThrowOnAddRolesWithNullId() throws Exception { + public void shouldThrowOnAddRolesWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user id' cannot be null!"); api.users().addRoles(null, Collections.emptyList()); } @Test - public void shouldThrowOnAddRolesWithNullList() throws Exception { + public void shouldThrowOnAddRolesWithNullList() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'role ids' cannot be null!"); api.users().addRoles("1", null); } @Test - public void shouldThrowOnAddRolesWithEmptyList() throws Exception { + public void shouldThrowOnAddRolesWithEmptyList() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'role ids' cannot be empty!"); api.users().addRoles("1", Collections.emptyList()); @@ -804,21 +804,21 @@ public void shouldAddRoles() throws Exception { } @Test - public void shouldThrowOnRemoveRolesWithNullId() throws Exception { + public void shouldThrowOnRemoveRolesWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user id' cannot be null!"); api.users().removeRoles(null, Collections.emptyList()); } @Test - public void shouldThrowOnRemoveRolesWithNullList() throws Exception { + public void shouldThrowOnRemoveRolesWithNullList() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'role ids' cannot be null!"); api.users().removeRoles("1", null); } @Test - public void shouldThrowOnRemoveRolesWithEmptyList() throws Exception { + public void shouldThrowOnRemoveRolesWithEmptyList() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'role ids' cannot be empty!"); api.users().removeRoles("1", Collections.emptyList()); @@ -905,21 +905,21 @@ public void shouldListPermissionsWithTotal() throws Exception { } @Test - public void shouldThrowOnAddPermissionsWithNullId() throws Exception { + public void shouldThrowOnAddPermissionsWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user id' cannot be null!"); api.users().addPermissions(null, Collections.emptyList()); } @Test - public void shouldThrowOnAddPermissionsWithNullList() throws Exception { + public void shouldThrowOnAddPermissionsWithNullList() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'permissions' cannot be null!"); api.users().addPermissions("1", null); } @Test - public void shouldThrowOnAddPermissionsWithEmptyList() throws Exception { + public void shouldThrowOnAddPermissionsWithEmptyList() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'permissions' cannot be empty!"); api.users().addPermissions("1", Collections.emptyList()); @@ -950,21 +950,21 @@ public void shouldAddPermissions() throws Exception { } @Test - public void shouldThrowOnRemovePermissionsWithNullId() throws Exception { + public void shouldThrowOnRemovePermissionsWithNullId() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'user id' cannot be null!"); api.users().removePermissions(null, Collections.emptyList()); } @Test - public void shouldThrowOnRemovePermissionsWithNullList() throws Exception { + public void shouldThrowOnRemovePermissionsWithNullList() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'permissions' cannot be null!"); api.users().removePermissions("roleId", null); } @Test - public void shouldThrowOnRemovePermissionsWithEmptyList() throws Exception { + public void shouldThrowOnRemovePermissionsWithEmptyList() { exception.expect(IllegalArgumentException.class); exception.expectMessage("'permissions' cannot be empty!"); api.users().removePermissions("roleId", Collections.emptyList()); diff --git a/src/test/java/com/auth0/client/mgmt/filter/ClientGrantsFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/ClientGrantsFilterTest.java index 97250ad4..4dd07148 100644 --- a/src/test/java/com/auth0/client/mgmt/filter/ClientGrantsFilterTest.java +++ b/src/test/java/com/auth0/client/mgmt/filter/ClientGrantsFilterTest.java @@ -13,12 +13,12 @@ public class ClientGrantsFilterTest { private ClientGrantsFilter filter; @Before - public void setUp() throws Exception { + public void setUp() { filter = new ClientGrantsFilter(); } @Test - public void shouldFilterByAudience() throws Exception { + public void shouldFilterByAudience() { ClientGrantsFilter instance = filter.withAudience("https://myapi.auth0.com"); assertThat(filter, is(instance)); @@ -27,7 +27,7 @@ public void shouldFilterByAudience() throws Exception { } @Test - public void shouldFilterByClientId() throws Exception { + public void shouldFilterByClientId() { ClientGrantsFilter instance = filter.withClientId("n3roinr32i23iron23nr"); assertThat(filter, is(instance)); @@ -36,7 +36,7 @@ public void shouldFilterByClientId() throws Exception { } @Test - public void shouldFilterByPage() throws Exception { + public void shouldFilterByPage() { ClientGrantsFilter instance = filter.withPage(5, 10); assertThat(filter, is(instance)); @@ -46,7 +46,7 @@ public void shouldFilterByPage() throws Exception { } @Test - public void shouldIncludeTotals() throws Exception { + public void shouldIncludeTotals() { ClientGrantsFilter instance = filter.withTotals(true); assertThat(filter, is(instance)); diff --git a/src/test/java/com/auth0/client/mgmt/filter/ConnectionFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/ConnectionFilterTest.java index 3c5f50d1..37ab2694 100644 --- a/src/test/java/com/auth0/client/mgmt/filter/ConnectionFilterTest.java +++ b/src/test/java/com/auth0/client/mgmt/filter/ConnectionFilterTest.java @@ -13,12 +13,12 @@ public class ConnectionFilterTest { private ConnectionFilter filter; @Before - public void setUp() throws Exception { + public void setUp() { filter = new ConnectionFilter(); } @Test - public void shouldFilterByStrategy() throws Exception { + public void shouldFilterByStrategy() { ConnectionFilter instance = filter.withStrategy("auth0"); assertThat(filter, is(instance)); @@ -27,7 +27,7 @@ public void shouldFilterByStrategy() throws Exception { } @Test - public void shouldFilterByName() throws Exception { + public void shouldFilterByName() { ConnectionFilter instance = filter.withName("my-connection"); assertThat(filter, is(instance)); @@ -36,7 +36,7 @@ public void shouldFilterByName() throws Exception { } @Test - public void shouldFilterByPage() throws Exception { + public void shouldFilterByPage() { ConnectionFilter instance = filter.withPage(5, 10); assertThat(filter, is(instance)); @@ -46,7 +46,7 @@ public void shouldFilterByPage() throws Exception { } @Test - public void shouldFilterWithFields() throws Exception { + public void shouldFilterWithFields() { ConnectionFilter instance = filter.withFields("a,b,c", true); assertThat(filter, is(instance)); @@ -56,7 +56,7 @@ public void shouldFilterWithFields() throws Exception { } @Test - public void shouldIncludeTotals() throws Exception { + public void shouldIncludeTotals() { ConnectionFilter instance = filter.withTotals(true); assertThat(filter, is(instance)); @@ -65,7 +65,7 @@ public void shouldIncludeTotals() throws Exception { } @Test - public void shouldFilterWithoutFields() throws Exception { + public void shouldFilterWithoutFields() { ConnectionFilter instance = filter.withFields("a,b,c", false); assertThat(filter, is(instance)); diff --git a/src/test/java/com/auth0/client/mgmt/filter/DeviceCredentialsFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/DeviceCredentialsFilterTest.java index 03dfe4f2..b034fed5 100644 --- a/src/test/java/com/auth0/client/mgmt/filter/DeviceCredentialsFilterTest.java +++ b/src/test/java/com/auth0/client/mgmt/filter/DeviceCredentialsFilterTest.java @@ -13,12 +13,12 @@ public class DeviceCredentialsFilterTest { private DeviceCredentialsFilter filter; @Before - public void setUp() throws Exception { + public void setUp() { filter = new DeviceCredentialsFilter(); } @Test - public void shouldFilterByClientId() throws Exception { + public void shouldFilterByClientId() { DeviceCredentialsFilter instance = filter.withClientId("1234567890"); assertThat(filter, is(instance)); @@ -27,7 +27,7 @@ public void shouldFilterByClientId() throws Exception { } @Test - public void shouldFilterByType() throws Exception { + public void shouldFilterByType() { DeviceCredentialsFilter instance = filter.withType("public_key"); assertThat(filter, is(instance)); @@ -36,7 +36,7 @@ public void shouldFilterByType() throws Exception { } @Test - public void shouldFilterByUserId() throws Exception { + public void shouldFilterByUserId() { DeviceCredentialsFilter instance = filter.withUserId("1234567890"); assertThat(filter, is(instance)); @@ -45,7 +45,7 @@ public void shouldFilterByUserId() throws Exception { } @Test - public void shouldFilterWithFields() throws Exception { + public void shouldFilterWithFields() { DeviceCredentialsFilter instance = filter.withFields("a,b,c", true); assertThat(filter, is(instance)); @@ -55,7 +55,7 @@ public void shouldFilterWithFields() throws Exception { } @Test - public void shouldFilterWithoutFields() throws Exception { + public void shouldFilterWithoutFields() { DeviceCredentialsFilter instance = filter.withFields("a,b,c", false); assertThat(filter, is(instance)); diff --git a/src/test/java/com/auth0/client/mgmt/filter/FieldFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/FieldFilterTest.java index 9c349cfd..03873040 100644 --- a/src/test/java/com/auth0/client/mgmt/filter/FieldFilterTest.java +++ b/src/test/java/com/auth0/client/mgmt/filter/FieldFilterTest.java @@ -13,12 +13,12 @@ public class FieldFilterTest { private FieldsFilter filter; @Before - public void setUp() throws Exception { + public void setUp() { filter = new FieldsFilter(); } @Test - public void shouldFilterWithFields() throws Exception { + public void shouldFilterWithFields() { FieldsFilter instance = filter.withFields("a,b,c", true); assertThat(filter, is(instance)); @@ -28,7 +28,7 @@ public void shouldFilterWithFields() throws Exception { } @Test - public void shouldFilterWithoutFields() throws Exception { + public void shouldFilterWithoutFields() { FieldsFilter instance = filter.withFields("a,b,c", false); assertThat(filter, is(instance)); diff --git a/src/test/java/com/auth0/client/mgmt/filter/GrantsFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/GrantsFilterTest.java index ed22e650..271cef3c 100644 --- a/src/test/java/com/auth0/client/mgmt/filter/GrantsFilterTest.java +++ b/src/test/java/com/auth0/client/mgmt/filter/GrantsFilterTest.java @@ -13,12 +13,12 @@ public class GrantsFilterTest { private GrantsFilter filter; @Before - public void setUp() throws Exception { + public void setUp() { filter = new GrantsFilter(); } @Test - public void shouldFilterByAudience() throws Exception { + public void shouldFilterByAudience() { GrantsFilter instance = filter.withAudience("https://myapi.auth0.com"); assertThat(filter, is(instance)); @@ -27,7 +27,7 @@ public void shouldFilterByAudience() throws Exception { } @Test - public void shouldFilterByClientId() throws Exception { + public void shouldFilterByClientId() { GrantsFilter instance = filter.withClientId("n3roinr32i23iron23nr"); assertThat(filter, is(instance)); @@ -36,7 +36,7 @@ public void shouldFilterByClientId() throws Exception { } @Test - public void shouldFilterByPage() throws Exception { + public void shouldFilterByPage() { GrantsFilter instance = filter.withPage(5, 10); assertThat(filter, is(instance)); @@ -46,7 +46,7 @@ public void shouldFilterByPage() throws Exception { } @Test - public void shouldIncludeTotals() throws Exception { + public void shouldIncludeTotals() { GrantsFilter instance = filter.withTotals(true); assertThat(filter, is(instance)); diff --git a/src/test/java/com/auth0/client/mgmt/filter/LogEventFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/LogEventFilterTest.java index ce285f26..f3df3deb 100644 --- a/src/test/java/com/auth0/client/mgmt/filter/LogEventFilterTest.java +++ b/src/test/java/com/auth0/client/mgmt/filter/LogEventFilterTest.java @@ -13,12 +13,12 @@ public class LogEventFilterTest { private LogEventFilter filter; @Before - public void setUp() throws Exception { + public void setUp() { filter = new LogEventFilter(); } @Test - public void shouldFilterByCheckpoint() throws Exception { + public void shouldFilterByCheckpoint() { LogEventFilter instance = filter.withCheckpoint("log123", 10); assertThat(filter, is(instance)); @@ -28,7 +28,7 @@ public void shouldFilterByCheckpoint() throws Exception { } @Test - public void shouldIncludeTotals() throws Exception { + public void shouldIncludeTotals() { LogEventFilter instance = filter.withTotals(true); assertThat(filter, is(instance)); @@ -37,7 +37,7 @@ public void shouldIncludeTotals() throws Exception { } @Test - public void shouldFilterByQuery() throws Exception { + public void shouldFilterByQuery() { LogEventFilter instance = filter.withQuery("id=log123"); assertThat(filter, is(instance)); @@ -46,7 +46,7 @@ public void shouldFilterByQuery() throws Exception { } @Test - public void shouldSort() throws Exception { + public void shouldSort() { LogEventFilter instance = filter.withSort("date:-1"); assertThat(filter, is(instance)); @@ -55,7 +55,7 @@ public void shouldSort() throws Exception { } @Test - public void shouldFilterByPage() throws Exception { + public void shouldFilterByPage() { LogEventFilter instance = filter.withPage(15, 50); assertThat(filter, is(instance)); @@ -65,7 +65,7 @@ public void shouldFilterByPage() throws Exception { } @Test - public void shouldFilterByWithFields() throws Exception { + public void shouldFilterByWithFields() { LogEventFilter instance = filter.withFields("a,b,c", true); assertThat(filter, is(instance)); @@ -75,7 +75,7 @@ public void shouldFilterByWithFields() throws Exception { } @Test - public void shouldFilterWithoutFields() throws Exception { + public void shouldFilterWithoutFields() { LogEventFilter instance = filter.withFields("a,b,c", false); assertThat(filter, is(instance)); diff --git a/src/test/java/com/auth0/client/mgmt/filter/PageFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/PageFilterTest.java index 1a102075..258eac08 100644 --- a/src/test/java/com/auth0/client/mgmt/filter/PageFilterTest.java +++ b/src/test/java/com/auth0/client/mgmt/filter/PageFilterTest.java @@ -13,12 +13,12 @@ public class PageFilterTest { private PageFilter filter; @Before - public void setUp() throws Exception { + public void setUp() { filter = new PageFilter(); } @Test - public void shouldFilterByPage() throws Exception { + public void shouldFilterByPage() { PageFilter instance = filter.withPage(5, 10); assertThat(filter, is(instance)); @@ -28,7 +28,7 @@ public void shouldFilterByPage() throws Exception { } @Test - public void shouldIncludeTotals() throws Exception { + public void shouldIncludeTotals() { PageFilter instance = filter.withTotals(true); assertThat(filter, is(instance)); diff --git a/src/test/java/com/auth0/client/mgmt/filter/QueryFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/QueryFilterTest.java index c76e758c..a62ad2f8 100644 --- a/src/test/java/com/auth0/client/mgmt/filter/QueryFilterTest.java +++ b/src/test/java/com/auth0/client/mgmt/filter/QueryFilterTest.java @@ -25,12 +25,12 @@ public class QueryFilterTest { private QueryFilter filter; @Before - public void setUp() throws Exception { + public void setUp() { filter = new QueryFilter(); } @Test - public void shouldIncludeTotals() throws Exception { + public void shouldIncludeTotals() { QueryFilter instance = filter.withTotals(true); assertThat(filter, is(instance)); @@ -39,7 +39,7 @@ public void shouldIncludeTotals() throws Exception { } @Test - public void shouldFilterByQuery() throws Exception { + public void shouldFilterByQuery() { QueryFilter instance = filter.withQuery("id=log123"); assertThat(filter, is(instance)); @@ -48,7 +48,7 @@ public void shouldFilterByQuery() throws Exception { } @Test - public void shouldSort() throws Exception { + public void shouldSort() { QueryFilter instance = filter.withSort("date:-1"); assertThat(filter, is(instance)); @@ -57,7 +57,7 @@ public void shouldSort() throws Exception { } @Test - public void shouldFilterByPage() throws Exception { + public void shouldFilterByPage() { QueryFilter instance = filter.withPage(15, 50); assertThat(filter, is(instance)); @@ -67,7 +67,7 @@ public void shouldFilterByPage() throws Exception { } @Test - public void shouldFilterByWithFields() throws Exception { + public void shouldFilterByWithFields() { QueryFilter instance = filter.withFields("a,b,c", true); assertThat(filter, is(instance)); @@ -77,7 +77,7 @@ public void shouldFilterByWithFields() throws Exception { } @Test - public void shouldFilterWithoutFields() throws Exception { + public void shouldFilterWithoutFields() { QueryFilter instance = filter.withFields("a,b,c", false); assertThat(filter, is(instance)); diff --git a/src/test/java/com/auth0/client/mgmt/filter/ResourceServersFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/ResourceServersFilterTest.java index 6cc86f1b..6339a216 100644 --- a/src/test/java/com/auth0/client/mgmt/filter/ResourceServersFilterTest.java +++ b/src/test/java/com/auth0/client/mgmt/filter/ResourceServersFilterTest.java @@ -13,12 +13,12 @@ public class ResourceServersFilterTest { private ResourceServersFilter filter; @Before - public void setUp() throws Exception { + public void setUp() { filter = new ResourceServersFilter(); } @Test - public void shouldFilterByPage() throws Exception { + public void shouldFilterByPage() { ResourceServersFilter instance = filter.withPage(5, 10); assertThat(filter, is(instance)); @@ -28,7 +28,7 @@ public void shouldFilterByPage() throws Exception { } @Test - public void shouldIncludeTotals() throws Exception { + public void shouldIncludeTotals() { ResourceServersFilter instance = filter.withTotals(true); assertThat(filter, is(instance)); diff --git a/src/test/java/com/auth0/client/mgmt/filter/RoleFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/RoleFilterTest.java index 3efbc075..e9b2491e 100644 --- a/src/test/java/com/auth0/client/mgmt/filter/RoleFilterTest.java +++ b/src/test/java/com/auth0/client/mgmt/filter/RoleFilterTest.java @@ -13,12 +13,12 @@ public class RoleFilterTest { private RolesFilter filter; @Before - public void setUp() throws Exception { + public void setUp() { filter = new RolesFilter(); } @Test - public void shouldFilterByName() throws Exception { + public void shouldFilterByName() { RolesFilter instance = filter.withName("roleName"); assertThat(filter, is(instance)); @@ -27,7 +27,7 @@ public void shouldFilterByName() throws Exception { } @Test - public void shouldFilterByPage() throws Exception { + public void shouldFilterByPage() { RolesFilter instance = filter.withPage(5, 10); assertThat(filter, is(instance)); @@ -37,7 +37,7 @@ public void shouldFilterByPage() throws Exception { } @Test - public void shouldIncludeTotals() throws Exception { + public void shouldIncludeTotals() { RolesFilter instance = filter.withTotals(true); assertThat(filter, is(instance)); diff --git a/src/test/java/com/auth0/client/mgmt/filter/RulesFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/RulesFilterTest.java index a22060dc..ded4b41b 100644 --- a/src/test/java/com/auth0/client/mgmt/filter/RulesFilterTest.java +++ b/src/test/java/com/auth0/client/mgmt/filter/RulesFilterTest.java @@ -13,12 +13,12 @@ public class RulesFilterTest { private RulesFilter filter; @Before - public void setUp() throws Exception { + public void setUp() { filter = new RulesFilter(); } @Test - public void shouldFilterWithEnabled() throws Exception { + public void shouldFilterWithEnabled() { RulesFilter instance = filter.withEnabled(true); assertThat(filter, is(instance)); @@ -27,7 +27,7 @@ public void shouldFilterWithEnabled() throws Exception { } @Test - public void shouldFilterWithFields() throws Exception { + public void shouldFilterWithFields() { RulesFilter instance = filter.withFields("a,b,c", true); assertThat(filter, is(instance)); @@ -37,7 +37,7 @@ public void shouldFilterWithFields() throws Exception { } @Test - public void shouldFilterWithoutFields() throws Exception { + public void shouldFilterWithoutFields() { RulesFilter instance = filter.withFields("a,b,c", false); assertThat(filter, is(instance)); @@ -47,7 +47,7 @@ public void shouldFilterWithoutFields() throws Exception { } @Test - public void shouldIncludeTotals() throws Exception { + public void shouldIncludeTotals() { RulesFilter instance = filter.withTotals(true); assertThat(filter, is(instance)); @@ -56,7 +56,7 @@ public void shouldIncludeTotals() throws Exception { } @Test - public void shouldFilterByPage() throws Exception { + public void shouldFilterByPage() { RulesFilter instance = filter.withPage(15, 50); assertThat(filter, is(instance)); diff --git a/src/test/java/com/auth0/client/mgmt/filter/UserFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/UserFilterTest.java index 65fec234..bfba9bfc 100644 --- a/src/test/java/com/auth0/client/mgmt/filter/UserFilterTest.java +++ b/src/test/java/com/auth0/client/mgmt/filter/UserFilterTest.java @@ -12,18 +12,18 @@ public class UserFilterTest { private UserFilter filter; @Before - public void setUp() throws Exception { + public void setUp() { filter = new UserFilter(); } @Test - public void shouldNotSetADefaultSearchEngineValue() throws Exception { + public void shouldNotSetADefaultSearchEngineValue() { assertThat(filter.getAsMap(), is(notNullValue())); assertThat(filter.getAsMap(), not(Matchers.hasKey("search_engine"))); } @Test - public void shouldSetSearchEngine() throws Exception { + public void shouldSetSearchEngine() { UserFilter instance = filter.withSearchEngine("v3"); assertThat(filter, is(instance)); @@ -32,7 +32,7 @@ public void shouldSetSearchEngine() throws Exception { } @Test - public void shouldIncludeTotals() throws Exception { + public void shouldIncludeTotals() { UserFilter instance = filter.withTotals(true); assertThat(filter, is(instance)); @@ -41,7 +41,7 @@ public void shouldIncludeTotals() throws Exception { } @Test - public void shouldFilterByQuery() throws Exception { + public void shouldFilterByQuery() { UserFilter instance = filter.withQuery("id=log123"); assertThat(filter, is(instance)); @@ -50,7 +50,7 @@ public void shouldFilterByQuery() throws Exception { } @Test - public void shouldSort() throws Exception { + public void shouldSort() { UserFilter instance = filter.withSort("date:-1"); assertThat(filter, is(instance)); @@ -59,7 +59,7 @@ public void shouldSort() throws Exception { } @Test - public void shouldFilterByPage() throws Exception { + public void shouldFilterByPage() { UserFilter instance = filter.withPage(15, 50); assertThat(filter, is(instance)); @@ -69,7 +69,7 @@ public void shouldFilterByPage() throws Exception { } @Test - public void shouldFilterByWithFields() throws Exception { + public void shouldFilterByWithFields() { UserFilter instance = filter.withFields("a,b,c", true); assertThat(filter, is(instance)); @@ -79,7 +79,7 @@ public void shouldFilterByWithFields() throws Exception { } @Test - public void shouldFilterWithoutFields() throws Exception { + public void shouldFilterWithoutFields() { UserFilter instance = filter.withFields("a,b,c", false); assertThat(filter, is(instance)); diff --git a/src/test/java/com/auth0/client/mgmt/filter/UsersExportFilterTest.java b/src/test/java/com/auth0/client/mgmt/filter/UsersExportFilterTest.java index f931af20..99401c7a 100644 --- a/src/test/java/com/auth0/client/mgmt/filter/UsersExportFilterTest.java +++ b/src/test/java/com/auth0/client/mgmt/filter/UsersExportFilterTest.java @@ -18,7 +18,7 @@ public class UsersExportFilterTest { private UsersExportFilter filter; @Before - public void setUp() throws Exception { + public void setUp() { filter = new UsersExportFilter(); } @@ -64,4 +64,4 @@ public void shouldFilterByFields() { assertThat(bodyFields.get(2).getExportAs(), is("custom")); } -} \ No newline at end of file +} diff --git a/src/test/java/com/auth0/client/mgmt/filter/UsersImportOptionsTest.java b/src/test/java/com/auth0/client/mgmt/filter/UsersImportOptionsTest.java index 601bab18..612ea954 100644 --- a/src/test/java/com/auth0/client/mgmt/filter/UsersImportOptionsTest.java +++ b/src/test/java/com/auth0/client/mgmt/filter/UsersImportOptionsTest.java @@ -12,7 +12,7 @@ public class UsersImportOptionsTest { private UsersImportOptions options; @Before - public void setUp() throws Exception { + public void setUp() { options = new UsersImportOptions(); } @@ -42,4 +42,4 @@ public void shouldSetUpsert() { assertThat(options.getAsMap(), is(notNullValue())); assertThat(options.getAsMap(), Matchers.hasEntry("upsert", true)); } -} \ No newline at end of file +} diff --git a/src/test/java/com/auth0/json/JsonTest.java b/src/test/java/com/auth0/json/JsonTest.java index 1b20544b..3fee0262 100644 --- a/src/test/java/com/auth0/json/JsonTest.java +++ b/src/test/java/com/auth0/json/JsonTest.java @@ -37,7 +37,7 @@ public String readTextFile(String path) throws IOException { return new String(Files.readAllBytes(Paths.get(path))); } - protected Date parseJSONDate(String dateString) throws ParseException, JsonProcessingException { + protected Date parseJSONDate(String dateString) throws ParseException { // StdDateFormat is the DateFormat Jackson uses by default for date fields (uses UTC timezone by default) // https://fasterxml.github.io/jackson-databind/javadoc/2.9/com/fasterxml/jackson/databind/util/StdDateFormat.html return new StdDateFormat().parse(dateString); diff --git a/src/test/java/com/auth0/json/mgmt/guardian/TwilioFactorProviderTest.java b/src/test/java/com/auth0/json/mgmt/guardian/TwilioFactorProviderTest.java index e37e3186..7849d55b 100644 --- a/src/test/java/com/auth0/json/mgmt/guardian/TwilioFactorProviderTest.java +++ b/src/test/java/com/auth0/json/mgmt/guardian/TwilioFactorProviderTest.java @@ -19,7 +19,7 @@ public class TwilioFactorProviderTest extends JsonTest { private static final String JSON_WITH_MESSAGING_SERVICE_SID = "{\"messaging_service_sid\":\"id321\",\"auth_token\":\"atokEn\",\"sid\":\"id123\"}"; @Test - public void shouldFailConstructionWithBothFromAndMessagingServiceSID() throws Exception { + public void shouldFailConstructionWithBothFromAndMessagingServiceSID() { exception.expect(IllegalArgumentException.class); exception.expectMessage("You must specify either `from` or `messagingServiceSID`, but not both"); @@ -28,7 +28,7 @@ public void shouldFailConstructionWithBothFromAndMessagingServiceSID() throws Ex @SuppressWarnings("deprecation") @Test - public void shouldFailWhenSettingFromAndMessagingServiceSIDWasAlreadySet() throws Exception { + public void shouldFailWhenSettingFromAndMessagingServiceSIDWasAlreadySet() { exception.expect(IllegalArgumentException.class); exception.expectMessage("You must specify either `from` or `messagingServiceSID`, but not both"); @@ -39,7 +39,7 @@ public void shouldFailWhenSettingFromAndMessagingServiceSIDWasAlreadySet() throw @SuppressWarnings("deprecation") @Test - public void shouldFailWhenSettingMessagingServiceSIDAndFromWasAlreadySet() throws Exception { + public void shouldFailWhenSettingMessagingServiceSIDAndFromWasAlreadySet() { exception.expect(IllegalArgumentException.class); exception.expectMessage("You must specify either `from` or `messagingServiceSID`, but not both"); @@ -126,4 +126,4 @@ public void shouldDeserializeWithMessagingServiceSID() throws Exception { assertThat(provider.getMessagingServiceSID(), is("id321")); assertThat(provider.getSID(), is("id123")); } -} \ No newline at end of file +} diff --git a/src/test/java/com/auth0/json/mgmt/tickets/PasswordChangeTicketTest.java b/src/test/java/com/auth0/json/mgmt/tickets/PasswordChangeTicketTest.java index 36fdf95c..348c4e81 100644 --- a/src/test/java/com/auth0/json/mgmt/tickets/PasswordChangeTicketTest.java +++ b/src/test/java/com/auth0/json/mgmt/tickets/PasswordChangeTicketTest.java @@ -64,7 +64,7 @@ public void shouldIncludeReadOnlyValuesOnDeserialize() throws Exception { @SuppressWarnings("deprecation") @Test - public void shouldHandleNullPasswordString() throws Exception { + public void shouldHandleNullPasswordString() { PasswordChangeTicket ticket = new PasswordChangeTicket("userId"); ticket.setNewPassword((String) null); @@ -72,7 +72,7 @@ public void shouldHandleNullPasswordString() throws Exception { } @Test - public void shouldHandleNullPasswordCharArray() throws Exception { + public void shouldHandleNullPasswordCharArray() { PasswordChangeTicket ticket = new PasswordChangeTicket("userId"); ticket.setNewPassword((char[]) null); diff --git a/src/test/java/com/auth0/json/mgmt/users/UserTest.java b/src/test/java/com/auth0/json/mgmt/users/UserTest.java index d39ec22d..558cbc85 100644 --- a/src/test/java/com/auth0/json/mgmt/users/UserTest.java +++ b/src/test/java/com/auth0/json/mgmt/users/UserTest.java @@ -18,7 +18,7 @@ public class UserTest extends JsonTest { private static final String readOnlyJson = "{\"user_id\":\"user|123\",\"last_ip\":\"10.0.0.1\",\"last_login\":\"2016-02-23T19:57:29.532Z\",\"last_password_reset\":\"2016-02-23T19:57:29Z\",\"logins_count\":10,\"created_at\":\"2016-02-23T19:57:29.532Z\",\"updated_at\":\"2016-02-23T19:57:29.532Z\",\"identities\":[]}"; @Test - public void shouldHaveEmptyValuesByDefault() throws Exception{ + public void shouldHaveEmptyValuesByDefault() { User user = new User(); assertThat(user.getValues(), is(notNullValue())); diff --git a/src/test/java/com/auth0/net/BaseRequestTest.java b/src/test/java/com/auth0/net/BaseRequestTest.java index ebf211df..75fc67c2 100644 --- a/src/test/java/com/auth0/net/BaseRequestTest.java +++ b/src/test/java/com/auth0/net/BaseRequestTest.java @@ -39,12 +39,12 @@ public void setUp() throws Exception { } @Test - public void alwaysCloseResponseOnSuccessfulRequest() throws Exception { + public void alwaysCloseResponseOnSuccessfulRequest() { Exception exception = null; try { new MockBaseRequest(client) { @Override - protected String parseResponse(Response response) throws Auth0Exception { + protected String parseResponse(Response response) { return ""; } }.execute(); @@ -57,7 +57,7 @@ protected String parseResponse(Response response) throws Auth0Exception { } @Test - public void alwaysCloseResponseOnRateLimitException() throws Exception { + public void alwaysCloseResponseOnRateLimitException() { Exception exception = null; try { new MockBaseRequest(client) { @@ -77,7 +77,7 @@ protected String parseResponse(Response response) throws Auth0Exception { } @Test - public void alwaysCloseResponseOnAPIException() throws Exception { + public void alwaysCloseResponseOnAPIException() { Exception exception = null; try { new MockBaseRequest(client) { @@ -97,7 +97,7 @@ protected String parseResponse(Response response) throws Auth0Exception { } @Test - public void alwaysCloseResponseOnAuth0Exception() throws Exception { + public void alwaysCloseResponseOnAuth0Exception() { Exception exception = null; try { new MockBaseRequest(client) { diff --git a/src/test/java/com/auth0/net/CustomRequestTest.java b/src/test/java/com/auth0/net/CustomRequestTest.java index b8dcfe37..124860a2 100644 --- a/src/test/java/com/auth0/net/CustomRequestTest.java +++ b/src/test/java/com/auth0/net/CustomRequestTest.java @@ -318,7 +318,7 @@ public void shouldParsePlainTextErrorResponse() throws Exception { } @Test - public void shouldParseRateLimitsHeaders() throws Exception { + public void shouldParseRateLimitsHeaders() { CustomRequest request = new CustomRequest<>(client, server.getBaseUrl(), "GET", listType); server.rateLimitReachedResponse(100, 10, 5); Exception exception = null; @@ -343,7 +343,7 @@ public void shouldParseRateLimitsHeaders() throws Exception { } @Test - public void shouldDefaultRateLimitsHeadersWhenMissing() throws Exception { + public void shouldDefaultRateLimitsHeadersWhenMissing() { CustomRequest request = new CustomRequest<>(client, server.getBaseUrl(), "GET", listType); server.rateLimitReachedResponse(-1, -1, -1); Exception exception = null; diff --git a/src/test/java/com/auth0/net/MultipartRequestTest.java b/src/test/java/com/auth0/net/MultipartRequestTest.java index 42ca0e1b..72fb4f38 100644 --- a/src/test/java/com/auth0/net/MultipartRequestTest.java +++ b/src/test/java/com/auth0/net/MultipartRequestTest.java @@ -62,7 +62,7 @@ public void tearDown() throws Exception { } @Test - public void shouldNotSupportGETMethod() throws Exception { + public void shouldNotSupportGETMethod() { exception.expect(instanceOf(IllegalArgumentException.class)); exception.expectMessage("Multipart/form-data requests do not support the GET method."); MultipartRequest request = new MultipartRequest<>(client, server.getBaseUrl(), "GET", tokenHolderType); @@ -155,7 +155,7 @@ public void shouldThrowOnExecuteFailure() throws Exception { } @Test - public void shouldThrowOnBodyCreationFailure() throws Exception { + public void shouldThrowOnBodyCreationFailure() { Exception exception = null; try { MultipartRequest request = new MultipartRequest<>(client, server.getBaseUrl(), "POST", voidType); @@ -344,7 +344,7 @@ public void shouldParsePlainTextErrorResponse() throws Exception { } @Test - public void shouldParseRateLimitsHeaders() throws Exception { + public void shouldParseRateLimitsHeaders() { MultipartRequest request = new MultipartRequest<>(client, server.getBaseUrl(), "POST", listType); request.addPart("non_empty", "body"); server.rateLimitReachedResponse(100, 10, 5); @@ -370,7 +370,7 @@ public void shouldParseRateLimitsHeaders() throws Exception { } @Test - public void shouldDefaultRateLimitsHeadersWhenMissing() throws Exception { + public void shouldDefaultRateLimitsHeadersWhenMissing() { MultipartRequest request = new MultipartRequest<>(client, server.getBaseUrl(), "POST", listType); request.addPart("non_empty", "body"); server.rateLimitReachedResponse(-1, -1, -1); diff --git a/src/test/java/com/auth0/net/TelemetryInterceptorTest.java b/src/test/java/com/auth0/net/TelemetryInterceptorTest.java index 2fa19728..ae866e1a 100644 --- a/src/test/java/com/auth0/net/TelemetryInterceptorTest.java +++ b/src/test/java/com/auth0/net/TelemetryInterceptorTest.java @@ -18,26 +18,26 @@ public class TelemetryInterceptorTest { private Telemetry telemetry; @Before - public void setUp() throws Exception { + public void setUp() { telemetry = mock(Telemetry.class); when(telemetry.getValue()).thenReturn("ClientInfo"); } @Test - public void shouldBeEnabledByDefault() throws Exception { + public void shouldBeEnabledByDefault() { TelemetryInterceptor interceptor = new TelemetryInterceptor(telemetry); assertThat(interceptor.isEnabled(), is(true)); } @Test - public void shouldDisable() throws Exception { + public void shouldDisable() { TelemetryInterceptor interceptor = new TelemetryInterceptor(telemetry); interceptor.setEnabled(false); assertThat(interceptor.isEnabled(), is(false)); } @Test - public void shouldEnable() throws Exception { + public void shouldEnable() { TelemetryInterceptor interceptor = new TelemetryInterceptor(telemetry); interceptor.setEnabled(true); assertThat(interceptor.isEnabled(), is(true)); @@ -125,4 +125,4 @@ public void shouldNotAddTelemetryHeaderIfDisabled() throws Exception { } -} \ No newline at end of file +} diff --git a/src/test/java/com/auth0/net/TelemetryTest.java b/src/test/java/com/auth0/net/TelemetryTest.java index 6a22e1bb..a8bdf171 100644 --- a/src/test/java/com/auth0/net/TelemetryTest.java +++ b/src/test/java/com/auth0/net/TelemetryTest.java @@ -50,40 +50,40 @@ public void shouldReturnCompleteTelemetryBase64Value() throws Exception { } @Test - public void shouldAcceptNullVersionAlwaysIncludeJavaVersion() throws Exception { + public void shouldAcceptNullVersionAlwaysIncludeJavaVersion() { Telemetry telemetry = new Telemetry("auth0-java", null); assertThat(telemetry.getValue(), is(notNullValue())); assertThat(telemetry.getEnvironment(), is(notNullValue())); } @Test - public void shouldNotAcceptNullName() throws Exception { + public void shouldNotAcceptNullName() { Telemetry telemetry = new Telemetry(null, null); assertThat(telemetry.getValue(), is(nullValue())); assertThat(telemetry.getEnvironment(), is(notNullValue())); } @Test - public void shouldGetName() throws Exception { + public void shouldGetName() { Telemetry telemetry = new Telemetry("auth0-java", "1.0.0"); assertThat(telemetry.getName(), is("auth0-java")); } @Test - public void shouldGetVersion() throws Exception { + public void shouldGetVersion() { Telemetry telemetry = new Telemetry("auth0-java", "1.0.0"); assertThat(telemetry.getVersion(), is("1.0.0")); } @Test - public void shouldNotIncludeLibraryVersionIfNotProvided() throws Exception { + public void shouldNotIncludeLibraryVersionIfNotProvided() { Telemetry telemetry = new Telemetry("auth0-java", "1.0.0"); assertThat(telemetry.getLibraryVersion(), is(nullValue())); assertThat(telemetry.getEnvironment().containsKey("auth0-java"), is(false)); } @Test - public void shouldGetLibraryVersion() throws Exception { + public void shouldGetLibraryVersion() { Telemetry telemetry = new Telemetry("auth0-java", "1.0.0", "2.1.3"); assertThat(telemetry.getLibraryVersion(), is("2.1.3")); assertThat(telemetry.getEnvironment().get("auth0-java"), is("2.1.3")); diff --git a/src/test/java/com/auth0/utils/tokens/SignatureVerifierTest.java b/src/test/java/com/auth0/utils/tokens/SignatureVerifierTest.java index f3d2d006..5737015f 100644 --- a/src/test/java/com/auth0/utils/tokens/SignatureVerifierTest.java +++ b/src/test/java/com/auth0/utils/tokens/SignatureVerifierTest.java @@ -143,7 +143,7 @@ public void failsWithNullVerifier() { new NullVerifier(); } - private PublicKeyProvider getRSProvider(String rsaPath) throws Exception { + private PublicKeyProvider getRSProvider(String rsaPath) { return new PublicKeyProvider() { @Override public RSAPublicKey getPublicKeyById(String keyId) throws PublicKeyProviderException {