Merge branch 'master' into 2.0.x

This commit is contained in:
Marcin Grzejszczak
2017-07-03 08:11:57 +02:00
2 changed files with 8 additions and 9 deletions

View File

@@ -53,7 +53,7 @@ public class TraceFeignClientAutoConfiguration {
@Bean
@Scope("prototype")
@ConditionalOnClass(name = {"com.netflix.hystrix.HystrixCommand", "feign.hystrix.HystrixFeign"})
@ConditionalOnProperty(name = "feign.hystrix.enabled", matchIfMissing = true)
@ConditionalOnProperty(name = "feign.hystrix.enabled", havingValue = "true")
Feign.Builder feignHystrixBuilder(BeanFactory beanFactory) {
return SleuthHystrixFeignBuilder.builder(beanFactory);
}
@@ -61,7 +61,7 @@ public class TraceFeignClientAutoConfiguration {
@Bean
@ConditionalOnMissingBean
@Scope("prototype")
@ConditionalOnProperty(name = "feign.hystrix.enabled", havingValue = "false")
@ConditionalOnProperty(name = "feign.hystrix.enabled", havingValue = "false", matchIfMissing = true)
Feign.Builder feignBuilder(BeanFactory beanFactory) {
return SleuthFeignBuilder.builder(beanFactory);
}

View File

@@ -22,11 +22,6 @@ import com.netflix.loadbalancer.ILoadBalancer;
import com.netflix.loadbalancer.Server;
import feign.codec.Decoder;
import feign.codec.ErrorDecoder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.awaitility.Awaitility;
import org.junit.Before;
import org.junit.Rule;
@@ -62,6 +57,10 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import static org.springframework.cloud.sleuth.assertions.SleuthAssertions.then;
/**
@@ -71,7 +70,8 @@ import static org.springframework.cloud.sleuth.assertions.SleuthAssertions.then;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = FeignClientServerErrorTests.TestConfiguration.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@TestPropertySource(properties = { "spring.application.name=fooservice" })
@TestPropertySource(properties = { "spring.application.name=fooservice" ,
"feign.hystrix.enabled=true"})
public class FeignClientServerErrorTests {
@Autowired TestFeignInterface feignInterface;
@@ -139,7 +139,6 @@ public class FeignClientServerErrorTests {
Awaitility.await().untilAsserted(() -> {
then(this.capture.toString()).doesNotContain("Tried to close span but it is not the current span");
then(ExceptionUtils.getLastException()).isNull();
});
}