diff --git a/backend/src/test/java/ca/bc/gov/hlth/hnweb/security/SecurityPropertiesTest.java b/backend/src/test/java/ca/bc/gov/hlth/hnweb/security/SecurityPropertiesTest.java index 290621da..a73f1c6d 100644 --- a/backend/src/test/java/ca/bc/gov/hlth/hnweb/security/SecurityPropertiesTest.java +++ b/backend/src/test/java/ca/bc/gov/hlth/hnweb/security/SecurityPropertiesTest.java @@ -18,7 +18,7 @@ public class SecurityPropertiesTest { @Test public void testGetProperties_success() { Map> rolePermissions = securityProperties.getRolePermissions(); - assertEquals(3, rolePermissions.size()); + assertEquals(4, rolePermissions.size()); List e45Permissions = rolePermissions.get("E45"); assertEquals(1, e45Permissions.size()); diff --git a/backend/src/test/java/ca/bc/gov/hlth/hnweb/security/SecurityUtilTest.java b/backend/src/test/java/ca/bc/gov/hlth/hnweb/security/SecurityUtilTest.java index c0a597ba..9ff59319 100644 --- a/backend/src/test/java/ca/bc/gov/hlth/hnweb/security/SecurityUtilTest.java +++ b/backend/src/test/java/ca/bc/gov/hlth/hnweb/security/SecurityUtilTest.java @@ -30,8 +30,19 @@ public void testLoadPermissions_E45() { } @Test - public void testLoadPermissions_Eligibility() { - Jwt jwt = createToken("Eligibility"); + public void testLoadPermissions_ELIGIBILITY() { + Jwt jwt = createToken("ELIGIBILITY"); + + List permissions = SecurityUtil.loadPermissions(jwt, securityProperties.getRolePermissions()); + assertEquals(3, permissions.size()); + assertEquals("E45", permissions.get(0)); + assertEquals("R15", permissions.get(1)); + assertEquals("R41", permissions.get(2)); + } + + @Test + public void testLoadPermissions_TRAININGHEALTHAUTH() { + Jwt jwt = createToken("TRAININGHEALTHAUTH"); List permissions = SecurityUtil.loadPermissions(jwt, securityProperties.getRolePermissions()); assertEquals(3, permissions.size());