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
5a170818
Unverified
Commit
5a170818
authored
Oct 30, 2017
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix removal of getLocalServiceInstance()
parent
35e2af77
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
HystrixStreamAutoConfiguration.java
...etflix/hystrix/stream/HystrixStreamAutoConfiguration.java
+3
-2
HystrixStreamAutoConfigurationNoRegistrationTests.java
...am/HystrixStreamAutoConfigurationNoRegistrationTests.java
+4
-3
No files found.
spring-cloud-netflix-hystrix-stream/src/main/java/org/springframework/cloud/netflix/hystrix/stream/HystrixStreamAutoConfiguration.java
View file @
5a170818
...
...
@@ -26,6 +26,7 @@ import org.springframework.cloud.client.ServiceInstance;
import
org.springframework.cloud.client.actuator.HasFeatures
;
import
org.springframework.cloud.client.discovery.DiscoveryClient
;
import
org.springframework.cloud.client.discovery.simple.SimpleDiscoveryClient
;
import
org.springframework.cloud.client.discovery.simple.SimpleDiscoveryProperties
;
import
org.springframework.cloud.client.serviceregistry.Registration
;
import
org.springframework.cloud.stream.annotation.EnableBinding
;
import
org.springframework.cloud.stream.annotation.Output
;
...
...
@@ -100,10 +101,10 @@ public class HystrixStreamAutoConfiguration {
}
@Bean
public
HystrixStreamTask
hystrixStreamTask
(
SimpleDiscovery
Client
simpleDiscoveryClient
)
{
public
HystrixStreamTask
hystrixStreamTask
(
SimpleDiscovery
Properties
simpleDiscoveryProperties
)
{
ServiceInstance
serviceInstance
=
this
.
registration
;
if
(
serviceInstance
==
null
)
{
serviceInstance
=
simpleDiscovery
Client
.
getLocalServiceInstance
();
serviceInstance
=
simpleDiscovery
Properties
.
getLocal
();
}
return
new
HystrixStreamTask
(
this
.
outboundChannel
,
serviceInstance
,
this
.
properties
);
...
...
spring-cloud-netflix-hystrix-stream/src/test/java/org/springframework/cloud/netflix/hystrix/stream/HystrixStreamAutoConfigurationNoRegistrationTests.java
View file @
5a170818
...
...
@@ -23,6 +23,7 @@ import org.springframework.boot.SpringBootConfiguration;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.cloud.client.discovery.simple.SimpleDiscoveryClient
;
import
org.springframework.cloud.client.discovery.simple.SimpleDiscoveryProperties
;
import
org.springframework.cloud.client.serviceregistry.Registration
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
...
...
@@ -44,13 +45,13 @@ public class HystrixStreamAutoConfigurationNoRegistrationTests {
Registration
registration
;
@Autowired
SimpleDiscovery
Client
simpleDiscoveryClient
;
SimpleDiscovery
Properties
simpleDiscoveryProperties
;
@Test
public
void
withoutRegistrationWorks
()
throws
Exception
{
assertThat
(
this
.
registration
).
isNull
();
assertThat
(
this
.
simpleDiscovery
Client
).
isNotNull
();
assertThat
(
task
.
getRegistration
()).
isEqualTo
(
this
.
simpleDiscovery
Client
.
getLocalServiceInstance
());
assertThat
(
this
.
simpleDiscovery
Properties
).
isNotNull
();
assertThat
(
task
.
getRegistration
()).
isEqualTo
(
this
.
simpleDiscovery
Properties
.
getLocal
());
}
@EnableAutoConfiguration
...
...
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