org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration Java Examples
The following examples show how to use
org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CamelCloudNetflixServiceLoadBalancerAutoConfigurationTest.java From camel-spring-boot with Apache License 2.0 | 5 votes |
@Test public void testAutoConfiguration() { new ApplicationContextRunner() .withConfiguration( AutoConfigurations.of( CamelAutoConfiguration.class, CamelCloudAutoConfiguration.class, CamelSpringCloudServiceRegistryAutoConfiguration.class, CamelCloudNetflixServiceLoadBalancerAutoConfiguration.class, RibbonAutoConfiguration.class, RibbonClientConfiguration.class )) .withUserConfiguration( TestConfiguration.class) .withPropertyValues( "debug=true", "spring.main.banner-mode=off", "ribbon.client.name=test") .run( context -> { assertThat(context).hasSingleBean(LoadBalancerClient.class); assertThat(context).getBean(LoadBalancerClient.class).isInstanceOf(RibbonLoadBalancerClient.class); assertThat(context).hasSingleBean(CamelSpringCloudServiceLoadBalancer.LoadBalancerClientAdapter.class); LoadBalancerClient client = context.getBean(LoadBalancerClient.class); ServiceLoadBalancer balancer = context.getBean(CamelSpringCloudServiceLoadBalancer.LoadBalancerClientAdapter.class).adapt(client); assertThat(balancer).isInstanceOf(CamelCloudNetflixServiceLoadBalancer.class); } ); }