本文整理汇总了Java中org.springframework.cloud.netflix.zuul.filters.discovery.ServiceRouteMapper类的典型用法代码示例。如果您正苦于以下问题:Java ServiceRouteMapper类的具体用法?Java ServiceRouteMapper怎么用?Java ServiceRouteMapper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ServiceRouteMapper类属于org.springframework.cloud.netflix.zuul.filters.discovery包,在下文中一共展示了ServiceRouteMapper类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testFixLink
import org.springframework.cloud.netflix.zuul.filters.discovery.ServiceRouteMapper; //导入依赖的package包/类
@Test
public void testFixLink() throws Exception {
ServiceRouteMapper mapper = new ModuleServiceMapper();
DiscoveryClient discoveryClient = mock(DiscoveryClient.class);
ResponseLinksMapper responseLinksMapper = new ResponseLinksMapper(mapper, discoveryClient);
when(discoveryClient.getServices()).thenReturn(Collections.singletonList("service-module"));
responseLinksMapper.fillServices();
assertEquals("http://localhost:8080/api/service/entity", responseLinksMapper.fixLink("http://service-module/entity"));
}
示例2: serviceRouteMapper
import org.springframework.cloud.netflix.zuul.filters.discovery.ServiceRouteMapper; //导入依赖的package包/类
@Bean
public ServiceRouteMapper serviceRouteMapper() {
return new ModuleServiceMapper();
}
示例3: ResponseLinksMapper
import org.springframework.cloud.netflix.zuul.filters.discovery.ServiceRouteMapper; //导入依赖的package包/类
@Autowired
public ResponseLinksMapper(ServiceRouteMapper serviceRouteMapper, DiscoveryClient discoveryClient) {
this.serviceRouteMapper = serviceRouteMapper;
this.discoveryClient = discoveryClient;
}
示例4: serviceRouteMapper
import org.springframework.cloud.netflix.zuul.filters.discovery.ServiceRouteMapper; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(ServiceRouteMapper.class)
public ServiceRouteMapper serviceRouteMapper() {
return new SimpleServiceRouteMapper();
}