File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
src/test/java/com/rabbitmq/stream/impl Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 13
13
14
14
package com .rabbitmq .stream .impl ;
15
15
16
+ import static com .rabbitmq .stream .impl .TestUtils .ResponseConditions .ko ;
16
17
import static com .rabbitmq .stream .impl .TestUtils .ResponseConditions .ok ;
18
+ import static com .rabbitmq .stream .impl .TestUtils .ResponseConditions .responseCode ;
17
19
import static com .rabbitmq .stream .impl .TestUtils .b ;
18
20
import static com .rabbitmq .stream .impl .TestUtils .declareSuperStreamTopology ;
19
21
import static com .rabbitmq .stream .impl .TestUtils .deleteSuperStreamTopology ;
@@ -574,4 +576,17 @@ void superStreamRebalancingShouldWorkWhilePublishing(TestInfo info) throws Excep
574
576
deleteSuperStreamTopology (c , superStream , 3 );
575
577
}
576
578
}
579
+
580
+ @ Test
581
+ void singleActiveConsumerMustHaveName () {
582
+ Client client = cf .get ();
583
+ Response response =
584
+ client .subscribe (
585
+ b (0 ),
586
+ stream ,
587
+ OffsetSpecification .first (),
588
+ 10 ,
589
+ Collections .singletonMap ("single-active-consumer" , "true" ));
590
+ assertThat (response ).is (ko ()).has (responseCode (Constants .RESPONSE_CODE_PRECONDITION_FAILED ));
591
+ }
577
592
}
Original file line number Diff line number Diff line change @@ -369,11 +369,11 @@ static CountDownLatchAssert latchAssert(AtomicReference<CountDownLatch> latchRef
369
369
static class ResponseConditions {
370
370
371
371
static Condition <Response > ok () {
372
- return new Condition <>(Response ::isOk , "Response should be OK" );
372
+ return new Condition <>(Response ::isOk , "OK" );
373
373
}
374
374
375
375
static Condition <Response > ko () {
376
- return new Condition <>(response -> !response .isOk (), "Response should be OK " );
376
+ return new Condition <>(response -> !response .isOk (), "KO " );
377
377
}
378
378
379
379
static Condition <Response > responseCode (short expectedResponse ) {
You can’t perform that action at this time.
0 commit comments