This repository was archived by the owner on Apr 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed
pulsar-broker/src/test/java/org/apache/pulsar/broker Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ protected void onCleanup() {
65
65
@ Override
66
66
protected PulsarTestContext .Builder createPulsarTestContextBuilder (ServiceConfiguration conf ) {
67
67
return super .createPulsarTestContextBuilder (conf )
68
+ .spyNoneByDefault ()
68
69
.localMetadataStore (createMetadataStore (MetadataStoreConfig .METADATA_STORE ))
69
70
.configurationMetadataStore (createMetadataStore (MetadataStoreConfig .CONFIGURATION_METADATA_STORE ));
70
71
}
Original file line number Diff line number Diff line change @@ -331,7 +331,17 @@ protected long resolveBrokerShutdownTimeoutMs() {
331
331
* @return the builder
332
332
*/
333
333
public Builder spyByDefault () {
334
- spyConfigBuilder = SpyConfig .builder (SpyConfig .SpyType .SPY );
334
+ spyConfigDefault (SpyConfig .SpyType .SPY );
335
+ return this ;
336
+ }
337
+
338
+ public Builder spyNoneByDefault () {
339
+ spyConfigDefault (SpyConfig .SpyType .NONE );
340
+ return this ;
341
+ }
342
+
343
+ public Builder spyConfigDefault (SpyConfig .SpyType spyType ) {
344
+ spyConfigBuilder = SpyConfig .builder (spyType );
335
345
return this ;
336
346
}
337
347
Original file line number Diff line number Diff line change @@ -129,13 +129,17 @@ public static Builder builder() {
129
129
*/
130
130
public static Builder builder (SpyType defaultSpyType ) {
131
131
Builder spyConfigBuilder = new Builder ();
132
+ configureDefaults (spyConfigBuilder , defaultSpyType );
133
+ return spyConfigBuilder ;
134
+ }
135
+
136
+ public static void configureDefaults (Builder spyConfigBuilder , SpyType defaultSpyType ) {
132
137
spyConfigBuilder .pulsarService (defaultSpyType );
133
138
spyConfigBuilder .pulsarResources (defaultSpyType );
134
139
spyConfigBuilder .brokerService (defaultSpyType );
135
140
spyConfigBuilder .bookKeeperClient (defaultSpyType );
136
141
spyConfigBuilder .compactor (defaultSpyType );
137
142
spyConfigBuilder .compactedServiceFactory (defaultSpyType );
138
143
spyConfigBuilder .namespaceService (defaultSpyType );
139
- return spyConfigBuilder ;
140
144
}
141
145
}
You can’t perform that action at this time.
0 commit comments