Commit 0634c4bc by Spencer Gibb

Disabling the metrics interceptor fixes the tests.

I'm not sure that is a good thing though.
parent 8375e3b4
......@@ -32,6 +32,7 @@ import com.netflix.servo.monitor.Monitors;
* @author Jon Schneider
*/
@Configuration
@ConditionalOnProperty(value = "spring.cloud.netflix.metrics.enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnClass({ Monitors.class, MetricReader.class })
public class MetricsInterceptorConfiguration {
......
......@@ -33,6 +33,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
import org.springframework.http.RequestEntity;
import org.springframework.http.ResponseEntity;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -59,20 +60,22 @@ import lombok.SneakyThrows;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = RibbonClientHttpRequestFactoryTests.App.class)
@WebIntegrationTest(value = { "spring.application.name=ribbonclienttest",
"spring.jmx.enabled=true" }, randomPort = true)
"spring.jmx.enabled=true", "spring.cloud.netflix.metrics.enabled=false" }, randomPort = true)
@DirtiesContext
public class RibbonClientHttpRequestFactoryTests {
@Rule
public final ExpectedException exceptionRule = ExpectedException.none();
@LoadBalanced
@Autowired
private RestTemplate restTemplate;
@Test
public void requestFactoryIsRibbon() {
assertTrue("wrong RequestFactory type", this.restTemplate
.getRequestFactory() instanceof RibbonClientHttpRequestFactory);
ClientHttpRequestFactory requestFactory = this.restTemplate
.getRequestFactory();
assertTrue("wrong RequestFactory type: " + requestFactory.getClass(), requestFactory instanceof RibbonClientHttpRequestFactory);
}
@Test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment