Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
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
DEMO
spring-boot
Commits
75aebfaf
Commit
75aebfaf
authored
Jul 18, 2017
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix WebClientAutoConfigurationTests
Update tests to return a mock response rather than Mono.empty().
parent
ece246db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
WebClientAutoConfigurationTests.java
...tive/function/client/WebClientAutoConfigurationTests.java
+6
-2
No files found.
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/function/client/WebClientAutoConfigurationTests.java
View file @
75aebfaf
...
...
@@ -29,6 +29,7 @@ import org.springframework.context.annotation.Bean;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.client.reactive.ClientHttpConnector
;
import
org.springframework.http.client.reactive.ClientHttpResponse
;
import
org.springframework.http.codec.CodecConfigurer
;
import
org.springframework.web.reactive.function.client.WebClient
;
...
...
@@ -80,12 +81,15 @@ public class WebClientAutoConfigurationTests {
@Test
public
void
shouldGetPrototypeScopedBean
()
throws
Exception
{
load
(
WebClientCustomizerConfig
.
class
);
ClientHttpResponse
response
=
mock
(
ClientHttpResponse
.
class
);
ClientHttpConnector
firstConnector
=
mock
(
ClientHttpConnector
.
class
);
given
(
firstConnector
.
connect
(
any
(),
any
(),
any
())).
willReturn
(
Mono
.
empty
());
given
(
firstConnector
.
connect
(
any
(),
any
(),
any
()))
.
willReturn
(
Mono
.
just
(
response
));
WebClient
.
Builder
firstBuilder
=
this
.
context
.
getBean
(
WebClient
.
Builder
.
class
);
firstBuilder
.
clientConnector
(
firstConnector
).
baseUrl
(
"http://first.example.org"
);
ClientHttpConnector
secondConnector
=
mock
(
ClientHttpConnector
.
class
);
given
(
secondConnector
.
connect
(
any
(),
any
(),
any
())).
willReturn
(
Mono
.
empty
());
given
(
secondConnector
.
connect
(
any
(),
any
(),
any
()))
.
willReturn
(
Mono
.
just
(
response
));
WebClient
.
Builder
secondBuilder
=
this
.
context
.
getBean
(
WebClient
.
Builder
.
class
);
secondBuilder
.
clientConnector
(
secondConnector
)
.
baseUrl
(
"http://second.example.org"
);
...
...
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