Program: 41167
Project: 41167
Buggy source:
/** 
 * Tests that when sending a message with the JMSXGroupID, JMSXGroupSeq, and JMS_AMQP_REPLY_TO_GROUP_ID properties of the JMS message set, that the expected values are included in the fields of the AMQP message emitted.
 */
@Test(timeout=2000) public void testSendMessageWithGroupRelatedPropertiesSet() 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 queueName="String_Node_Str";
    Queue queue=session.createQueue(queueName);
    MessageProducer producer=session.createProducer(queue);
    MessageHeaderSectionMatcher headersMatcher=new MessageHeaderSectionMatcher(true).withDurable(equalTo(true));
    MessageAnnotationsSectionMatcher msgAnnotationsMatcher=new MessageAnnotationsSectionMatcher(true);
    String expectedGroupId="String_Node_Str";
    int expectedGroupSeq=1;
    String expectedReplyToGroupId="String_Node_Str";
    MessagePropertiesSectionMatcher propsMatcher=new MessagePropertiesSectionMatcher(true);
    propsMatcher.withGroupId(equalTo(expectedGroupId));
    propsMatcher.withReplyToGroupId(equalTo(expectedReplyToGroupId));
    propsMatcher.withGroupSequence(equalTo(UnsignedInteger.valueOf(expectedGroupSeq)));
    TransferPayloadCompositeMatcher messageMatcher=new TransferPayloadCompositeMatcher();
    messageMatcher.setHeadersMatcher(headersMatcher);
    messageMatcher.setMessageAnnotationsMatcher(msgAnnotationsMatcher);
    messageMatcher.setPropertiesMatcher(propsMatcher);
    messageMatcher.setMessageContentMatcher(new EncodedAmqpValueMatcher(null));
    testPeer.expectTransfer(messageMatcher);
    Message message=session.createTextMessage();
    message.setStringProperty(JmsClientProperties.JMSXGROUPID,expectedGroupId);
    message.setIntProperty(JmsClientProperties.JMSXGROUPSEQ,expectedGroupSeq);
    message.setStringProperty(AmqpMessageSupport.JMS_AMQP_REPLY_TO_GROUP_ID,expectedReplyToGroupId);
    producer.send(message);
    testPeer.waitForAllHandlersToComplete(1000);
  }
 }

Fixed version (ground truth):
/** 
 * Tests that when sending a message with the JMSXGroupID, JMSXGroupSeq, and JMS_AMQP_REPLY_TO_GROUP_ID properties of the JMS message set, that the expected values are included in the fields of the AMQP message emitted.
 */
@Test(timeout=2000) public void testSendMessageWithGroupRelatedPropertiesSet() 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 queueName="String_Node_Str";
    Queue queue=session.createQueue(queueName);
    MessageProducer producer=session.createProducer(queue);
    MessageHeaderSectionMatcher headersMatcher=new MessageHeaderSectionMatcher(true).withDurable(equalTo(true));
    MessageAnnotationsSectionMatcher msgAnnotationsMatcher=new MessageAnnotationsSectionMatcher(true);
    String expectedGroupId="String_Node_Str";
    int expectedGroupSeq=1;
    String expectedReplyToGroupId="String_Node_Str";
    MessagePropertiesSectionMatcher propsMatcher=new MessagePropertiesSectionMatcher(true);
    propsMatcher.withGroupId(equalTo(expectedGroupId));
    propsMatcher.withReplyToGroupId(equalTo(expectedReplyToGroupId));
    propsMatcher.withGroupSequence(equalTo(UnsignedInteger.valueOf(expectedGroupSeq)));
    TransferPayloadCompositeMatcher messageMatcher=new TransferPayloadCompositeMatcher();
    messageMatcher.setHeadersMatcher(headersMatcher);
    messageMatcher.setMessageAnnotationsMatcher(msgAnnotationsMatcher);
    messageMatcher.setPropertiesMatcher(propsMatcher);
    messageMatcher.setMessageContentMatcher(new EncodedAmqpValueMatcher(null));
    testPeer.expectTransfer(messageMatcher);
    Message message=session.createTextMessage();
    message.setStringProperty(JmsClientProperties.JMSXGROUPID,expectedGroupId);
    message.setIntProperty(JmsClientProperties.JMSXGROUPSEQ,expectedGroupSeq);
    message.setStringProperty(AmqpMessageSupport.JMS_AMQP_REPLY_TO_GROUP_ID,expectedReplyToGroupId);
    producer.send(message);
    testPeer.waitForAllHandlersToComplete(1000);
  }
 }