Skip to content

Commit bb25685

Browse files
Update anchor id and add JUnit section into history docs
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
1 parent 84ddc0f commit bb25685

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

src/reference/antora/modules/ROOT/pages/appendix/previous-whats-new/changes-in-1-7-since-1-6.adoc

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The framework is no longer compatible with previous versions.
5151
== JUnit `@Rules`
5252

5353
Rules that have previously been used internally by the framework have now been made available in a separate jar called `spring-rabbit-junit`.
54-
See xref:testing.adoc#junit-rules[JUnit4 `@Rules`] for more information.
54+
See <<junit4-rules>> for more information.
5555

5656
[[container-conditional-rollback]]
5757
== Container Conditional Rollback
@@ -74,3 +74,32 @@ See xref:amqp/connections.adoc[Connection and Resource Management] for more info
7474
You can now configure message re-queue on transaction rollback to be consistent, regardless of whether or not a transaction manager is configured.
7575
See xref:amqp/transactions.adoc#transaction-rollback[A note on Rollback of Received Messages] for more information.
7676

77+
[[junit4-rules]]
78+
== JUnit4 `@Rules`
79+
80+
Spring AMQP version 1.7 and later provide an additional jar called `spring-rabbit-junit`.
81+
This jar contains a couple of utility `@Rule` instances for use when running JUnit4 tests.
82+
See xref:testing.adoc#junit5-conditions[JUnit5 Conditions] for JUnit5 testing.
83+
84+
[[using-brokerrunning]]
85+
=== Using `BrokerRunning`
86+
87+
`BrokerRunning` provides a mechanism to let tests succeed when a broker is not running (on `localhost`, by default).
88+
89+
It also has utility methods to initialize and empty queues and delete queues and exchanges.
90+
91+
The following example shows its usage:
92+
93+
[source, java]
94+
----
95+
96+
@ClassRule
97+
public static BrokerRunning brokerRunning = BrokerRunning.isRunningWithEmptyQueues("foo", "bar");
98+
99+
@AfterClass
100+
public static void tearDown() {
101+
brokerRunning.removeTestQueues("some.other.queue.too"); // removes foo, bar as well
102+
}
103+
----
104+
105+
There are several `isRunning...` static methods, such as `isBrokerAndManagementRunning()`, which verifies the broker has the management plugin enabled.

src/reference/antora/modules/ROOT/pages/appendix/previous-whats-new/changes-in-2-2-since-2-1.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ JUnit (4) is now an optional dependency and will no longer appear as a transitiv
2121

2222
The `spring-rabbit-junit` module is now a *compile* dependency in the `spring-rabbit-test` module for a better target application development experience when with only a single `spring-rabbit-test` we get the full stack of testing utilities for AMQP components.
2323

24-
[[-breaking-api-changes]]
24+
[[breaking-api-changes]]
2525
== "Breaking" API Changes
2626

2727
the JUnit (5) `RabbitAvailableCondition.getBrokerRunning()` now returns a `BrokerRunningSupport` instance instead of a `BrokerRunning`, which depends on JUnit 4.
@@ -87,7 +87,7 @@ See xref:logging.adoc[Logging Subsystem AMQP Appenders] for more information.
8787
The `MessageListenerAdapter` provides now a new `buildListenerArguments(Object, Channel, Message)` method to build an array of arguments to be passed into target listener and an old one is deprecated.
8888
See xref:amqp/receiving-messages/async-consumer.adoc#message-listener-adapter[`MessageListenerAdapter`] for more information.
8989

90-
[[exchange/queue-declaration-changes]]
90+
[[exchange-queue-declaration-changes]]
9191
== Exchange/Queue Declaration Changes
9292

9393
The `ExchangeBuilder` and `QueueBuilder` fluent APIs used to create `Exchange` and `Queue` objects for declaration by `RabbitAdmin` now support "well known" arguments.

0 commit comments

Comments
 (0)