michael-o 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_r311491516
########## 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: That would OK, as long as it is an interface. I don't want to hardcore those into my `context.xml`, but have them in a properties file. It could also be potentionally a database or something else. ---------------------------------------------------------------- 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