1
- // Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
1
+ // Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom
2
+ // Inc. and/or its subsidiaries.
2
3
//
3
4
// This software, the RabbitMQ Stream Java client library, is dual-licensed under the
4
5
// Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL").
@@ -416,22 +417,13 @@ void publishToStreamConsumeFromStreamQueue(Codec codec, TestInfo info) {
416
417
d -> {
417
418
assertThat (d .getProperties ().getMessageId ()).isNull ();
418
419
assertThat (d .getProperties ().getCorrelationId ()).isNull ();
419
- assertThat (
420
- d .getProperties ()
421
- .getHeaders ()
422
- .get ("x-message-id" )
423
- .toString ()
424
- .getBytes (UTF8 ))
420
+ assertThat (d .getProperties ().getHeaders ().get ("x-message-id" ))
425
421
.isEqualTo ("the message ID" .getBytes (UTF8 ));
426
- assertThat (
427
- d .getProperties ()
428
- .getHeaders ()
429
- .get ("x-correlation-id" )
430
- .toString ()
431
- .getBytes (UTF8 ))
422
+ assertThat (d .getProperties ().getHeaders ().get ("x-correlation-id" ))
432
423
.isEqualTo ("the correlation ID" .getBytes (UTF8 ));
433
424
}),
434
425
mo (
426
+ BEFORE_MESSAGE_CONTAINERS ,
435
427
mb -> {
436
428
mb .properties ()
437
429
.messageId (
@@ -454,6 +446,27 @@ void publishToStreamConsumeFromStreamQueue(Codec codec, TestInfo info) {
454
446
"x-correlation-id" ,
455
447
LongStringHelper .asLongString (
456
448
StringUtils .repeat ("b" , 300 ).getBytes (UTF8 )));
449
+ }),
450
+ mo (
451
+ AFTER_MESSAGE_CONTAINERS ,
452
+ mb -> {
453
+ mb .properties ()
454
+ .messageId (
455
+ StringUtils .repeat ("a" , 300 )
456
+ .getBytes (UTF8 )); // larger than 091 shortstr
457
+ mb .properties ()
458
+ .correlationId (
459
+ StringUtils .repeat ("b" , 300 )
460
+ .getBytes (UTF8 )); // larger than 091 shortstr
461
+ },
462
+ d -> {
463
+ assertThat (d .getProperties ().getMessageId ()).isNull ();
464
+ assertThat (d .getProperties ().getCorrelationId ()).isNull ();
465
+ assertThat (d .getProperties ().getHeaders ())
466
+ .containsEntry (
467
+ "x-message-id" , StringUtils .repeat ("a" , 300 ).getBytes (UTF8 ))
468
+ .containsEntry (
469
+ "x-correlation-id" , StringUtils .repeat ("b" , 300 ).getBytes (UTF8 ));
457
470
}));
458
471
459
472
testMessageOperations
0 commit comments