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
7c62bd88
Unverified
Commit
7c62bd88
authored
Nov 27, 2017
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates for boot 2.0 compatibility
parent
ae34b773
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
HystrixOnlyTests.java
...ringframework/cloud/netflix/hystrix/HystrixOnlyTests.java
+6
-3
HystrixStreamEndpointTests.java
...ork/cloud/netflix/hystrix/HystrixStreamEndpointTests.java
+3
-2
No files found.
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/hystrix/HystrixOnlyTests.java
View file @
7c62bd88
...
...
@@ -23,9 +23,9 @@ import org.junit.Test;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
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.web.server.LocalServerPort
;
import
org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker
;
...
...
@@ -46,6 +46,7 @@ import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertFalse
;
import
static
org
.
springframework
.
boot
.
test
.
context
.
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
;
import
static
org
.
springframework
.
cloud
.
netflix
.
test
.
TestAutoConfiguration
.
PASSWORD
;
import
static
org
.
springframework
.
cloud
.
netflix
.
test
.
TestAutoConfiguration
.
USER
;
...
...
@@ -53,10 +54,12 @@ import static org.springframework.cloud.netflix.test.TestAutoConfiguration.USER;
* @author Spencer Gibb
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
HystrixOnlyApplication
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@SpringBootTest
(
classes
=
HystrixOnlyApplication
.
class
,
webEnvironment
=
RANDOM_PORT
,
properties
=
"management.endpoint.health.show-details=true"
)
@DirtiesContext
@ActiveProfiles
(
"proxysecurity"
)
public
class
HystrixOnlyTests
{
private
static
final
String
BASE_PATH
=
new
WebEndpointProperties
().
getBasePath
();
@LocalServerPort
private
int
port
;
...
...
@@ -96,7 +99,7 @@ public class HystrixOnlyTests {
private
Map
getHealth
()
{
return
new
TestRestTemplate
().
exchange
(
"http://localhost:"
+
this
.
port
+
"/application
/health"
,
HttpMethod
.
GET
,
"http://localhost:"
+
this
.
port
+
BASE_PATH
+
"
/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 @
7c62bd88
...
...
@@ -26,6 +26,7 @@ import org.apache.commons.logging.LogFactory;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest.WebEnvironment
;
...
...
@@ -56,7 +57,7 @@ import static org.junit.Assert.fail;
"spring.application.name=hystrixstreamtest"
})
@DirtiesContext
public
class
HystrixStreamEndpointTests
{
private
static
final
String
BASE_PATH
=
new
WebEndpointProperties
().
getBasePath
();
private
static
final
Log
log
=
LogFactory
.
getLog
(
HystrixStreamEndpointTests
.
class
);
@LocalServerPort
...
...
@@ -76,7 +77,7 @@ public class HystrixStreamEndpointTests {
String
.
class
);
assertEquals
(
"bad response code"
,
HttpStatus
.
OK
,
response
.
getStatusCode
());
URL
hystrixUrl
=
new
URL
(
url
+
"/application
/hystrix.stream"
);
URL
hystrixUrl
=
new
URL
(
url
+
BASE_PATH
+
"
/hystrix.stream"
);
List
<
String
>
data
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
...
...
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