RoutingEntry { public boolean matchUriTenant(String uri, String tenant) { if (pathPattern == null || !pathPattern.contains("{tenantId}")) { return false; } String replacedPattern = pathPattern.replace("{tenantId}", tenant); return fastMatch(replacedPattern, uri); }  String[] getPermissionsRequired(); void setPermissionsRequired(String[] permissionsRequired); String[] getPermissionsDesired(); void setPermissionsDesired(String[] permissionsDesired); String[] getModulePermissions(); void setModulePermissions(String[] modulePermissions); @JsonIgnore ProxyType getProxyType(); String getType(); void setType(String type); String getRedirectPath(); void setRedirectPath(String redirectPath); String getUnit(); void setUnit(String unit); String getDelay(); void setDelay(String delay); @JsonIgnore long getDelayMilliSeconds(); String getLevel(); void setLevel(String level); @JsonIgnore String getPhaseLevel(); String[] getMethods(); void setMethods(String[] methods); @JsonIgnore HttpMethod getDefaultMethod(HttpMethod defaultMethod); @JsonIgnore String getStaticPath(); @JsonIgnore String generateSystemId(String moduleId); String getPath(); void setPath(String path); String getPathPattern(); String getRewritePath(); void setRewritePath(String rewritePath); void setPathPattern(String pathPattern); String[] getPermissionsRequiredTenant(); void setPermissionsRequiredTenant(String[] permissionsRequiredTenant); boolean matchUriTenant(String uri, String tenant); boolean match(String uri, String method); String getRedirectUri(String uri); String getPhase(); void setPhase(String phase); @JsonProperty("delegateCORS") boolean isDelegateCors(); void setDelegateCors(boolean delegateCors); String validateHandlers(ProxyContext pc, String mod); String validateFilters(ProxyContext pc, String mod);  }
@Test void testMatchUriTenant() { RoutingEntry t = new RoutingEntry(); String[] methods = new String[1]; methods[0] = "GET"; t.setMethods(methods); assertNull(t.getPermissionsRequiredTenant()); t.setPermissionsRequiredTenant(new String[0]); assertNotNull(t.getPermissionsRequiredTenant()); assertFalse(t.matchUriTenant("/y/b", "diku")); t.setPathPattern("/{x}/b"); assertFalse(t.matchUriTenant("/y/b", "diku")); assertFalse(t.matchUriTenant("/y/b", "diku")); t.setPathPattern("/{tenantId}/b"); assertFalse(t.matchUriTenant("/testlib/b", "diku")); assertTrue(t.matchUriTenant("/diku/b", "diku")); t.setPathPattern("/{tenantId}/b/{tenantId}"); assertFalse(t.matchUriTenant("/diku/b/other", "diku")); assertTrue(t.matchUriTenant("/diku/b/diku", "diku")); t.setPathPattern("/{tenantId}/b/{moduleId}"); assertTrue(t.matchUriTenant("/diku/b/other", "diku")); }