RoutingEntry { public void setMethods(String[] methods) { List<HttpMethod> all = HttpMethod.values(); for (String s : methods) { if (!s.equals("*") && !all.contains(HttpMethod.valueOf(s))) { throw new DecodeException(s); } } this.methods = methods; }  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 testBadMethods() { RoutingEntry t = new RoutingEntry(); Exception e = assertThrows(DecodeException.class, () -> { String[] methods = { "GET", "GYF" }; t.setMethods(methods); }); assertEquals("GYF", e.getMessage()); e = assertThrows(DecodeException.class, () -> { String[] methods = { "get" }; t.setMethods(methods); }); assertEquals("get", e.getMessage()); }