Skip to content

Commit

Permalink
Improve ServiceBusConsumerTest assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanpiergies committed Apr 23, 2024
1 parent 823d92e commit 00239e9
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,7 @@ void consumerPropagatesApplicationPropertiesToMessageHeaders() throws Exception

Message inMessage = exchange.getIn();
assertThat(inMessage).isNotNull();

Map<String, Object> expectedMessageHeaders = createExpectedMessageHeaders();
expectedMessageHeaders.put(ServiceBusConstants.APPLICATION_PROPERTIES,
Map.of(PROPAGATED_HEADER_KEY, PROPAGATED_HEADER_VALUE));
expectedMessageHeaders.put(PROPAGATED_HEADER_KEY, PROPAGATED_HEADER_VALUE);
assertThat(inMessage.getHeaders()).isEqualTo(expectedMessageHeaders);
assertThat(inMessage.getHeaders()).containsEntry(PROPAGATED_HEADER_KEY, PROPAGATED_HEADER_VALUE);
}
}

Expand All @@ -209,11 +204,7 @@ void consumerFiltersApplicationPropertiesFromMessageHeaders() throws Exception {

Message inMessage = exchange.getIn();
assertThat(inMessage).isNotNull();

Map<String, Object> expectedMessageHeaders = createExpectedMessageHeaders();
expectedMessageHeaders.put(ServiceBusConstants.APPLICATION_PROPERTIES,
Map.of(PROPAGATED_HEADER_KEY, PROPAGATED_HEADER_VALUE));
assertThat(inMessage.getHeaders()).isEqualTo(expectedMessageHeaders);
assertThat(inMessage.getHeaders()).doesNotContainKey(PROPAGATED_HEADER_KEY);
}
}

Expand Down

0 comments on commit 00239e9

Please sign in to comment.