File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
main/java/com/rabbitmq/model/amqp
test/java/com/rabbitmq/model/amqp Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -77,8 +77,8 @@ class AmqpConsumer extends ResourceBase implements Consumer {
77
77
this .nativeReceiver = createNativeReceiver (builder .connection ().nativeSession (), this .address );
78
78
this .initStateFromNativeReceiver (this .nativeReceiver );
79
79
this .connection = builder .connection ();
80
- this .startReceivingLoop ();
81
80
this .metricsCollector = this .connection .metricsCollector ();
81
+ this .startReceivingLoop ();
82
82
this .state (OPEN );
83
83
this .metricsCollector .openConsumer ();
84
84
}
Original file line number Diff line number Diff line change 21
21
import static com .rabbitmq .model .amqp .TestUtils .waitAtMost ;
22
22
import static com .rabbitmq .model .metrics .MetricsCollector .ConsumeDisposition .*;
23
23
import static com .rabbitmq .model .metrics .MetricsCollector .PublishDisposition .FAILED ;
24
+ import static java .lang .String .format ;
24
25
import static org .mockito .ArgumentMatchers .any ;
25
26
import static org .mockito .Mockito .*;
26
27
@@ -151,7 +152,9 @@ void metricsShouldBeCollected() throws Exception {
151
152
consumedCount .incrementAndGet ();
152
153
})
153
154
.build ();
154
- waitAtMost (() -> consumedCount .get () == 1 );
155
+ waitAtMost (
156
+ () -> consumedCount .get () == 1 ,
157
+ () -> format ("Expected 1 message, but got %d." , consumedCount .get ()));
155
158
// the first message is accepted
156
159
verify (metricsCollector , times (1 )).consume ();
157
160
verify (metricsCollector , times (1 ))
You can’t perform that action at this time.
0 commit comments