Skip to content

Commit

Permalink
Add before test support in order to purge JMS queues
Browse files Browse the repository at this point in the history
  • Loading branch information
christophd committed Mar 15, 2017
1 parent bee26b7 commit a835e0d
Showing 1 changed file with 16 additions and 0 deletions.
Expand Up @@ -17,6 +17,8 @@
package com.consol.citrus.demo.voting;

import com.consol.citrus.dsl.endpoint.CitrusEndpoints;
import com.consol.citrus.dsl.runner.TestRunner;
import com.consol.citrus.dsl.runner.TestRunnerBeforeTestSupport;
import com.consol.citrus.http.client.HttpClient;
import com.consol.citrus.jms.endpoint.JmsEndpoint;
import com.consol.citrus.mail.server.MailServer;
Expand Down Expand Up @@ -83,4 +85,18 @@ public MailServer mailServer() {
.autoAccept(true)
.build();
}

@Bean
public TestRunnerBeforeTestSupport beforeTest() {
return new TestRunnerBeforeTestSupport() {
@Override
public void beforeTest(TestRunner runner) {
runner.purgeQueues(action -> action
.connectionFactory(connectionFactory())
.queue("jms.voting.create")
.queue("jms.voting.report")
.queue("jms.voting.inbound"));
}
};
}
}

0 comments on commit a835e0d

Please sign in to comment.