@Test public void testExtractConsumer5() throws XRd4JException { ConsumerEndpoint temp = ConsumerGatewayUtil.findMatch("GET /example.com/api/", map); assertEquals(true, temp == null); }
public static ConsumerEndpoint findMatch(String serviceId, Map<String, ConsumerEndpoint> endpoints) { if (endpoints.containsKey(serviceId)) { log.debug("Found match by service id : \"{}\".", serviceId); return endpoints.get(serviceId); } for (Map.Entry<String, ConsumerEndpoint> entry : endpoints.entrySet()) { String key = entry.getKey(); String keyMod = key.replaceAll("\\{" + Constants.PARAM_RESOURCE_ID + "\\}", "([\\\\w\\\\-]+?)"); log.trace("Modified key used for comparison : \"{}\".", keyMod); if (serviceId.matches(keyMod)) { log.debug("Found partial match by service id. Request value : \"{}\", matching value : \"{}\".", serviceId, key); ConsumerEndpoint endpoint = entry.getValue(); parseResourceId(key, endpoint, serviceId); return endpoint; } } log.debug("No match by service id was found. Service id : \"{}\".", serviceId); return null; }
ConsumerGatewayUtil { public static ConsumerEndpoint findMatch(String serviceId, Map<String, ConsumerEndpoint> endpoints) { if (endpoints.containsKey(serviceId)) { log.debug("Found match by service id : \"{}\".", serviceId); return endpoints.get(serviceId); } for (Map.Entry<String, ConsumerEndpoint> entry : endpoints.entrySet()) { String key = entry.getKey(); String keyMod = key.replaceAll("\\{" + Constants.PARAM_RESOURCE_ID + "\\}", "([\\\\w\\\\-]+?)"); log.trace("Modified key used for comparison : \"{}\".", keyMod); if (serviceId.matches(keyMod)) { log.debug("Found partial match by service id. Request value : \"{}\", matching value : \"{}\".", serviceId, key); ConsumerEndpoint endpoint = entry.getValue(); parseResourceId(key, endpoint, serviceId); return endpoint; } } log.debug("No match by service id was found. Service id : \"{}\".", serviceId); return null; } }
ConsumerGatewayUtil { public static ConsumerEndpoint findMatch(String serviceId, Map<String, ConsumerEndpoint> endpoints) { if (endpoints.containsKey(serviceId)) { log.debug("Found match by service id : \"{}\".", serviceId); return endpoints.get(serviceId); } for (Map.Entry<String, ConsumerEndpoint> entry : endpoints.entrySet()) { String key = entry.getKey(); String keyMod = key.replaceAll("\\{" + Constants.PARAM_RESOURCE_ID + "\\}", "([\\\\w\\\\-]+?)"); log.trace("Modified key used for comparison : \"{}\".", keyMod); if (serviceId.matches(keyMod)) { log.debug("Found partial match by service id. Request value : \"{}\", matching value : \"{}\".", serviceId, key); ConsumerEndpoint endpoint = entry.getValue(); parseResourceId(key, endpoint, serviceId); return endpoint; } } log.debug("No match by service id was found. Service id : \"{}\".", serviceId); return null; } private  ConsumerGatewayUtil(); }
ConsumerGatewayUtil { public static ConsumerEndpoint findMatch(String serviceId, Map<String, ConsumerEndpoint> endpoints) { if (endpoints.containsKey(serviceId)) { log.debug("Found match by service id : \"{}\".", serviceId); return endpoints.get(serviceId); } for (Map.Entry<String, ConsumerEndpoint> entry : endpoints.entrySet()) { String key = entry.getKey(); String keyMod = key.replaceAll("\\{" + Constants.PARAM_RESOURCE_ID + "\\}", "([\\\\w\\\\-]+?)"); log.trace("Modified key used for comparison : \"{}\".", keyMod); if (serviceId.matches(keyMod)) { log.debug("Found partial match by service id. Request value : \"{}\", matching value : \"{}\".", serviceId, key); ConsumerEndpoint endpoint = entry.getValue(); parseResourceId(key, endpoint, serviceId); return endpoint; } } log.debug("No match by service id was found. Service id : \"{}\".", serviceId); return null; } private  ConsumerGatewayUtil(); static Map<String, ConsumerEndpoint> extractConsumers(Properties endpoints, Properties gatewayProperties); static void extractEndpoints(String key, Properties endpoints, ConsumerEndpoint endpoint); static ConsumerEndpoint findMatch(String serviceId, Map<String, ConsumerEndpoint> endpoints); static String rewriteUrl(String servletUrl, String pathToResource, String responseStr); static ConsumerEndpoint createUnconfiguredEndpoint(Properties props, String pathToResource); static String removeResponseTag(String message); static boolean checkEncryptionProperties(Properties props, Map<String, ConsumerEndpoint> endpoints,
                                                    Map<String, Encrypter> asymmetricEncrypterCache); }
ConsumerGatewayUtil { public static ConsumerEndpoint findMatch(String serviceId, Map<String, ConsumerEndpoint> endpoints) { if (endpoints.containsKey(serviceId)) { log.debug("Found match by service id : \"{}\".", serviceId); return endpoints.get(serviceId); } for (Map.Entry<String, ConsumerEndpoint> entry : endpoints.entrySet()) { String key = entry.getKey(); String keyMod = key.replaceAll("\\{" + Constants.PARAM_RESOURCE_ID + "\\}", "([\\\\w\\\\-]+?)"); log.trace("Modified key used for comparison : \"{}\".", keyMod); if (serviceId.matches(keyMod)) { log.debug("Found partial match by service id. Request value : \"{}\", matching value : \"{}\".", serviceId, key); ConsumerEndpoint endpoint = entry.getValue(); parseResourceId(key, endpoint, serviceId); return endpoint; } } log.debug("No match by service id was found. Service id : \"{}\".", serviceId); return null; } private  ConsumerGatewayUtil(); static Map<String, ConsumerEndpoint> extractConsumers(Properties endpoints, Properties gatewayProperties); static void extractEndpoints(String key, Properties endpoints, ConsumerEndpoint endpoint); static ConsumerEndpoint findMatch(String serviceId, Map<String, ConsumerEndpoint> endpoints); static String rewriteUrl(String servletUrl, String pathToResource, String responseStr); static ConsumerEndpoint createUnconfiguredEndpoint(Properties props, String pathToResource); static String removeResponseTag(String message); static boolean checkEncryptionProperties(Properties props, Map<String, ConsumerEndpoint> endpoints,
                                                    Map<String, Encrypter> asymmetricEncrypterCache);  }