@Test public void testRegexMapperDoNotAlterRoles2() { Roles roles = createRoles("123-admin"); RegexRoleMapper roleMapper = new RegexRoleMapper.Builder().setPattern("no-role-matches-this-pattern") .setReplacement("any").setKeepNonMapped(true).setReplaceAll(true).build(); Roles mappedRoles = roleMapper.mapRoles(roles); assertTrue(mappedRoles.contains("123-admin")); assertFalse(mappedRoles.contains("any")); }
@Override public Roles mapRoles(Roles rolesToMap) { return new RegexRoles(rolesToMap, this.pattern, this.replacement, this.keepNonMapped, this.replaceAll); }
RegexRoleMapper implements RoleMapper { @Override public Roles mapRoles(Roles rolesToMap) { return new RegexRoles(rolesToMap, this.pattern, this.replacement, this.keepNonMapped, this.replaceAll); } }
RegexRoleMapper implements RoleMapper { @Override public Roles mapRoles(Roles rolesToMap) { return new RegexRoles(rolesToMap, this.pattern, this.replacement, this.keepNonMapped, this.replaceAll); } private  RegexRoleMapper(Builder builder); }
RegexRoleMapper implements RoleMapper { @Override public Roles mapRoles(Roles rolesToMap) { return new RegexRoles(rolesToMap, this.pattern, this.replacement, this.keepNonMapped, this.replaceAll); } private  RegexRoleMapper(Builder builder); @Override Roles mapRoles(Roles rolesToMap); }
RegexRoleMapper implements RoleMapper { @Override public Roles mapRoles(Roles rolesToMap) { return new RegexRoles(rolesToMap, this.pattern, this.replacement, this.keepNonMapped, this.replaceAll); } private  RegexRoleMapper(Builder builder); @Override Roles mapRoles(Roles rolesToMap);  }