Skip to content

Commit b3d2733

Browse files
committed
#354 | Fix pre-condition
1 parent d859205 commit b3d2733

File tree

1 file changed

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

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,20 +140,19 @@ protected void releaseResources() throws IOException {
140140
}
141141
}
142142

143-
@Test public void metricsPublisherUnrouted() throws IOException, TimeoutException, InterruptedException {
143+
@Test public void metricsPublisherUnrouted() throws IOException, TimeoutException {
144144
StandardMetricsCollector metrics = new StandardMetricsCollector();
145145
connectionFactory.setMetricsCollector(metrics);
146146
Connection connection = null;
147147
try {
148148
connection = connectionFactory.newConnection();
149149
Channel channel = connection.createChannel();
150150
channel.confirmSelect();
151-
assertThat(metrics.getPublishUnroutedMessages().getCount(), is(1L));
151+
assertThat(metrics.getPublishUnroutedMessages().getCount(), is(0L));
152152
// when
153-
channel.exchangeDeclare("any-exchange", "direct");
154153
channel.basicPublish(
155-
"any-exchange",
156-
"any-routing-key",
154+
"amq.direct",
155+
"any-unroutable-routing-key",
157156
/* basic.return will be sent back only if the message is mandatory */ true,
158157
MessageProperties.MINIMAL_BASIC,
159158
"any-message".getBytes()

0 commit comments

Comments
 (0)