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
7d994e60
Commit
7d994e60
authored
Aug 24, 2019
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restructure tests to exercise deprecated property in a dedicated test
See gh-17848
parent
21783fae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
18 deletions
+19
-18
RabbitAutoConfigurationTests.java
...boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java
+19
-18
No files found.
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java
View file @
7d994e60
...
...
@@ -199,41 +199,42 @@ class RabbitAutoConfigurationTests {
}
@Test
void
testConnectionFactoryPublisherSettings
()
{
@Deprecated
void
testConnectionFactoryPublisherConfirmTypeUsingDeprecatedProperty
()
{
this
.
contextRunner
.
withUserConfiguration
(
TestConfiguration
.
class
)
.
withPropertyValues
(
"spring.rabbitmq.publisher-confirms=true"
,
"spring.rabbitmq.publisher-returns=true"
)
.
run
((
context
)
->
{
.
withPropertyValues
(
"spring.rabbitmq.publisher-confirms=true"
).
run
((
context
)
->
{
CachingConnectionFactory
connectionFactory
=
context
.
getBean
(
CachingConnectionFactory
.
class
);
RabbitTemplate
rabbitTemplate
=
context
.
getBean
(
RabbitTemplate
.
class
);
assertThat
(
connectionFactory
.
isPublisherConfirms
()).
isTrue
();
assertThat
(
connectionFactory
.
isPublisherReturns
()).
isTrue
();
assertThat
(
getMandatory
(
rabbitTemplate
)).
isTrue
();
assertThat
(
connectionFactory
.
isSimplePublisherConfirms
()).
isFalse
();
});
}
@Test
void
testConnectionFactor
PublisherSettingsUsingConfirmType
()
{
void
testConnectionFactor
yPublisherConfirmTypeCorrelated
()
{
this
.
contextRunner
.
withUserConfiguration
(
TestConfiguration
.
class
)
.
withPropertyValues
(
"spring.rabbitmq.publisher-confirm-type=correlated"
,
"spring.rabbitmq.publisher-returns=true"
)
.
run
((
context
)
->
{
.
withPropertyValues
(
"spring.rabbitmq.publisher-confirm-type=correlated"
).
run
((
context
)
->
{
CachingConnectionFactory
connectionFactory
=
context
.
getBean
(
CachingConnectionFactory
.
class
);
RabbitTemplate
rabbitTemplate
=
context
.
getBean
(
RabbitTemplate
.
class
);
assertThat
(
connectionFactory
.
isPublisherConfirms
()).
isTrue
();
assertThat
(
connectionFactory
.
isPublisherReturns
()).
isTrue
();
assertThat
(
getMandatory
(
rabbitTemplate
)).
isTrue
();
assertThat
(
connectionFactory
.
isSimplePublisherConfirms
()).
isFalse
();
});
}
@Test
void
testConnectionFactory
SimplePublisherSettingsUsingConfirmTyp
e
()
{
void
testConnectionFactory
PublisherConfirmTypeSimpl
e
()
{
this
.
contextRunner
.
withUserConfiguration
(
TestConfiguration
.
class
)
.
withPropertyValues
(
"spring.rabbitmq.publisher-confirm-type=simple"
,
"spring.rabbitmq.publisher-returns=true"
)
.
run
((
context
)
->
{
.
withPropertyValues
(
"spring.rabbitmq.publisher-confirm-type=simple"
).
run
((
context
)
->
{
CachingConnectionFactory
connectionFactory
=
context
.
getBean
(
CachingConnectionFactory
.
class
);
RabbitTemplate
rabbitTemplate
=
context
.
getBean
(
RabbitTemplate
.
class
);
assertThat
(
connectionFactory
.
isPublisherConfirms
()).
isFalse
(
);
assertThat
(
connectionFactory
.
isSimplePublisherConfirms
()).
isTrue
();
});
}
@Test
void
testConnectionFactoryPublisherReturns
()
{
this
.
contextRunner
.
withUserConfiguration
(
TestConfiguration
.
class
)
.
withPropertyValues
(
"spring.rabbitmq.publisher-returns=true"
).
run
((
context
)
->
{
CachingConnectionFactory
connectionFactory
=
context
.
getBean
(
CachingConnectionFactory
.
class
);
RabbitTemplate
rabbitTemplate
=
context
.
getBean
(
RabbitTemplate
.
class
);
assertThat
(
connectionFactory
.
isPublisherReturns
()).
isTrue
();
assertThat
(
getMandatory
(
rabbitTemplate
)).
isTrue
();
});
...
...
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