@After public void tearDown() { brokerIsRunning.deleteExchanges("si.fanout.foo", "si.fanout.channel", "si.fanout.pubSubWithEP"); brokerIsRunning.removeTestQueues(); }
@AfterAll public static void tearDown(ConfigurableApplicationContext context) { context.stop(); // prevent queues from being redeclared after deletion RabbitAvailableCondition.getBrokerRunning().removeTestQueues("si.dsl.exception.test", "si.dsl.conv.exception.test"); }
@AfterClass public static void afterClass() { brokerRunning.removeTestQueues(QUEUE_WITH_DLQ); }
@Bean public ConnectionFactory connectionFactory() { return new CachingConnectionFactory(brokerRunning.getConnectionFactory()); }
/** * @param queues the queues. * @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) { return new BrokerRunning(true, false, true, queues); }
@RabbitAvailable(queues = BoundRabbitChannelAdviceIntegrationTests.QUEUE) public class BoundRabbitChannelAdviceIntegrationTests {
private BrokerRunning(boolean assumeOnline, boolean purge, boolean management, String... queues) { this.assumeOnline = assumeOnline; this.queues = queues; this.purge = purge; this.management = management; setPort(this.defaultPort); }
/** * @author Gary Russell * @since 2.0.2 * */ @LongRunning("LongRunningIntegrationTestsConditionTests") public class LongRunningIntegrationTestsConditionTests { @Test public void test() { } }
@AfterClass public static void tearDown() { brokerRunning.removeTestQueues(); }
/** * Ensure the broker is running and has a empty queue(s) with the specified name(s) in the * default exchange. * * @param names the queues to declare for the test. * @return a new rule that assumes an existing running broker */ public static BrokerRunning isRunningWithEmptyQueues(String... names) { return new BrokerRunning(true, true, names); }
@RabbitAvailable(queues = { "amqpOutboundInput", "amqpReplyChannel", "asyncReplies", "defaultReplyTo", "si.dsl.test", "si.dsl.exception.test.dlq", "si.dsl.conv.exception.test.dlq", "testTemplateChannelTransacted" })
private BrokerRunning(boolean assumeOnline, boolean purge, boolean management, String... queues) { this.assumeOnline = assumeOnline; this.queues = queues; this.purge = purge; this.management = management; setPort(this.defaultPort); }
@After public void tearDown() { this.brokerRunning.removeTestQueues(); ((CachingConnectionFactory) this.rabbitTemplate.getConnectionFactory()).destroy(); }
/** * @return a new rule that assumes an existing running broker */ public static BrokerRunning isRunning() { return new BrokerRunning(true); }
@Override public void afterTestClass(TestContext testContext) throws Exception { brokerRunning.removeTestQueues("sendTo.replies", "sendTo.replies.spel"); }
/** * @return a new rule that assumes there is no existing broker */ public static BrokerRunning isNotRunning() { return new BrokerRunning(false); }
/** * @return a new rule that assumes an existing broker with the management plugin */ public static BrokerRunning isBrokerAndManagementRunning() { return new BrokerRunning(true, false, true); }
/** * Ensure the broker is running and has a empty queue(s) with the specified name(s) in the * default exchange. * * @param names the queues to declare for the test. * @return a new rule that assumes an existing running broker */ public static BrokerRunning isRunningWithEmptyQueues(String... names) { return new BrokerRunning(true, true, names); }
/** * @return a new rule that assumes an existing broker with the management plugin */ public static BrokerRunning isBrokerAndManagementRunning() { return new BrokerRunning(true, false, true); }
/** * @param queues the queues. * @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) { return new BrokerRunning(true, false, true, queues); }