Skip to content

Commit

Permalink
Fix BrokerRunning for skipping tests
Browse files Browse the repository at this point in the history
The regression after #1190

The `assumeNoException(e)` was missed in the `BrokerRunning`
when we don't have a locally ran RabbitMQ and no requirement.
With the `assumeNoException(e)` test are skipped with positive
outcome

**Cherry-pick to `2.2.x`**
  • Loading branch information
artembilan committed May 26, 2020
1 parent fd61adc commit 4ac89e4
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -17,6 +17,7 @@
package org.springframework.amqp.rabbit.junit;

import static org.junit.Assert.fail;
import static org.junit.Assume.assumeNoException;

import java.util.Map;

Expand Down Expand Up @@ -58,9 +59,10 @@
*
* @author Dave Syer
* @author Gary Russell
* @author Artem Bilan
*
* @since 1.7
* @see org.junit.internal.AssumptionViolatedException
*
*/
public final class BrokerRunning extends TestWatcher {

Expand Down Expand Up @@ -125,7 +127,7 @@ public static BrokerRunning isBrokerAndManagementRunning() {
* @return a new rule that assumes an existing broker with the management plugin with
* the provided queues declared (and emptied if needed)..
*/
public static BrokerRunning isBrokerAndManagementRunningWithEmptyQueues(String...queues) {
public static BrokerRunning isBrokerAndManagementRunningWithEmptyQueues(String... queues) {
return new BrokerRunning(true, true, queues);
}

Expand Down Expand Up @@ -272,6 +274,9 @@ public Statement apply(Statement base, Description description) {
if (fatal()) {
fail("RabbitMQ Broker is required, but not available");
}
else {
assumeNoException(e);
}
}
return super.apply(base, description);
}
Expand Down

0 comments on commit 4ac89e4

Please sign in to comment.