markt-asf commented on a change in pull request #186: BZ 63636: Context#findRoleMapping() never called in RealmBase#hasRole() URL: https://github.com/apache/tomcat/pull/186#discussion_r311726365
########## File path: test/org/apache/catalina/realm/TestRealmBase.java ########## @@ -789,4 +791,45 @@ public void testHttpConstraint() throws IOException { Assert.assertFalse(mapRealm.hasResourcePermission( request, response, constraintsDelete, null)); } + + @Test + public void testRoleMapping() throws Exception { + Context context = new TesterContext() { + private Map<String, String> roleMapping = new HashMap<>(); + + public void addRoleMapping(String role, String link) { + roleMapping.put(role, link); + } + + @Override + public String findRoleMapping(String role) { + return roleMapping.get(role); + } + }; + + context.addRoleMapping(ROLE2, "very-complex-role-name"); Review comment: I was thinking more: `<RoleMapping applicationName="..." realmName="..." />` but that is a discussion better suited to BZ 55477 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org