Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Commit

Permalink
[improve][test] Don't configure Mockito spying for MultiBrokerTestZKB…
Browse files Browse the repository at this point in the history
…aseTest (apache#22250)
  • Loading branch information
lhotari authored Mar 12, 2024
1 parent 73f62c5 commit 9f63e24
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ protected void onCleanup() {
@Override
protected PulsarTestContext.Builder createPulsarTestContextBuilder(ServiceConfiguration conf) {
return super.createPulsarTestContextBuilder(conf)
.spyNoneByDefault()
.localMetadataStore(createMetadataStore(MetadataStoreConfig.METADATA_STORE))
.configurationMetadataStore(createMetadataStore(MetadataStoreConfig.CONFIGURATION_METADATA_STORE));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,17 @@ protected long resolveBrokerShutdownTimeoutMs() {
* @return the builder
*/
public Builder spyByDefault() {
spyConfigBuilder = SpyConfig.builder(SpyConfig.SpyType.SPY);
spyConfigDefault(SpyConfig.SpyType.SPY);
return this;
}

public Builder spyNoneByDefault() {
spyConfigDefault(SpyConfig.SpyType.NONE);
return this;
}

public Builder spyConfigDefault(SpyConfig.SpyType spyType) {
spyConfigBuilder = SpyConfig.builder(spyType);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,17 @@ public static Builder builder() {
*/
public static Builder builder(SpyType defaultSpyType) {
Builder spyConfigBuilder = new Builder();
configureDefaults(spyConfigBuilder, defaultSpyType);
return spyConfigBuilder;
}

public static void configureDefaults(Builder spyConfigBuilder, SpyType defaultSpyType) {
spyConfigBuilder.pulsarService(defaultSpyType);
spyConfigBuilder.pulsarResources(defaultSpyType);
spyConfigBuilder.brokerService(defaultSpyType);
spyConfigBuilder.bookKeeperClient(defaultSpyType);
spyConfigBuilder.compactor(defaultSpyType);
spyConfigBuilder.compactedServiceFactory(defaultSpyType);
spyConfigBuilder.namespaceService(defaultSpyType);
return spyConfigBuilder;
}
}

0 comments on commit 9f63e24

Please sign in to comment.