Skip to content

Commit c45ad73

Browse files
committed
#354 | Declare the exchange and wait until unrouted
1 parent 3f546aa commit c45ad73

File tree

1 file changed

+5
-1
lines changed
  • src/test/java/com/rabbitmq/client/test/functional

1 file changed

+5
-1
lines changed

src/test/java/com/rabbitmq/client/test/functional/Metrics.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,18 @@ protected void releaseResources() throws IOException {
150150
channel.confirmSelect();
151151
assertThat(metrics.getPublishUnroutedMessages().getCount(), is(1L));
152152
// when
153+
channel.exchangeDeclare("any-exchange", "direct");
153154
channel.basicPublish(
154155
"any-exchange",
155156
"any-routing-key",
156157
MessageProperties.MINIMAL_BASIC,
157158
"any-message".getBytes()
158159
);
159-
channel.waitForConfirms(30 * 60 * 1000);
160160
// then
161+
waitAtMost(timeout()).until(
162+
() -> metrics.getPublishUnroutedMessages().getCount(),
163+
equalTo(1L)
164+
);
161165
assertThat(metrics.getPublishUnroutedMessages().getCount(), is(1L));
162166
} finally {
163167
safeClose(connection);

0 commit comments

Comments
 (0)