use of org.opensmartgridplatform.shared.infra.jms.RetryHeader in project open-smart-grid-platform by OSGP.
the class ProtocolResponseMessageSendingHandlerTest method sendsProtocolResponseMessageThatAvoidsRetries.
@Test
void sendsProtocolResponseMessageThatAvoidsRetries() {
final ProtocolResponseMessageSendingHandler protocolResponseMessageSendingHandler = this.aProtocolResponseMessageSendingHandler();
protocolResponseMessageSendingHandler.handlePublishedMessage("any/topic", "any-payload".getBytes(StandardCharsets.UTF_8));
verify(this.outboundOsgpCoreResponseMessageSender).send(this.responseMessageCaptor.capture());
final ResponseMessage actualResponseMessage = this.responseMessageCaptor.getValue();
final MessageMetadata actualMessageMetadata = actualResponseMessage.messageMetadata();
assertThat(actualMessageMetadata.isScheduled()).isFalse();
assertThat(actualMessageMetadata.isBypassRetry()).isTrue();
final RetryHeader retryHeader = actualResponseMessage.getRetryHeader();
if (retryHeader != null) {
assertThat(retryHeader.getScheduledRetryTime()).isNull();
assertThat(retryHeader.getMaxRetries()).isZero();
}
}
Aggregations