Skip to content

Commit

Permalink
stabilize AmqpConsumerActorTest
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
  • Loading branch information
dguggemos committed Sep 9, 2021
1 parent 81420c2 commit ffeb70b
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -460,16 +460,18 @@ public void closedMessageConsumerIsRecreatedAfterBackoffAndResourceStatusIsUpdat
final ModifyThing modifyThingViaNewConsumer = proxyActor.expectMsgClass(ModifyThing.class);
assertThat((CharSequence) modifyThingViaNewConsumer.getEntityId()).isEqualTo(
TestConstants.Things.THING_ID);

}

private void verifyResourceStatus(final ActorRef underTest, final String statusMessage,
final ConnectivityStatus expected) {
underTest.tell(RetrieveAddressStatus.getInstance(), getRef());
final var status = expectMsgClass(ResourceStatus.class);
assertThat((Object) status.getStatus()).isEqualTo(expected);
assertThat(status.getStatusDetails())
.hasValueSatisfying(details -> assertThat(details).contains(statusMessage));
Awaitility.await("expecting resource status to be " + expected)
.untilAsserted(() -> {
underTest.tell(RetrieveAddressStatus.getInstance(), getRef());
final var status = expectMsgClass(ResourceStatus.class);
assertThat((Object) status.getStatus()).isEqualTo(expected);
assertThat(status.getStatusDetails())
.hasValueSatisfying(details -> assertThat(details).contains(statusMessage));
});
}

private MessageConsumer prepareMessageConsumer(final AtomicReference<MessageListener> ref)
Expand Down

0 comments on commit ffeb70b

Please sign in to comment.