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
c3475f19
Commit
c3475f19
authored
Jan 26, 2018
by
Ryan Baxter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failing unit test
parent
f7e5b7f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
FeignHttpClientUrlTests.java
...ramework/cloud/netflix/feign/FeignHttpClientUrlTests.java
+5
-6
No files found.
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/feign/FeignHttpClientUrlTests.java
View file @
c3475f19
...
...
@@ -31,14 +31,13 @@ import org.junit.BeforeClass;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest.WebEnvironment
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.Spring
JUnit4Class
Runner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.util.ReflectionUtils
;
import
org.springframework.util.SocketUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -53,16 +52,18 @@ import feign.httpclient.ApacheHttpClient;
/**
* @author Spencer Gibb
*/
@RunWith
(
Spring
JUnit4Class
Runner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
FeignHttpClientUrlTests
.
TestConfig
.
class
,
webEnvironment
=
WebEnvironment
.
DEFINED_PORT
,
value
=
{
"spring.application.name=feignclienturltest"
,
"feign.hystrix.enabled=false"
,
"feign.okhttp.enabled=false"
})
@DirtiesContext
public
class
FeignHttpClientUrlTests
{
static
int
port
;
@BeforeClass
public
static
void
beforeClass
()
{
int
port
=
SocketUtils
.
findAvailableTcpPort
();
port
=
SocketUtils
.
findAvailableTcpPort
();
System
.
setProperty
(
"server.port"
,
String
.
valueOf
(
port
));
}
...
...
@@ -103,8 +104,6 @@ public class FeignHttpClientUrlTests {
@RestController
@EnableFeignClients
(
clients
=
{
UrlClient
.
class
,
BeanUrlClient
.
class
,
BeanUrlClientNoProtocol
.
class
})
protected
static
class
TestConfig
{
@Value
(
"${server.port}"
)
private
int
port
;
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/hello"
)
public
Hello
getHello
()
{
...
...
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