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
388ec980
Unverified
Commit
388ec980
authored
Oct 30, 2017
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates for changes to boot 2
parent
2be1fb51
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
29 additions
and
37 deletions
+29
-37
HystrixManagementContextConfiguration.java
...etflix/hystrix/HystrixManagementContextConfiguration.java
+2
-2
HystrixOnlyTests.java
...ringframework/cloud/netflix/hystrix/HystrixOnlyTests.java
+1
-1
HystrixStreamEndpointTests.java
...ork/cloud/netflix/hystrix/HystrixStreamEndpointTests.java
+1
-1
TestAutoConfiguration.java
...ngframework/cloud/netflix/test/TestAutoConfiguration.java
+1
-1
application.yml
spring-cloud-netflix-core/src/test/resources/application.yml
+0
-2
EurekaServerMockApplication.java
...loud/netflix/eureka/http/EurekaServerMockApplication.java
+1
-1
pom.xml
spring-cloud-netflix-eureka-server/pom.xml
+0
-6
AbstractDocumentationTests.java
...netflix/eureka/server/doc/AbstractDocumentationTests.java
+8
-8
EurekaObjectMapper.java
...k/cloud/netflix/eureka/server/doc/EurekaObjectMapper.java
+3
-3
RequestVerifierFilter.java
...loud/netflix/eureka/server/doc/RequestVerifierFilter.java
+9
-9
RoutesEndpointIntegrationTests.java
...rk/cloud/netflix/zuul/RoutesEndpointIntegrationTests.java
+3
-3
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixManagementContextConfiguration.java
View file @
388ec980
...
...
@@ -16,7 +16,6 @@
package
org
.
springframework
.
cloud
.
netflix
.
hystrix
;
import
com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect
;
import
org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.web.servlet.ManagementServletContext
;
import
org.springframework.boot.actuate.health.Health
;
...
...
@@ -29,6 +28,7 @@ import org.springframework.boot.web.servlet.ServletRegistrationBean;
import
org.springframework.cloud.client.actuator.HasFeatures
;
import
org.springframework.context.annotation.Bean
;
import
com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect
;
import
com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet
;
/**
...
...
@@ -55,7 +55,7 @@ class HystrixManagementContextConfiguration {
@Bean
public
ServletRegistrationBean
<
HystrixMetricsStreamServlet
>
hystrixMetricsStreamServlet
()
{
String
path
=
this
.
managementServletContext
.
get
Contex
tPath
()
String
path
=
this
.
managementServletContext
.
get
Servle
tPath
()
+
this
.
properties
.
getPath
();
String
urlMapping
=
(
path
.
endsWith
(
"/"
)
?
path
+
"*"
:
path
+
"/*"
);
ServletRegistrationBean
<
HystrixMetricsStreamServlet
>
registration
=
new
ServletRegistrationBean
<>(
...
...
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/hystrix/HystrixOnlyTests.java
View file @
388ec980
...
...
@@ -96,7 +96,7 @@ public class HystrixOnlyTests {
private
Map
getHealth
()
{
return
new
TestRestTemplate
().
exchange
(
"http://localhost:"
+
this
.
port
+
"/a
dmi
n/health"
,
HttpMethod
.
GET
,
"http://localhost:"
+
this
.
port
+
"/a
pplicatio
n/health"
,
HttpMethod
.
GET
,
new
HttpEntity
<
Void
>(
createBasicAuthHeader
(
USER
,
PASSWORD
)),
Map
.
class
).
getBody
();
}
...
...
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/hystrix/HystrixStreamEndpointTests.java
View file @
388ec980
...
...
@@ -76,7 +76,7 @@ public class HystrixStreamEndpointTests {
String
.
class
);
assertEquals
(
"bad response code"
,
HttpStatus
.
OK
,
response
.
getStatusCode
());
URL
hystrixUrl
=
new
URL
(
url
+
"/a
dmi
n/hystrix.stream"
);
URL
hystrixUrl
=
new
URL
(
url
+
"/a
pplicatio
n/hystrix.stream"
);
List
<
String
>
data
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
...
...
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/test/TestAutoConfiguration.java
View file @
388ec980
...
...
@@ -39,7 +39,7 @@ import org.springframework.security.provisioning.InMemoryUserDetailsManager;
public
class
TestAutoConfiguration
{
public
static
final
String
USER
=
"user"
;
public
static
final
String
PASSWORD
=
"password"
;
public
static
final
String
PASSWORD
=
"
{noop}
password"
;
@Configuration
@Order
(
Ordered
.
HIGHEST_PRECEDENCE
)
...
...
spring-cloud-netflix-core/src/test/resources/application.yml
View file @
388ec980
...
...
@@ -35,8 +35,6 @@ badClients:
ribbon
:
MaxAutoRetriesNextServer
:
10
ReadTimeout
:
200
management
:
context-path
:
/admin
endpoints
:
health
:
sensitive
:
false
...
...
spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/http/EurekaServerMockApplication.java
View file @
388ec980
...
...
@@ -142,7 +142,7 @@ public class EurekaServerMockApplication {
@Bean
public
UserDetailsService
userDetailsService
()
{
InMemoryUserDetailsManager
manager
=
new
InMemoryUserDetailsManager
();
manager
.
createUser
(
User
.
withUsername
(
"test"
).
password
(
"test"
).
roles
(
"USER"
).
build
());
manager
.
createUser
(
User
.
withUsername
(
"test"
).
password
(
"
{noop}
test"
).
roles
(
"USER"
).
build
());
return
manager
;
}
...
...
spring-cloud-netflix-eureka-server/pom.xml
View file @
388ec980
...
...
@@ -104,12 +104,6 @@
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
com.jayway.restassured
</groupId>
<artifactId>
rest-assured
</artifactId>
<scope>
test
</scope>
<version>
2.8.0
</version>
</dependency>
<dependency>
<groupId>
org.springframework.restdocs
</groupId>
<artifactId>
spring-restdocs-restassured
</artifactId>
<scope>
test
</scope>
...
...
spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/doc/AbstractDocumentationTests.java
View file @
388ec980
...
...
@@ -18,14 +18,14 @@ package org.springframework.cloud.netflix.eureka.server.doc;
import
java.util.UUID
;
import
com.jayway.restassured.RestAssured
;
import
com.jayway.restassured.builder.RequestSpecBuilder
;
import
com.jayway.restassured.filter.Filter
;
import
com.jayway.restassured.specification.RequestSpecification
;
import
com.netflix.appinfo.ApplicationInfoManager
;
import
com.netflix.appinfo.InstanceInfo
;
import
com.netflix.eureka.registry.PeerAwareInstanceRegistryImpl
;
import
io.restassured.RestAssured
;
import
io.restassured.builder.RequestSpecBuilder
;
import
io.restassured.filter.Filter
;
import
io.restassured.specification.RequestSpecification
;
import
org.junit.After
;
import
org.junit.Rule
;
import
org.junit.runner.RunWith
;
...
...
@@ -42,8 +42,8 @@ import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
import
org.springframework.cloud.netflix.eureka.server.doc.AbstractDocumentationTests.Application
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.restdocs.JUnitRestDocumentation
;
import
org.springframework.restdocs.restassured.RestAssuredRestDocumentation
;
import
org.springframework.restdocs.restassured.RestDocumentationFilter
;
import
org.springframework.restdocs.restassured
3
.RestAssuredRestDocumentation
;
import
org.springframework.restdocs.restassured
3
.RestDocumentationFilter
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.util.ReflectionTestUtils
;
...
...
@@ -51,8 +51,8 @@ import org.springframework.test.util.ReflectionTestUtils;
import
static
org
.
springframework
.
restdocs
.
operation
.
preprocess
.
Preprocessors
.
preprocessRequest
;
import
static
org
.
springframework
.
restdocs
.
operation
.
preprocess
.
Preprocessors
.
preprocessResponse
;
import
static
org
.
springframework
.
restdocs
.
operation
.
preprocess
.
Preprocessors
.
prettyPrint
;
import
static
org
.
springframework
.
restdocs
.
restassured
.
RestAssuredRestDocumentation
.
documentationConfiguration
;
import
static
org
.
springframework
.
restdocs
.
restassured
.
operation
.
preprocess
.
RestAssuredPreprocessors
.
modifyUris
;
import
static
org
.
springframework
.
restdocs
.
restassured
3
.
RestAssuredRestDocumentation
.
documentationConfiguration
;
import
static
org
.
springframework
.
restdocs
.
restassured
3
.
operation
.
preprocess
.
RestAssuredPreprocessors
.
modifyUris
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
value
=
{
...
...
spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/doc/EurekaObjectMapper.java
View file @
388ec980
...
...
@@ -20,12 +20,12 @@ import java.io.IOException;
import
javax.ws.rs.core.MediaType
;
import
com.jayway.restassured.mapper.ObjectMapperDeserializationContext
;
import
com.jayway.restassured.mapper.ObjectMapperSerializationContext
;
import
com.netflix.discovery.converters.EntityBodyConverter
;
import
io.restassured.mapper.ObjectMapperDeserializationContext
;
import
io.restassured.mapper.ObjectMapperSerializationContext
;
final
class
EurekaObjectMapper
implements
com
.
jayway
.
restassured
.
mapper
.
ObjectMapper
{
implements
io
.
restassured
.
mapper
.
ObjectMapper
{
private
EntityBodyConverter
converter
=
new
EntityBodyConverter
();
@Override
...
...
spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/doc/RequestVerifierFilter.java
View file @
388ec980
...
...
@@ -35,13 +35,13 @@ import com.github.tomakehurst.wiremock.http.RequestMethod;
import
com.github.tomakehurst.wiremock.matching.MatchResult
;
import
com.github.tomakehurst.wiremock.stubbing.StubMapping
;
import
com.jayway.jsonpath.JsonPath
;
import
com.jayway.restassured.filter.Filter
;
import
com.jayway.restassured.filter.FilterContext
;
import
com.jayway.restassured.response.Header
;
import
com.jayway.restassured.response.Response
;
import
com.jayway.restassured.specification.FilterableRequestSpecification
;
import
com.jayway.restassured.specification.FilterableResponseSpecification
;
import
io.restassured.filter.Filter
;
import
io.restassured.filter.FilterContext
;
import
io.restassured.http.Header
;
import
io.restassured.response.Response
;
import
io.restassured.specification.FilterableRequestSpecification
;
import
io.restassured.specification.FilterableResponseSpecification
;
import
org.springframework.util.Base64Utils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
...
...
@@ -87,7 +87,7 @@ public class RequestVerifierFilter implements Filter {
@Override
public
Response
filter
(
FilterableRequestSpecification
requestSpec
,
FilterableResponseSpecification
responseSpec
,
FilterContext
context
)
{
FilterableResponseSpecification
responseSpec
,
FilterContext
context
)
{
Map
<
String
,
Object
>
configuration
=
getConfiguration
(
requestSpec
,
context
);
configuration
.
put
(
"contract.jsonPaths"
,
this
.
jsonPaths
.
keySet
());
Response
response
=
context
.
next
(
requestSpec
,
responseSpec
);
...
...
@@ -213,7 +213,7 @@ class WireMockRestAssuredRequestAdapter implements Request {
@Override
public
RequestMethod
getMethod
()
{
return
RequestMethod
.
fromString
(
request
.
getMethod
()
.
name
()
);
return
RequestMethod
.
fromString
(
request
.
getMethod
());
}
@Override
...
...
@@ -282,7 +282,7 @@ class WireMockRestAssuredRequestAdapter implements Request {
@Override
public
Map
<
String
,
Cookie
>
getCookies
()
{
Map
<
String
,
Cookie
>
map
=
new
LinkedHashMap
<>();
for
(
com
.
jayway
.
restassured
.
response
.
Cookie
cookie
:
request
.
getCookies
())
{
for
(
io
.
restassured
.
http
.
Cookie
cookie
:
request
.
getCookies
())
{
Cookie
value
=
new
Cookie
(
cookie
.
getValue
());
map
.
put
(
cookie
.
getName
(),
value
);
}
...
...
spring-cloud-netflix-zuul/src/test/java/org/springframework/cloud/netflix/zuul/RoutesEndpointIntegrationTests.java
View file @
388ec980
...
...
@@ -63,13 +63,13 @@ public class RoutesEndpointIntegrationTests {
@Test
public
void
getRoutesTest
()
{
Map
<
String
,
String
>
routes
=
restTemplate
.
getForObject
(
"/a
dmi
n/routes"
,
Map
.
class
);
Map
<
String
,
String
>
routes
=
restTemplate
.
getForObject
(
"/a
pplicatio
n/routes"
,
Map
.
class
);
assertEquals
(
"https://localhost:8443"
,
routes
.
get
(
"/sslservice/**"
));
}
@Test
public
void
postRoutesTest
()
{
Map
<
String
,
String
>
routes
=
restTemplate
.
postForObject
(
"/a
dmi
n/routes"
,
null
,
Map
.
class
);
Map
<
String
,
String
>
routes
=
restTemplate
.
postForObject
(
"/a
pplicatio
n/routes"
,
null
,
Map
.
class
);
assertEquals
(
"https://localhost:8443"
,
routes
.
get
(
"/sslservice/**"
));
assertTrue
(
refreshListener
.
wasCalled
());
}
...
...
@@ -77,7 +77,7 @@ public class RoutesEndpointIntegrationTests {
@Test
public
void
getRouteDetailsTest
()
{
ResponseEntity
<
Map
<
String
,
RoutesEndpoint
.
RouteDetails
>>
responseEntity
=
restTemplate
.
exchange
(
"/a
dmi
n/routes/details"
,
HttpMethod
.
GET
,
null
,
new
ParameterizedTypeReference
<
Map
<
String
,
RoutesEndpoint
.
RouteDetails
>>()
{
"/a
pplicatio
n/routes/details"
,
HttpMethod
.
GET
,
null
,
new
ParameterizedTypeReference
<
Map
<
String
,
RoutesEndpoint
.
RouteDetails
>>()
{
});
assertThat
(
responseEntity
.
getStatusCode
(),
is
(
HttpStatus
.
OK
));
...
...
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