Program: 41701
Project: 41701
Buggy source:
/** 
 * Tests that the   {@link AmqpDestinationHelper#JMS_DEST_TYPE_MSG_ANNOTATION_SYMBOL_NAME} is set as a byte ona sent message to indicate its 'to' address represents a Topic JMSDestination.
 */
@Test(timeout=5000) public void testSentMessageContainsToTypeAnnotationByte() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(IntegrationTestFixture.PORT)){
    Connection connection=testFixture.establishConnecton(testPeer);
    testPeer.expectBegin(true);
    testPeer.expectSenderAttach();
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    String topicName="String_Node_Str";
    MessageHeaderSectionMatcher headersMatcher=new MessageHeaderSectionMatcher(true).withDurable(equalTo(true));
    MessageAnnotationsSectionMatcher msgAnnotationsMatcher=new MessageAnnotationsSectionMatcher(true);
    Symbol annotationKey=AmqpMessageSupport.getSymbol(AmqpDestinationHelper.JMS_DEST_TYPE_MSG_ANNOTATION_SYMBOL_NAME);
    msgAnnotationsMatcher.withEntry(annotationKey,equalTo(AmqpDestinationHelper.TOPIC_TYPE));
    MessagePropertiesSectionMatcher propsMatcher=new MessagePropertiesSectionMatcher(true).withTo(equalTo(topicName));
    TransferPayloadCompositeMatcher messageMatcher=new TransferPayloadCompositeMatcher();
    messageMatcher.setHeadersMatcher(headersMatcher);
    messageMatcher.setMessageAnnotationsMatcher(msgAnnotationsMatcher);
    messageMatcher.setPropertiesMatcher(propsMatcher);
    testPeer.expectTransfer(messageMatcher);
    Message message=session.createMessage();
    Topic topic=session.createTopic(topicName);
    MessageProducer producer=session.createProducer(topic);
    producer.send(message);
    testPeer.waitForAllHandlersToComplete(2000);
  }
 }

Fixed version (ground truth):
/** 
 * Tests that the   {@link AmqpDestinationHelper#JMS_DEST_TYPE_MSG_ANNOTATION_SYMBOL_NAME} is set as a byte ona sent message to indicate its 'to' address represents a Topic JMSDestination.
 */
@Test(timeout=5000) public void testSentMessageContainsToTypeAnnotationByte() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(testFixture.getAvailablePort())){
    Connection connection=testFixture.establishConnecton(testPeer);
    testPeer.expectBegin(true);
    testPeer.expectSenderAttach();
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    String topicName="String_Node_Str";
    MessageHeaderSectionMatcher headersMatcher=new MessageHeaderSectionMatcher(true).withDurable(equalTo(true));
    MessageAnnotationsSectionMatcher msgAnnotationsMatcher=new MessageAnnotationsSectionMatcher(true);
    Symbol annotationKey=AmqpMessageSupport.getSymbol(AmqpDestinationHelper.JMS_DEST_TYPE_MSG_ANNOTATION_SYMBOL_NAME);
    msgAnnotationsMatcher.withEntry(annotationKey,equalTo(AmqpDestinationHelper.TOPIC_TYPE));
    MessagePropertiesSectionMatcher propsMatcher=new MessagePropertiesSectionMatcher(true).withTo(equalTo(topicName));
    TransferPayloadCompositeMatcher messageMatcher=new TransferPayloadCompositeMatcher();
    messageMatcher.setHeadersMatcher(headersMatcher);
    messageMatcher.setMessageAnnotationsMatcher(msgAnnotationsMatcher);
    messageMatcher.setPropertiesMatcher(propsMatcher);
    testPeer.expectTransfer(messageMatcher);
    Message message=session.createMessage();
    Topic topic=session.createTopic(topicName);
    MessageProducer producer=session.createProducer(topic);
    producer.send(message);
    testPeer.waitForAllHandlersToComplete(2000);
  }
 }