@Test public void isInstanceWorks() { Environment env = environmentWithConfig(yamlForServices); Map<String, StyxService> services = loadServices(env.configuration(), env, "multi", StyxService.class); assertThat(services.get("backendProvider"), instanceOf(BackendServiceProvider.class)); assertThat(services.get("routingProvider"), instanceOf(RoutingObjectProvider.class)); }
public static <T> Map<String, T> loadServices(Configuration configuration, Environment environment, String key, Class<? extends T> serviceClass) { return configuration.get(key, JsonNode.class) .<Map<String, T>>map(node -> servicesMap(node, environment, serviceClass)) .orElse(emptyMap()); }
ServiceProvision { public static <T> Map<String, T> loadServices(Configuration configuration, Environment environment, String key, Class<? extends T> serviceClass) { return configuration.get(key, JsonNode.class) .<Map<String, T>>map(node -> servicesMap(node, environment, serviceClass)) .orElse(emptyMap()); } }
ServiceProvision { public static <T> Map<String, T> loadServices(Configuration configuration, Environment environment, String key, Class<? extends T> serviceClass) { return configuration.get(key, JsonNode.class) .<Map<String, T>>map(node -> servicesMap(node, environment, serviceClass)) .orElse(emptyMap()); } private  ServiceProvision(); }
ServiceProvision { public static <T> Map<String, T> loadServices(Configuration configuration, Environment environment, String key, Class<? extends T> serviceClass) { return configuration.get(key, JsonNode.class) .<Map<String, T>>map(node -> servicesMap(node, environment, serviceClass)) .orElse(emptyMap()); } private  ServiceProvision(); static Optional<E> loadLoadBalancer(
            Configuration configuration,
            Environment environment,
            String key,
            Class<? extends E> serviceClass,
            ActiveOrigins activeOrigins); static Optional<E> loadRetryPolicy(
            Configuration configuration,
            Environment environment,
            String key,
            Class<? extends E> serviceClass); static Map<String, T> loadServices(Configuration configuration, Environment environment, String key, Class<? extends T> serviceClass); }
ServiceProvision { public static <T> Map<String, T> loadServices(Configuration configuration, Environment environment, String key, Class<? extends T> serviceClass) { return configuration.get(key, JsonNode.class) .<Map<String, T>>map(node -> servicesMap(node, environment, serviceClass)) .orElse(emptyMap()); } private  ServiceProvision(); static Optional<E> loadLoadBalancer(
            Configuration configuration,
            Environment environment,
            String key,
            Class<? extends E> serviceClass,
            ActiveOrigins activeOrigins); static Optional<E> loadRetryPolicy(
            Configuration configuration,
            Environment environment,
            String key,
            Class<? extends E> serviceClass); static Map<String, T> loadServices(Configuration configuration, Environment environment, String key, Class<? extends T> serviceClass);  }