@@ -94,6 +94,27 @@ void testValidationMaxMembersZero() {
9494 assertTrue (exception .getMessage ().contains ("max number of members must be >= 1" ));
9595 }
9696
97+ @ Test
98+ void testValidationFilterNoWildcardNoGt () {
99+ ElasticConsumerGroupConfig config = new ElasticConsumerGroupConfig (
100+ 4 , "foo.bar" , new int []{}, 0 , 0 ,
101+ Arrays .asList ("m1" , "m2" ), new ArrayList <>()
102+ );
103+
104+ ConsumerGroupException exception = assertThrows (ConsumerGroupException .class , config ::validate );
105+ assertTrue (exception .getMessage ().contains ("partitioning filters must have at least one * wildcard or end with > wildcard" ));
106+ }
107+
108+ @ Test
109+ void testValidationFilterEndingWithGtIsValid () {
110+ ElasticConsumerGroupConfig config = new ElasticConsumerGroupConfig (
111+ 4 , "foo.>" , new int []{}, 0 , 0 ,
112+ Arrays .asList ("m1" , "m2" ), new ArrayList <>()
113+ );
114+
115+ assertDoesNotThrow (config ::validate );
116+ }
117+
97118 @ Test
98119 void testValidationFilterNoWildcardWithWildcardsSpecified () {
99120 ElasticConsumerGroupConfig config = new ElasticConsumerGroupConfig (
@@ -102,7 +123,7 @@ void testValidationFilterNoWildcardWithWildcardsSpecified() {
102123 );
103124
104125 ConsumerGroupException exception = assertThrows (ConsumerGroupException .class , config ::validate );
105- assertTrue (exception .getMessage ().contains ("number of partitioning wildcards must not be larger than " ));
126+ assertTrue (exception .getMessage ().contains ("partitioning filters must have at least one * wildcard or end with > wildcard " ));
106127 }
107128
108129 @ Test
@@ -154,7 +175,18 @@ void testValidationPartitioningWildcardsOutOfRange() {
154175 );
155176
156177 ConsumerGroupException exception = assertThrows (ConsumerGroupException .class , config ::validate );
157- assertTrue (exception .getMessage ().contains ("partitioning wildcard indexes must be less than or equal to" ));
178+ assertTrue (exception .getMessage ().contains ("partitioning wildcard indexes must be between 1 and" ));
179+ }
180+
181+ @ Test
182+ void testValidationPartitioningWildcardsZeroIndex () {
183+ ElasticConsumerGroupConfig config = new ElasticConsumerGroupConfig (
184+ 4 , "foo.*" , new int []{0 }, 0 , 0 ,
185+ Arrays .asList ("m1" , "m2" ), new ArrayList <>()
186+ );
187+
188+ ConsumerGroupException exception = assertThrows (ConsumerGroupException .class , config ::validate );
189+ assertTrue (exception .getMessage ().contains ("partitioning wildcard indexes must be between 1 and" ));
158190 }
159191
160192 @ Test
0 commit comments