diff options
Diffstat (limited to 'src/test/java/org')
-rw-r--r-- | src/test/java/org/onap/aai/validation/auth/MicroServiceAuthTest.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/test/java/org/onap/aai/validation/auth/MicroServiceAuthTest.java b/src/test/java/org/onap/aai/validation/auth/MicroServiceAuthTest.java index 1b1a5bb..b81d9ed 100644 --- a/src/test/java/org/onap/aai/validation/auth/MicroServiceAuthTest.java +++ b/src/test/java/org/onap/aai/validation/auth/MicroServiceAuthTest.java @@ -53,11 +53,10 @@ public class MicroServiceAuthTest { } private static final String VALID_ADMIN_USER = "cn=common-name, ou=org-unit, o=org, l=location, st=state, c=us"; - private static final String authPolicyFile = "auth_policy.json"; + private static final String authPolicyFile = "auth/auth_policy.json"; /** - * Temporarily invalidate the default policy file and then try to initialise the authorisation class using the name - * of a policy file that does not exist. + * Initialize the authorization class using the name of a policy file that does not exist. * * @throws AAIAuthException * if the authorization policy file cannot be loaded @@ -70,6 +69,19 @@ public class MicroServiceAuthTest { } /** + * Initialize the authorization class using a null policy file name. + * + * @throws AAIAuthException + * if the authorization policy file cannot be loaded + */ + @Test(expected = AAIAuthException.class) + public void testNullPolicyFile() throws AAIAuthException { + ValidationServiceAuthConfig authConfig = new ValidationServiceAuthConfig(); + authConfig.setAuthPolicyFile(null); + new AAIMicroServiceAuth(authConfig); + } + + /** * Test loading of a temporary file created with the specified roles. * * @throws IOException |