Program: 41179
Project: 41179
Buggy source:
/** 
 * Tests that the   {@link AmqpMessageSupport#LEGACY_REPLY_TO_TYPE_MSG_ANNOTATION_SYMBOL_NAME} set on a message toindicate its 'reply-to' address represents a Topic results in the JMSReplyTo object being a Topic. Ensure the consumers destination is not used by consuming from a Queue.
 */
@Test(timeout=2000) public void testReceivedMessageFromQueueWithLegacyReplyToTypeAnnotationForTopic() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(IntegrationTestFixture.PORT)){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    Queue queue=session.createQueue("String_Node_Str");
    MessageAnnotationsDescribedType msgAnnotations=new MessageAnnotationsDescribedType();
    msgAnnotations.setSymbolKeyedAnnotation(AmqpMessageSupport.LEGACY_REPLY_TO_TYPE_MSG_ANNOTATION_SYMBOL_NAME,AmqpMessageSupport.LEGACY_TOPIC_ATTRIBUTE);
    PropertiesDescribedType props=new PropertiesDescribedType();
    String myTopicAddress="String_Node_Str";
    props.setReplyTo(myTopicAddress);
    props.setMessageId("String_Node_Str");
    DescribedType amqpValueNullContent=new AmqpValueDescribedType(null);
    testPeer.expectReceiverAttach();
    testPeer.expectLinkFlowRespondWithTransfer(null,msgAnnotations,props,null,amqpValueNullContent);
    testPeer.expectDispositionThatIsAcceptedAndSettled();
    MessageConsumer messageConsumer=session.createConsumer(queue);
    Message receivedMessage=messageConsumer.receive(1000);
    testPeer.waitForAllHandlersToComplete(3000);
    assertNotNull(receivedMessage);
    Destination dest=receivedMessage.getJMSReplyTo();
    assertTrue(dest instanceof Topic);
    assertEquals(myTopicAddress,((Topic)dest).getTopicName());
  }
 }

Fixed version (ground truth):
/** 
 * Tests that the   {@link AmqpMessageSupport#LEGACY_REPLY_TO_TYPE_MSG_ANNOTATION_SYMBOL_NAME} set on a message toindicate its 'reply-to' address represents a Topic results in the JMSReplyTo object being a Topic. Ensure the consumers destination is not used by consuming from a Queue.
 */
@Test(timeout=2000) public void testReceivedMessageFromQueueWithLegacyReplyToTypeAnnotationForTopic() throws Exception {
  try (TestAmqpPeer testPeer=new TestAmqpPeer(testFixture.getAvailablePort())){
    Connection connection=testFixture.establishConnecton(testPeer);
    connection.start();
    testPeer.expectBegin(true);
    Session session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    Queue queue=session.createQueue("String_Node_Str");
    MessageAnnotationsDescribedType msgAnnotations=new MessageAnnotationsDescribedType();
    msgAnnotations.setSymbolKeyedAnnotation(AmqpMessageSupport.LEGACY_REPLY_TO_TYPE_MSG_ANNOTATION_SYMBOL_NAME,AmqpMessageSupport.LEGACY_TOPIC_ATTRIBUTE);
    PropertiesDescribedType props=new PropertiesDescribedType();
    String myTopicAddress="String_Node_Str";
    props.setReplyTo(myTopicAddress);
    props.setMessageId("String_Node_Str");
    DescribedType amqpValueNullContent=new AmqpValueDescribedType(null);
    testPeer.expectReceiverAttach();
    testPeer.expectLinkFlowRespondWithTransfer(null,msgAnnotations,props,null,amqpValueNullContent);
    testPeer.expectDispositionThatIsAcceptedAndSettled();
    MessageConsumer messageConsumer=session.createConsumer(queue);
    Message receivedMessage=messageConsumer.receive(1000);
    testPeer.waitForAllHandlersToComplete(3000);
    assertNotNull(receivedMessage);
    Destination dest=receivedMessage.getJMSReplyTo();
    assertTrue(dest instanceof Topic);
    assertEquals(myTopicAddress,((Topic)dest).getTopicName());
  }
 }