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
73f33456
Unverified
Commit
73f33456
authored
May 25, 2017
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
parent
302f8052
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
106 additions
and
74 deletions
+106
-74
pom.xml
pom.xml
+1
-1
pom.xml
spring-cloud-netflix-core/pom.xml
+5
-0
AtlasExporterTests.java
...ework/cloud/netflix/metrics/atlas/AtlasExporterTests.java
+1
-1
ServletPathZuulProxyApplicationTests.java
...ud/netflix/zuul/ServletPathZuulProxyApplicationTests.java
+1
-1
HttpClientRibbonCommandIntegrationTests.java
...route/apache/HttpClientRibbonCommandIntegrationTests.java
+2
-1
HttpClientRibbonRetryIntegrationTests.java
...s/route/apache/HttpClientRibbonRetryIntegrationTests.java
+6
-3
OkHttpRibbonRetryIntegrationTests.java
...lters/route/okhttp/OkHttpRibbonRetryIntegrationTests.java
+6
-3
pom.xml
spring-cloud-netflix-dependencies/pom.xml
+5
-0
ApplicationContextTests.java
.../cloud/netflix/eureka/server/ApplicationContextTests.java
+10
-10
ApplicationServletPathTests.java
...ud/netflix/eureka/server/ApplicationServletPathTests.java
+11
-11
ApplicationTests.java
...amework/cloud/netflix/eureka/server/ApplicationTests.java
+14
-14
pom.xml
spring-cloud-netflix-hystrix-dashboard/pom.xml
+5
-0
HystrixDashboardContextTests.java
...tflix/hystrix/dashboard/HystrixDashboardContextTests.java
+11
-10
pom.xml
spring-cloud-netflix-hystrix-stream/pom.xml
+5
-0
HystrixStreamTests.java
...work/cloud/netflix/hystrix/stream/HystrixStreamTests.java
+2
-2
pom.xml
spring-cloud-netflix-sidecar/pom.xml
+5
-0
SidecarApplicationTests.java
...mework/cloud/netflix/sidecar/SidecarApplicationTests.java
+11
-11
pom.xml
spring-cloud-netflix-turbine/pom.xml
+5
-0
pom.xml
spring-cloud-starter-archaius/pom.xml
+0
-6
No files found.
pom.xml
View file @
73f33456
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
<jackson.version>
2.7.3
</jackson.version>
<jackson.version>
2.7.3
</jackson.version>
<spring-cloud-commons.version>
2.0.0.BUILD-SNAPSHOT
</spring-cloud-commons.version>
<spring-cloud-commons.version>
2.0.0.BUILD-SNAPSHOT
</spring-cloud-commons.version>
<spring-cloud-config.version>
2.0.0.BUILD-SNAPSHOT
</spring-cloud-config.version>
<spring-cloud-config.version>
2.0.0.BUILD-SNAPSHOT
</spring-cloud-config.version>
<spring-cloud-stream.version>
Chelsea
.BUILD-SNAPSHOT
</spring-cloud-stream.version>
<spring-cloud-stream.version>
Elmhurst
.BUILD-SNAPSHOT
</spring-cloud-stream.version>
<!-- Sonar -->
<!-- Sonar -->
<surefire.plugin.version>
2.19.1
</surefire.plugin.version>
<surefire.plugin.version>
2.19.1
</surefire.plugin.version>
...
...
spring-cloud-netflix-core/pom.xml
View file @
73f33456
...
@@ -75,6 +75,11 @@
...
@@ -75,6 +75,11 @@
<artifactId>
commons-configuration
</artifactId>
<artifactId>
commons-configuration
</artifactId>
<optional>
true
</optional>
<optional>
true
</optional>
</dependency>
</dependency>
<dependency>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
<optional>
true
</optional>
</dependency>
<!-- end archaius deps -->
<!-- end archaius deps -->
<dependency>
<dependency>
<groupId>
com.netflix.servo
</groupId>
<groupId>
com.netflix.servo
</groupId>
...
...
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/metrics/atlas/AtlasExporterTests.java
View file @
73f33456
...
@@ -51,7 +51,7 @@ public class AtlasExporterTests {
...
@@ -51,7 +51,7 @@ public class AtlasExporterTests {
MockRestServiceServer
mockServer
=
MockRestServiceServer
MockRestServiceServer
mockServer
=
MockRestServiceServer
.
createServer
(
this
.
restTemplate
);
.
createServer
(
this
.
restTemplate
);
mockServer
.
expect
(
MockRestRequestMatchers
.
requestTo
(
"atlas/api/v1/publish"
))
mockServer
.
expect
(
MockRestRequestMatchers
.
requestTo
(
"
/
atlas/api/v1/publish"
))
.
andExpect
(
MockRestRequestMatchers
.
method
(
HttpMethod
.
POST
))
.
andExpect
(
MockRestRequestMatchers
.
method
(
HttpMethod
.
POST
))
.
andRespond
(
MockRestResponseCreators
.
withSuccess
(
"{\"status\" : \"OK\"}"
,
.
andRespond
(
MockRestResponseCreators
.
withSuccess
(
"{\"status\" : \"OK\"}"
,
MediaType
.
APPLICATION_JSON
));
MediaType
.
APPLICATION_JSON
));
...
...
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/ServletPathZuulProxyApplicationTests.java
View file @
73f33456
...
@@ -53,7 +53,7 @@ import com.netflix.zuul.context.RequestContext;
...
@@ -53,7 +53,7 @@ import com.netflix.zuul.context.RequestContext;
@SpringBootTest
(
@SpringBootTest
(
classes
=
ServletPathZuulProxyApplicationTests
.
ServletPathZuulProxyApplication
.
class
,
classes
=
ServletPathZuulProxyApplicationTests
.
ServletPathZuulProxyApplication
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
value
=
{
"server.servletP
ath: /app"
})
properties
=
{
"server.servlet.p
ath: /app"
})
@DirtiesContext
@DirtiesContext
public
class
ServletPathZuulProxyApplicationTests
{
public
class
ServletPathZuulProxyApplicationTests
{
...
...
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/apache/HttpClientRibbonCommandIntegrationTests.java
View file @
73f33456
...
@@ -78,7 +78,8 @@ import com.netflix.loadbalancer.ServerList;
...
@@ -78,7 +78,8 @@ import com.netflix.loadbalancer.ServerList;
@SpringBootTest
(
classes
=
HttpClientRibbonCommandIntegrationTests
.
TestConfig
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
value
=
{
@SpringBootTest
(
classes
=
HttpClientRibbonCommandIntegrationTests
.
TestConfig
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
value
=
{
"zuul.routes.other: /test/**=http://localhost:7777/local"
,
"zuul.routes.other: /test/**=http://localhost:7777/local"
,
"zuul.routes.another: /another/twolevel/**"
,
"zuul.routes.simple: /simple/**"
,
"zuul.routes.another: /another/twolevel/**"
,
"zuul.routes.simple: /simple/**"
,
"zuul.routes.singleton: /singleton/**"
,
"zuul.routes.singleton.id: singleton"
,
"zuul.routes.singleton.path: /singleton/**"
,
"zuul.routes.singleton.sensitiveHeaders: "
})
"zuul.routes.singleton.sensitiveHeaders: "
})
@DirtiesContext
@DirtiesContext
public
class
HttpClientRibbonCommandIntegrationTests
extends
ZuulProxyTestBase
{
public
class
HttpClientRibbonCommandIntegrationTests
extends
ZuulProxyTestBase
{
...
...
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/apache/HttpClientRibbonRetryIntegrationTests.java
View file @
73f33456
...
@@ -35,16 +35,19 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
...
@@ -35,16 +35,19 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
"zuul.retryable: false"
,
/* Disable retry by default, have each route enable it */
"zuul.retryable: false"
,
/* Disable retry by default, have each route enable it */
"hystrix.command.default.execution.timeout.enabled: false"
,
/* Disable hystrix so its timeout doesnt get in the way */
"hystrix.command.default.execution.timeout.enabled: false"
,
/* Disable hystrix so its timeout doesnt get in the way */
"ribbon.ReadTimeout: 1000"
,
/* Make sure ribbon will timeout before the thread is done sleeping */
"ribbon.ReadTimeout: 1000"
,
/* Make sure ribbon will timeout before the thread is done sleeping */
"zuul.routes.retryable: /retryable/**"
,
"zuul.routes.retryable.id: retryable"
,
"zuul.routes.retryable.path: /retryable/**"
,
"zuul.routes.retryable.retryable: true"
,
"zuul.routes.retryable.retryable: true"
,
"retryable.ribbon.OkToRetryOnAllOperations: true"
,
"retryable.ribbon.OkToRetryOnAllOperations: true"
,
"retryable.ribbon.MaxAutoRetries: 1"
,
"retryable.ribbon.MaxAutoRetries: 1"
,
"retryable.ribbon.MaxAutoRetriesNextServer: 1"
,
"retryable.ribbon.MaxAutoRetriesNextServer: 1"
,
"zuul.routes.getretryable: /getretryable/**"
,
"zuul.routes.getretryable.id: getretryable"
,
"zuul.routes.getretryable.path: /getretryable/**"
,
"zuul.routes.getretryable.retryable: true"
,
"zuul.routes.getretryable.retryable: true"
,
"getretryable.ribbon.MaxAutoRetries: 1"
,
"getretryable.ribbon.MaxAutoRetries: 1"
,
"getretryable.ribbon.MaxAutoRetriesNextServer: 1"
,
"getretryable.ribbon.MaxAutoRetriesNextServer: 1"
,
"zuul.routes.disableretry: /disableretry/**"
,
"zuul.routes.disableretry.id: disableretry"
,
"zuul.routes.disableretry.path: /disableretry/**"
,
"zuul.routes.disableretry.retryable: false"
,
/* This will override the global */
"zuul.routes.disableretry.retryable: false"
,
/* This will override the global */
"disableretry.ribbon.MaxAutoRetries: 1"
,
"disableretry.ribbon.MaxAutoRetries: 1"
,
"disableretry.ribbon.MaxAutoRetriesNextServer: 1"
,
"disableretry.ribbon.MaxAutoRetriesNextServer: 1"
,
...
...
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/okhttp/OkHttpRibbonRetryIntegrationTests.java
View file @
73f33456
...
@@ -33,17 +33,20 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
...
@@ -33,17 +33,20 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
"ribbon.okhttp.enabled: true"
,
"ribbon.okhttp.enabled: true"
,
"hystrix.command.default.execution.timeout.enabled: false"
,
/* Disable hystrix so its timeout doesnt get in the way */
"hystrix.command.default.execution.timeout.enabled: false"
,
/* Disable hystrix so its timeout doesnt get in the way */
"ribbon.ReadTimeout: 1000"
,
/* Make sure ribbon will timeout before the thread is done sleeping */
"ribbon.ReadTimeout: 1000"
,
/* Make sure ribbon will timeout before the thread is done sleeping */
"zuul.routes.retryable: /retryable/**"
,
"zuul.routes.retryable.id: retryable"
,
"zuul.routes.retryable.path: /retryable/**"
,
"zuul.routes.retryable.retryable: true"
,
"zuul.routes.retryable.retryable: true"
,
"retryable.ribbon.OkToRetryOnAllOperations: true"
,
"retryable.ribbon.OkToRetryOnAllOperations: true"
,
"retryable.ribbon.retryableStatusCodes: 404"
,
"retryable.ribbon.retryableStatusCodes: 404"
,
"retryable.ribbon.MaxAutoRetries: 1"
,
"retryable.ribbon.MaxAutoRetries: 1"
,
"retryable.ribbon.MaxAutoRetriesNextServer: 1"
,
"retryable.ribbon.MaxAutoRetriesNextServer: 1"
,
"zuul.routes.getretryable: /getretryable/**"
,
"zuul.routes.getretryable.id: getretryable"
,
"zuul.routes.getretryable.path: /getretryable/**"
,
"zuul.routes.getretryable.retryable: true"
,
"zuul.routes.getretryable.retryable: true"
,
"getretryable.ribbon.MaxAutoRetries: 1"
,
"getretryable.ribbon.MaxAutoRetries: 1"
,
"getretryable.ribbon.MaxAutoRetriesNextServer: 1"
,
"getretryable.ribbon.MaxAutoRetriesNextServer: 1"
,
"zuul.routes.disableretry: /disableretry/**"
,
"zuul.routes.disableretry.path: /disableretry/**"
,
"zuul.routes.disableretry.path: /disableretry/**"
,
"zuul.routes.disableretry.retryable: false"
,
/* This will override the global */
"zuul.routes.disableretry.retryable: false"
,
/* This will override the global */
"disableretry.ribbon.MaxAutoRetries: 1"
,
"disableretry.ribbon.MaxAutoRetries: 1"
,
"disableretry.ribbon.MaxAutoRetriesNextServer: 1"
,
"disableretry.ribbon.MaxAutoRetriesNextServer: 1"
,
...
...
spring-cloud-netflix-dependencies/pom.xml
View file @
73f33456
...
@@ -173,6 +173,11 @@
...
@@ -173,6 +173,11 @@
<artifactId>
commons-configuration
</artifactId>
<artifactId>
commons-configuration
</artifactId>
<version>
1.8
</version>
<version>
1.8
</version>
</dependency>
</dependency>
<dependency>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
<version>
1.1.1
</version>
</dependency>
<!-- end archaius deps -->
<!-- end archaius deps -->
<dependency>
<dependency>
<groupId>
com.sun.jersey
</groupId>
<groupId>
com.sun.jersey
</groupId>
...
...
spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/ApplicationContextTests.java
View file @
73f33456
...
@@ -17,20 +17,17 @@
...
@@ -17,20 +17,17 @@
package
org
.
springframework
.
cloud
.
netflix
.
eureka
.
server
;
package
org
.
springframework
.
cloud
.
netflix
.
eureka
.
server
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Map
;
import
java.util.Map
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest.WebEnvironment
;
import
org.springframework.boot.test.context.SpringBootTest.WebEnvironment
;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.boot.web.server.LocalServerPort
;
import
org.springframework.cloud.netflix.eureka.server.ApplicationContextTests.Application
;
import
org.springframework.cloud.netflix.eureka.server.ApplicationContextTests.Application
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpEntity
;
...
@@ -39,15 +36,18 @@ import org.springframework.http.HttpMethod;
...
@@ -39,15 +36,18 @@ import org.springframework.http.HttpMethod;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
@RunWith
(
Spring
JUnit4Class
Runner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
value
=
{
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
"spring.application.name=eureka"
,
"server.servlet.contextP
ath=/context"
,
properties
=
{
"spring.application.name=eureka"
,
"server.servlet.context-p
ath=/context"
,
"management.security.enabled=false"
})
"management.security.enabled=false"
})
public
class
ApplicationContextTests
{
public
class
ApplicationContextTests
{
@
Value
(
"${local.server.port}"
)
@
LocalServerPort
private
int
port
=
0
;
private
int
port
=
0
;
@Test
@Test
...
@@ -95,7 +95,7 @@ public class ApplicationContextTests {
...
@@ -95,7 +95,7 @@ public class ApplicationContextTests {
@SuppressWarnings
(
"rawtypes"
)
@SuppressWarnings
(
"rawtypes"
)
ResponseEntity
<
Map
>
entity
=
new
TestRestTemplate
().
exchange
(
ResponseEntity
<
Map
>
entity
=
new
TestRestTemplate
().
exchange
(
"http://localhost:"
+
this
.
port
+
"/context/env"
,
HttpMethod
.
GET
,
"http://localhost:"
+
this
.
port
+
"/context/
application/
env"
,
HttpMethod
.
GET
,
new
HttpEntity
<>(
"parameters"
,
headers
),
Map
.
class
);
new
HttpEntity
<>(
"parameters"
,
headers
),
Map
.
class
);
assertEquals
(
HttpStatus
.
OK
,
entity
.
getStatusCode
());
assertEquals
(
HttpStatus
.
OK
,
entity
.
getStatusCode
());
}
}
...
...
spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/ApplicationServletPathTests.java
View file @
73f33456
...
@@ -16,9 +16,6 @@
...
@@ -16,9 +16,6 @@
package
org
.
springframework
.
cloud
.
netflix
.
eureka
.
server
;
package
org
.
springframework
.
cloud
.
netflix
.
eureka
.
server
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -26,10 +23,9 @@ import org.junit.Test;
...
@@ -26,10 +23,9 @@ import org.junit.Test;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.web.server.LocalServerPort
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest.WebEnvironment
;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.boot.web.server.LocalServerPort
;
import
org.springframework.cloud.netflix.eureka.server.ApplicationServletPathTests.Application
;
import
org.springframework.cloud.netflix.eureka.server.ApplicationServletPathTests.Application
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpEntity
;
...
@@ -38,11 +34,15 @@ import org.springframework.http.HttpMethod;
...
@@ -38,11 +34,15 @@ import org.springframework.http.HttpMethod;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
static
org
.
springframework
.
boot
.
test
.
context
.
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
;
@RunWith
(
Spring
JUnit4Class
Runner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
value
=
{
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
RANDOM_PORT
,
properties
=
{
"spring.application.name=eureka"
,
"server.servlet
P
ath=/servlet"
,
"spring.application.name=eureka"
,
"server.servlet
.p
ath=/servlet"
,
"management.security.enabled=false"
})
"management.security.enabled=false"
})
public
class
ApplicationServletPathTests
{
public
class
ApplicationServletPathTests
{
...
@@ -56,7 +56,7 @@ public class ApplicationServletPathTests {
...
@@ -56,7 +56,7 @@ public class ApplicationServletPathTests {
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
new
SpringApplicationBuilder
(
Application
.
class
)
new
SpringApplicationBuilder
(
Application
.
class
)
.
properties
(
"spring.application.name=eureka"
,
.
properties
(
"spring.application.name=eureka"
,
"server.servlet
P
ath=/servlet"
)
"server.servlet
.p
ath=/servlet"
)
.
run
(
args
);
.
run
(
args
);
}
}
}
}
...
@@ -106,7 +106,7 @@ public class ApplicationServletPathTests {
...
@@ -106,7 +106,7 @@ public class ApplicationServletPathTests {
@SuppressWarnings
(
"rawtypes"
)
@SuppressWarnings
(
"rawtypes"
)
ResponseEntity
<
Map
>
entity
=
new
TestRestTemplate
().
exchange
(
ResponseEntity
<
Map
>
entity
=
new
TestRestTemplate
().
exchange
(
"http://localhost:"
+
this
.
port
+
"/servlet/env"
,
HttpMethod
.
GET
,
"http://localhost:"
+
this
.
port
+
"/servlet/
application/
env"
,
HttpMethod
.
GET
,
new
HttpEntity
<>(
"parameters"
,
headers
),
Map
.
class
);
new
HttpEntity
<>(
"parameters"
,
headers
),
Map
.
class
);
assertEquals
(
HttpStatus
.
OK
,
entity
.
getStatusCode
());
assertEquals
(
HttpStatus
.
OK
,
entity
.
getStatusCode
());
}
}
...
...
spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/ApplicationTests.java
View file @
73f33456
...
@@ -16,14 +16,6 @@
...
@@ -16,14 +16,6 @@
package
org
.
springframework
.
cloud
.
netflix
.
eureka
.
server
;
package
org
.
springframework
.
cloud
.
netflix
.
eureka
.
server
;
import
static
org
.
hamcrest
.
Matchers
.
instanceOf
;
import
static
org
.
hamcrest
.
Matchers
.
is
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertFalse
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
junit
.
Assert
.
assertThat
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -32,10 +24,9 @@ import org.junit.runner.RunWith;
...
@@ -32,10 +24,9 @@ import org.junit.runner.RunWith;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.web.server.LocalServerPort
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest.WebEnvironment
;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.boot.web.server.LocalServerPort
;
import
org.springframework.cloud.netflix.eureka.server.ApplicationTests.Application
;
import
org.springframework.cloud.netflix.eureka.server.ApplicationTests.Application
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpEntity
;
...
@@ -44,14 +35,23 @@ import org.springframework.http.HttpMethod;
...
@@ -44,14 +35,23 @@ import org.springframework.http.HttpMethod;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.context.junit4.Spring
JUnit4Class
Runner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
com.netflix.appinfo.InstanceInfo
;
import
com.netflix.appinfo.InstanceInfo
;
import
com.netflix.discovery.converters.wrappers.CodecWrapper
;
import
com.netflix.discovery.converters.wrappers.CodecWrapper
;
import
com.netflix.eureka.resources.ServerCodecs
;
import
com.netflix.eureka.resources.ServerCodecs
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
import
static
org
.
hamcrest
.
Matchers
.
instanceOf
;
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
value
=
{
import
static
org
.
hamcrest
.
Matchers
.
is
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertFalse
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
junit
.
Assert
.
assertThat
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
static
org
.
springframework
.
boot
.
test
.
context
.
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
RANDOM_PORT
,
properties
=
{
"spring.jmx.enabled=true"
,
"management.security.enabled=false"
})
"spring.jmx.enabled=true"
,
"management.security.enabled=false"
})
public
class
ApplicationTests
{
public
class
ApplicationTests
{
...
@@ -76,7 +76,7 @@ public class ApplicationTests {
...
@@ -76,7 +76,7 @@ public class ApplicationTests {
@SuppressWarnings
(
"rawtypes"
)
@SuppressWarnings
(
"rawtypes"
)
ResponseEntity
<
Map
>
entity
=
new
TestRestTemplate
().
exchange
(
ResponseEntity
<
Map
>
entity
=
new
TestRestTemplate
().
exchange
(
"http://localhost:"
+
this
.
port
+
"/env"
,
HttpMethod
.
GET
,
"http://localhost:"
+
this
.
port
+
"/
application/
env"
,
HttpMethod
.
GET
,
new
HttpEntity
<>(
"parameters"
,
headers
),
Map
.
class
);
new
HttpEntity
<>(
"parameters"
,
headers
),
Map
.
class
);
assertEquals
(
HttpStatus
.
OK
,
entity
.
getStatusCode
());
assertEquals
(
HttpStatus
.
OK
,
entity
.
getStatusCode
());
}
}
...
...
spring-cloud-netflix-hystrix-dashboard/pom.xml
View file @
73f33456
...
@@ -64,6 +64,11 @@
...
@@ -64,6 +64,11 @@
<optional>
true
</optional>
<optional>
true
</optional>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
<scope>
test
</scope>
...
...
spring-cloud-netflix-hystrix-dashboard/src/test/java/org/springframework/cloud/netflix/hystrix/dashboard/HystrixDashboardContextTests.java
View file @
73f33456
...
@@ -17,34 +17,35 @@
...
@@ -17,34 +17,35 @@
package
org
.
springframework
.
cloud
.
netflix
.
hystrix
.
dashboard
;
package
org
.
springframework
.
cloud
.
netflix
.
hystrix
.
dashboard
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest.WebEnvironment
;
import
org.springframework.boot.test.context.SpringBootTest.WebEnvironment
;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.boot.web.server.LocalServerPort
;
import
org.springframework.cloud.netflix.hystrix.dashboard.HystrixDashboardContextTests.Application
;
import
org.springframework.cloud.netflix.hystrix.dashboard.HystrixDashboardContextTests.Application
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
/**
/**
* @author Dave Syer
* @author Dave Syer
*
*
*/
*/
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
value
=
{
"spring.application.name=hystrix-dashboard"
,
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
"server.servlet.contextPath=/context"
})
properties
=
{
"spring.application.name=hystrix-dashboard"
,
"server.servlet.context-path=/context"
})
public
class
HystrixDashboardContextTests
{
public
class
HystrixDashboardContextTests
{
public
static
final
String
JQUERY_PATH
=
"/context/webjars/jquery/2.1.1/jquery.min.js"
;
public
static
final
String
JQUERY_PATH
=
"/context/webjars/jquery/2.1.1/jquery.min.js"
;
@
Value
(
"${local.server.port}"
)
@
LocalServerPort
private
int
port
=
0
;
private
int
port
=
0
;
@Test
@Test
...
@@ -100,7 +101,7 @@ public class HystrixDashboardContextTests {
...
@@ -100,7 +101,7 @@ public class HystrixDashboardContextTests {
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
new
SpringApplicationBuilder
(
Application
.
class
).
properties
(
new
SpringApplicationBuilder
(
Application
.
class
).
properties
(
"spring.application.name=hystrix-dashboard"
,
"spring.application.name=hystrix-dashboard"
,
"server.servlet.context
P
ath=/context"
).
run
();
"server.servlet.context
-p
ath=/context"
).
run
();
}
}
}
}
...
...
spring-cloud-netflix-hystrix-stream/pom.xml
View file @
73f33456
...
@@ -46,6 +46,11 @@
...
@@ -46,6 +46,11 @@
<artifactId>
hystrix-core
</artifactId>
<artifactId>
hystrix-core
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
com.netflix.hystrix
</groupId>
<groupId>
com.netflix.hystrix
</groupId>
<artifactId>
hystrix-metrics-event-stream
</artifactId>
<artifactId>
hystrix-metrics-event-stream
</artifactId>
<scope>
test
</scope>
<scope>
test
</scope>
...
...
spring-cloud-netflix-hystrix-stream/src/test/java/org/springframework/cloud/netflix/hystrix/stream/HystrixStreamTests.java
View file @
73f33456
...
@@ -35,8 +35,8 @@ import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
...
@@ -35,8 +35,8 @@ import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
* @author Spencer Gibb
* @author Spencer Gibb
*/
*/
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
(
classes
=
HystrixStreamTests
.
Application
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
value
=
{
@SpringBootTest
(
classes
=
HystrixStreamTests
.
Application
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
"server.port=0"
,
"spring.jmx.enabled=true"
})
properties
=
{
"spring.jmx.enabled=true"
})
@DirtiesContext
@DirtiesContext
public
class
HystrixStreamTests
{
public
class
HystrixStreamTests
{
...
...
spring-cloud-netflix-sidecar/pom.xml
View file @
73f33456
...
@@ -97,6 +97,11 @@
...
@@ -97,6 +97,11 @@
<optional>
true
</optional>
<optional>
true
</optional>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
<scope>
test
</scope>
...
...
spring-cloud-netflix-sidecar/src/test/java/org/springframework/cloud/netflix/sidecar/SidecarApplicationTests.java
View file @
73f33456
...
@@ -20,19 +20,19 @@ import org.junit.Test;
...
@@ -20,19 +20,19 @@ import org.junit.Test;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest.WebEnvironment
;
import
org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean
;
import
org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean
;
import
org.springframework.test.context.junit4.Spring
JUnit4Class
Runner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
hamcrest
.
Matchers
.
equalTo
;
import
static
org
.
hamcrest
.
Matchers
.
equalTo
;
import
static
org
.
junit
.
Assert
.
assertThat
;
import
static
org
.
junit
.
Assert
.
assertThat
;
import
static
org
.
springframework
.
boot
.
test
.
context
.
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
;
public
class
SidecarApplicationTests
{
public
class
SidecarApplicationTests
{
@RunWith
(
Spring
JUnit4Class
Runner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
SidecarApplication
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
value
=
{
@SpringBootTest
(
classes
=
SidecarApplication
.
class
,
webEnvironment
=
RANDOM_PORT
,
properties
=
{
"spring.application.name=mytest"
,
"spring.cloud.client.hostname=mhhost"
,
"spring.application.instance_id=1"
,
"spring.application.name=mytest"
,
"spring.cloud.client.hostname=mhhost"
,
"spring.application.instance_id=1"
,
"eureka.instance.hostname=mhhost"
,
"sidecar.port=7000"
,
"sidecar.ip
A
ddress=127.0.0.1"
})
"eureka.instance.hostname=mhhost"
,
"sidecar.port=7000"
,
"sidecar.ip
-a
ddress=127.0.0.1"
})
public
static
class
EurekaTestConfigBeanTest
{
public
static
class
EurekaTestConfigBeanTest
{
@Autowired
@Autowired
EurekaInstanceConfigBean
config
;
EurekaInstanceConfigBean
config
;
...
@@ -46,10 +46,10 @@ public class SidecarApplicationTests {
...
@@ -46,10 +46,10 @@ public class SidecarApplicationTests {
}
}
}
}
@RunWith
(
Spring
JUnit4Class
Runner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
SidecarApplication
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
value
=
{
@SpringBootTest
(
classes
=
SidecarApplication
.
class
,
webEnvironment
=
RANDOM_PORT
,
properties
=
{
"spring.application.name=mytest"
,
"spring.cloud.client.hostname=mhhost"
,
"spring.application.instance_id=1"
,
"spring.application.name=mytest"
,
"spring.cloud.client.hostname=mhhost"
,
"spring.application.instance_id=1"
,
"sidecar.hostname=mhhost"
,
"sidecar.port=7000"
,
"sidecar.ip
A
ddress=127.0.0.1"
})
"sidecar.hostname=mhhost"
,
"sidecar.port=7000"
,
"sidecar.ip
-a
ddress=127.0.0.1"
})
public
static
class
NewPropertyEurekaTestConfigBeanTest
{
public
static
class
NewPropertyEurekaTestConfigBeanTest
{
@Autowired
@Autowired
EurekaInstanceConfigBean
config
;
EurekaInstanceConfigBean
config
;
...
@@ -63,10 +63,10 @@ public class SidecarApplicationTests {
...
@@ -63,10 +63,10 @@ public class SidecarApplicationTests {
}
}
}
}
@RunWith
(
Spring
JUnit4Class
Runner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
SidecarApplication
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
value
=
{
@SpringBootTest
(
classes
=
SidecarApplication
.
class
,
webEnvironment
=
RANDOM_PORT
,
properties
=
{
"spring.application.name=mytest"
,
"spring.cloud.client.hostname=mhhost"
,
"spring.application.instance_id=1"
,
"spring.application.name=mytest"
,
"spring.cloud.client.hostname=mhhost"
,
"spring.application.instance_id=1"
,
"eureka.instance.hostname=mhhost1"
,
"sidecar.hostname=mhhost2"
,
"sidecar.port=7000"
,
"sidecar.ip
A
ddress=127.0.0.1"
})
"eureka.instance.hostname=mhhost1"
,
"sidecar.hostname=mhhost2"
,
"sidecar.port=7000"
,
"sidecar.ip
-a
ddress=127.0.0.1"
})
public
static
class
BothPropertiesEurekaTestConfigBeanTest
{
public
static
class
BothPropertiesEurekaTestConfigBeanTest
{
@Autowired
@Autowired
EurekaInstanceConfigBean
config
;
EurekaInstanceConfigBean
config
;
...
...
spring-cloud-netflix-turbine/pom.xml
View file @
73f33456
...
@@ -97,6 +97,11 @@
...
@@ -97,6 +97,11 @@
<optional>
true
</optional>
<optional>
true
</optional>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
<scope>
test
</scope>
...
...
spring-cloud-starter-archaius/pom.xml
View file @
73f33456
...
@@ -36,12 +36,6 @@
...
@@ -36,12 +36,6 @@
<dependency>
<dependency>
<groupId>
commons-configuration
</groupId>
<groupId>
commons-configuration
</groupId>
<artifactId>
commons-configuration
</artifactId>
<artifactId>
commons-configuration
</artifactId>
<exclusions>
<exclusion>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
<groupId>
com.fasterxml.jackson.core
</groupId>
...
...
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