Skip to content

Commit

Permalink
fix 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 8, 2021
1 parent 2440292 commit 8561078
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ protected Props getConsumerActorProps(final Sink<Object, NotUsed> inboundMapping
private Props getConsumerActorProps(final MessageConsumer messageConsumer,
final ActorRef jmsActor, final String address, final Sink<Object, NotUsed> inboundMappingSink,
final PayloadMapping payloadMapping) {
final ConnectivityStatusResolver statusResolver = mock(ConnectivityStatusResolver.class);
when(statusResolver.resolve(any(Exception.class))).thenReturn(ConnectivityStatus.MISCONFIGURED);

final ConsumerData mockConsumerData =
consumerData(address, messageConsumer, ConnectivityModelFactory.newSourceBuilder()
.authorizationContext(TestConstants.Authorization.AUTHORIZATION_CONTEXT)
Expand All @@ -134,7 +137,7 @@ private Props getConsumerActorProps(final MessageConsumer messageConsumer,
.build())
.build());
return AmqpConsumerActor.props(CONNECTION, mockConsumerData, inboundMappingSink,
jmsActor, mock(ConnectivityStatusResolver.class));
jmsActor, statusResolver);
}

@Override
Expand Down Expand Up @@ -429,7 +432,7 @@ public void closedMessageConsumerIsRecreatedAfterBackoffAndResourceStatusIsUpdat
// signal closed consumer to consumer actor
underTest.tell(ConsumerClosedStatusReport.get(messageConsumer,
new ProviderSecurityException(errorMessage)), getRef());
verify(messageConsumer).close();
verify(messageConsumer, Mockito.timeout(100)).close();

// verify the actual state ist reflected in the source resource status
verifyResourceStatus(underTest, errorMessage, ConnectivityStatus.MISCONFIGURED);
Expand Down

0 comments on commit 8561078

Please sign in to comment.