Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-cloud-netflix
Commits
0634c4bc
Commit
0634c4bc
authored
Mar 07, 2016
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disabling the metrics interceptor fixes the tests.
I'm not sure that is a good thing though.
parent
8375e3b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
MetricsInterceptorConfiguration.java
...loud/netflix/metrics/MetricsInterceptorConfiguration.java
+1
-0
RibbonClientHttpRequestFactoryTests.java
...d/netflix/ribbon/RibbonClientHttpRequestFactoryTests.java
+6
-3
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/metrics/MetricsInterceptorConfiguration.java
View file @
0634c4bc
...
@@ -32,6 +32,7 @@ import com.netflix.servo.monitor.Monitors;
...
@@ -32,6 +32,7 @@ import com.netflix.servo.monitor.Monitors;
* @author Jon Schneider
* @author Jon Schneider
*/
*/
@Configuration
@Configuration
@ConditionalOnProperty
(
value
=
"spring.cloud.netflix.metrics.enabled"
,
havingValue
=
"true"
,
matchIfMissing
=
true
)
@ConditionalOnClass
({
Monitors
.
class
,
MetricReader
.
class
})
@ConditionalOnClass
({
Monitors
.
class
,
MetricReader
.
class
})
public
class
MetricsInterceptorConfiguration
{
public
class
MetricsInterceptorConfiguration
{
...
...
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/ribbon/RibbonClientHttpRequestFactoryTests.java
View file @
0634c4bc
...
@@ -33,6 +33,7 @@ import org.springframework.context.annotation.Configuration;
...
@@ -33,6 +33,7 @@ import org.springframework.context.annotation.Configuration;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.RequestEntity
;
import
org.springframework.http.RequestEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.client.ClientHttpRequestFactory
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
@@ -59,20 +60,22 @@ import lombok.SneakyThrows;
...
@@ -59,20 +60,22 @@ import lombok.SneakyThrows;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringApplicationConfiguration
(
classes
=
RibbonClientHttpRequestFactoryTests
.
App
.
class
)
@SpringApplicationConfiguration
(
classes
=
RibbonClientHttpRequestFactoryTests
.
App
.
class
)
@WebIntegrationTest
(
value
=
{
"spring.application.name=ribbonclienttest"
,
@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
@DirtiesContext
public
class
RibbonClientHttpRequestFactoryTests
{
public
class
RibbonClientHttpRequestFactoryTests
{
@Rule
@Rule
public
final
ExpectedException
exceptionRule
=
ExpectedException
.
none
();
public
final
ExpectedException
exceptionRule
=
ExpectedException
.
none
();
@LoadBalanced
@Autowired
@Autowired
private
RestTemplate
restTemplate
;
private
RestTemplate
restTemplate
;
@Test
@Test
public
void
requestFactoryIsRibbon
()
{
public
void
requestFactoryIsRibbon
()
{
assertTrue
(
"wrong RequestFactory type"
,
this
.
restTemplate
ClientHttpRequestFactory
requestFactory
=
this
.
restTemplate
.
getRequestFactory
()
instanceof
RibbonClientHttpRequestFactory
);
.
getRequestFactory
();
assertTrue
(
"wrong RequestFactory type: "
+
requestFactory
.
getClass
(),
requestFactory
instanceof
RibbonClientHttpRequestFactory
);
}
}
@Test
@Test
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment