3636import java .util .Map ;
3737import java .util .Objects ;
3838import java .util .Optional ;
39+ import java .util .Set ;
3940import java .util .SortedMap ;
4041import java .util .TreeMap ;
4142import java .util .stream .Collectors ;
@@ -54,6 +55,7 @@ public static class Builder {
5455 private int numDisksPerBroker = 1 ;
5556 private Map <Integer , Map <String , String >> perServerProperties = Map .of ();
5657 private BootstrapMetadata bootstrapMetadata ;
58+ private Set <String > disabledFeatures = Set .of ();
5759
5860 public Builder () {
5961 this (BootstrapMetadata .fromVersions (
@@ -93,6 +95,11 @@ public Builder setBootstrapMetadata(BootstrapMetadata bootstrapMetadata) {
9395 return this ;
9496 }
9597
98+ public Builder setDisabledFeatures (Set <String > disabledFeatures ) {
99+ this .disabledFeatures = Collections .unmodifiableSet (disabledFeatures );
100+ return this ;
101+ }
102+
96103 public Builder setCombined (boolean combined ) {
97104 this .combined = combined ;
98105 return this ;
@@ -215,14 +222,15 @@ public TestKitNodes build() {
215222 brokerNodes .put (id , brokerNode );
216223 }
217224
218- return new TestKitNodes (baseDirectory .toFile ().getAbsolutePath (), clusterId , bootstrapMetadata , controllerNodes , brokerNodes ,
219- brokerListenerName , brokerSecurityProtocol , controllerListenerName , controllerSecurityProtocol );
225+ return new TestKitNodes (baseDirectory .toFile ().getAbsolutePath (), clusterId , bootstrapMetadata , disabledFeatures , controllerNodes ,
226+ brokerNodes , brokerListenerName , brokerSecurityProtocol , controllerListenerName , controllerSecurityProtocol );
220227 }
221228 }
222229
223230 private final String baseDirectory ;
224231 private final String clusterId ;
225232 private final BootstrapMetadata bootstrapMetadata ;
233+ private final Set <String > disabledFeatures ;
226234 private final SortedMap <Integer , TestKitNode > controllerNodes ;
227235 private final SortedMap <Integer , TestKitNode > brokerNodes ;
228236 private final ListenerName brokerListenerName ;
@@ -234,6 +242,7 @@ private TestKitNodes(
234242 String baseDirectory ,
235243 String clusterId ,
236244 BootstrapMetadata bootstrapMetadata ,
245+ Set <String > disabledFeatures ,
237246 SortedMap <Integer , TestKitNode > controllerNodes ,
238247 SortedMap <Integer , TestKitNode > brokerNodes ,
239248 ListenerName brokerListenerName ,
@@ -244,6 +253,7 @@ private TestKitNodes(
244253 this .baseDirectory = Objects .requireNonNull (baseDirectory );
245254 this .clusterId = Objects .requireNonNull (clusterId );
246255 this .bootstrapMetadata = Objects .requireNonNull (bootstrapMetadata );
256+ this .disabledFeatures = Objects .requireNonNull (disabledFeatures );
247257 this .controllerNodes = Collections .unmodifiableSortedMap (new TreeMap <>(Objects .requireNonNull (controllerNodes )));
248258 this .brokerNodes = Collections .unmodifiableSortedMap (new TreeMap <>(Objects .requireNonNull (brokerNodes )));
249259 this .brokerListenerName = Objects .requireNonNull (brokerListenerName );
@@ -272,6 +282,10 @@ public BootstrapMetadata bootstrapMetadata() {
272282 return bootstrapMetadata ;
273283 }
274284
285+ public Set <String > disabledFeatures () {
286+ return disabledFeatures ;
287+ }
288+
275289 public SortedMap <Integer , TestKitNode > brokerNodes () {
276290 return brokerNodes ;
277291 }
0 commit comments