From 331b032a59fdaaf2d3553d72f39e3cca3aac61f1 Mon Sep 17 00:00:00 2001 From: Stefan Dragisic Date: Tue, 23 Jul 2024 11:31:22 +0200 Subject: [PATCH] PR comments --- .../pom.xml | 2 +- ...ltiTenancyAxonServerAutoConfiguration.java | 3 +- ...nantPersistentStreamAutoConfiguration.java | 19 ++- ...tiTenantPersistentStreamMessageSource.java | 66 --------- .../MultiTenancyAutoConfigurationTest.java | 3 +- multitenancy/pom.xml | 4 + .../MultiTenantSubscribableMessageSource.java | 25 +++- ...tiTenantPersistentStreamMessageSource.java | 125 ++++++++++++++++++ ...tPersistentStreamMessageSourceFactory.java | 19 ++- ...nantPersistentStreamMessageSourceTest.java | 39 +++--- pom.xml | 2 +- 11 files changed, 210 insertions(+), 97 deletions(-) delete mode 100644 multitenancy-spring-boot-autoconfigure/src/main/java/org/axonframework/extensions/multitenancy/autoconfig/MultiTenantPersistentStreamMessageSource.java create mode 100644 multitenancy/src/main/java/org/axonframework/extensions/multitenancy/components/eventstore/MultiTenantPersistentStreamMessageSource.java rename {multitenancy-spring-boot-autoconfigure/src/main/java/org/axonframework/extensions/multitenancy/autoconfig => multitenancy/src/main/java/org/axonframework/extensions/multitenancy/components/eventstore}/TenantPersistentStreamMessageSourceFactory.java (79%) rename {multitenancy-spring-boot-autoconfigure/src/test/java/org/axonframework/extensions/multitenancy/autoconfig => multitenancy/src/test/java/org/axonframework/extensions/multitenancy/components/eventstore}/MultiTenantPersistentStreamMessageSourceTest.java (82%) diff --git a/multitenancy-spring-boot-3-integrationtests/pom.xml b/multitenancy-spring-boot-3-integrationtests/pom.xml index 345e16a..9d3b24b 100644 --- a/multitenancy-spring-boot-3-integrationtests/pom.xml +++ b/multitenancy-spring-boot-3-integrationtests/pom.xml @@ -36,7 +36,7 @@ jar - 4.10.0-SNAPSHOT + 4.10.0 1.20.0 3.4.2 diff --git a/multitenancy-spring-boot-autoconfigure/src/main/java/org/axonframework/extensions/multitenancy/autoconfig/MultiTenancyAxonServerAutoConfiguration.java b/multitenancy-spring-boot-autoconfigure/src/main/java/org/axonframework/extensions/multitenancy/autoconfig/MultiTenancyAxonServerAutoConfiguration.java index d1db9ed..9b04bc9 100644 --- a/multitenancy-spring-boot-autoconfigure/src/main/java/org/axonframework/extensions/multitenancy/autoconfig/MultiTenancyAxonServerAutoConfiguration.java +++ b/multitenancy-spring-boot-autoconfigure/src/main/java/org/axonframework/extensions/multitenancy/autoconfig/MultiTenancyAxonServerAutoConfiguration.java @@ -49,6 +49,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -69,7 +70,7 @@ @AutoConfiguration @ConditionalOnClass(AxonServerConfiguration.class) @ConditionalOnProperty(value = {"axon.axonserver.enabled", "axon.multi-tenancy.enabled"}, matchIfMissing = true) -@AutoConfigureBefore(AxonServerAutoConfiguration.class) +@AutoConfigureAfter(AxonServerAutoConfiguration.class) @ComponentScan(excludeFilters = { @ComponentScan.Filter( type = FilterType.REGEX, diff --git a/multitenancy-spring-boot-autoconfigure/src/main/java/org/axonframework/extensions/multitenancy/autoconfig/MultiTenantPersistentStreamAutoConfiguration.java b/multitenancy-spring-boot-autoconfigure/src/main/java/org/axonframework/extensions/multitenancy/autoconfig/MultiTenantPersistentStreamAutoConfiguration.java index 88d5e68..b973639 100644 --- a/multitenancy-spring-boot-autoconfigure/src/main/java/org/axonframework/extensions/multitenancy/autoconfig/MultiTenantPersistentStreamAutoConfiguration.java +++ b/multitenancy-spring-boot-autoconfigure/src/main/java/org/axonframework/extensions/multitenancy/autoconfig/MultiTenantPersistentStreamAutoConfiguration.java @@ -1,9 +1,26 @@ +/* + * Copyright (c) 2010-2024. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.axonframework.extensions.multitenancy.autoconfig; import org.axonframework.axonserver.connector.event.axon.PersistentStreamMessageSource; import org.axonframework.axonserver.connector.event.axon.PersistentStreamMessageSourceFactory; import org.axonframework.common.StringUtils; import org.axonframework.extensions.multitenancy.components.TenantProvider; +import org.axonframework.extensions.multitenancy.components.eventstore.MultiTenantPersistentStreamMessageSource; +import org.axonframework.extensions.multitenancy.components.eventstore.TenantPersistentStreamMessageSourceFactory; import org.axonframework.springboot.autoconfig.AxonServerAutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; @@ -16,7 +33,7 @@ * This configuration is enabled when Axon Server and multi-tenancy are both enabled. * * @author Stefan Dragisic - * @since 4.10 + * @since 4.10.0 */ @AutoConfiguration @ConditionalOnProperty(value = {"axon.axonserver.enabled", "axon.multi-tenancy.enabled"}, matchIfMissing = true) diff --git a/multitenancy-spring-boot-autoconfigure/src/main/java/org/axonframework/extensions/multitenancy/autoconfig/MultiTenantPersistentStreamMessageSource.java b/multitenancy-spring-boot-autoconfigure/src/main/java/org/axonframework/extensions/multitenancy/autoconfig/MultiTenantPersistentStreamMessageSource.java deleted file mode 100644 index cc2e379..0000000 --- a/multitenancy-spring-boot-autoconfigure/src/main/java/org/axonframework/extensions/multitenancy/autoconfig/MultiTenantPersistentStreamMessageSource.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.axonframework.extensions.multitenancy.autoconfig; - -import io.axoniq.axonserver.connector.event.PersistentStreamProperties; -import org.axonframework.axonserver.connector.AxonServerConfiguration; -import org.axonframework.axonserver.connector.event.axon.PersistentStreamMessageSource; -import org.axonframework.config.Configuration; -import org.axonframework.extensions.multitenancy.components.MultiTenantAwareComponent; -import org.axonframework.extensions.multitenancy.components.MultiTenantSubscribableMessageSource; -import org.axonframework.extensions.multitenancy.components.TenantDescriptor; -import org.axonframework.common.Registration; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ScheduledExecutorService; - -public class MultiTenantPersistentStreamMessageSource extends PersistentStreamMessageSource - implements MultiTenantAwareComponent, MultiTenantSubscribableMessageSource { - - private final String name; - - private final Configuration configuration; - private final TenantPersistentStreamMessageSourceFactory tenantPersistentStreamMessageSourceFactory; - private final Map tenantSegments = new ConcurrentHashMap<>(); - - - private final PersistentStreamProperties persistentStreamProperties; - private final ScheduledExecutorService scheduler; - private final int batchSize; - private final String context; - - public MultiTenantPersistentStreamMessageSource(String name, PersistentStreamProperties - persistentStreamProperties, ScheduledExecutorService scheduler, int batchSize, String context, Configuration configuration, - TenantPersistentStreamMessageSourceFactory tenantPersistentStreamMessageSourceFactory) { - - super(name, configuration, persistentStreamProperties, scheduler, batchSize, context); - this.tenantPersistentStreamMessageSourceFactory = tenantPersistentStreamMessageSourceFactory; - this.name = name; - this.configuration = configuration; - this.persistentStreamProperties = persistentStreamProperties; - this.scheduler = scheduler; - this.batchSize = batchSize; - this.context = context; - } - - @Override - public Registration registerTenant(TenantDescriptor tenantDescriptor) { - PersistentStreamMessageSource tenantSegment = tenantPersistentStreamMessageSourceFactory.build( name, - persistentStreamProperties, scheduler, batchSize, context, configuration, tenantDescriptor); - tenantSegments.putIfAbsent(tenantDescriptor, tenantSegment); - - return () -> { - PersistentStreamMessageSource removed = tenantSegments.remove(tenantDescriptor); - return removed != null; - }; - } - - @Override - public Registration registerAndStartTenant(TenantDescriptor tenantDescriptor) { - return registerTenant(tenantDescriptor); - } - - @Override - public Map tenantSegments() { - return tenantSegments; - } -} \ No newline at end of file diff --git a/multitenancy-spring-boot-autoconfigure/src/test/java/org/axonframework/extensions/multitenancy/autoconfig/MultiTenancyAutoConfigurationTest.java b/multitenancy-spring-boot-autoconfigure/src/test/java/org/axonframework/extensions/multitenancy/autoconfig/MultiTenancyAutoConfigurationTest.java index 13cdc1f..1e1aba4 100644 --- a/multitenancy-spring-boot-autoconfigure/src/test/java/org/axonframework/extensions/multitenancy/autoconfig/MultiTenancyAutoConfigurationTest.java +++ b/multitenancy-spring-boot-autoconfigure/src/test/java/org/axonframework/extensions/multitenancy/autoconfig/MultiTenancyAutoConfigurationTest.java @@ -25,6 +25,7 @@ import org.axonframework.extensions.multitenancy.components.deadletterqueue.MultiTenantDeadLetterQueueFactory; import org.axonframework.extensions.multitenancy.components.eventstore.MultiTenantEventStore; import org.axonframework.extensions.multitenancy.components.eventstore.TenantEventSegmentFactory; +import org.axonframework.extensions.multitenancy.components.eventstore.TenantPersistentStreamMessageSourceFactory; import org.axonframework.extensions.multitenancy.components.queryhandeling.MultiTenantQueryBus; import org.axonframework.extensions.multitenancy.components.queryhandeling.MultiTenantQueryUpdateEmitter; import org.axonframework.extensions.multitenancy.components.queryhandeling.TenantQuerySegmentFactory; @@ -37,8 +38,6 @@ import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.test.context.runner.ApplicationContextRunner; -import java.util.concurrent.ScheduledExecutorService; - import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.*; diff --git a/multitenancy/pom.xml b/multitenancy/pom.xml index a5153fd..427ebee 100644 --- a/multitenancy/pom.xml +++ b/multitenancy/pom.xml @@ -62,5 +62,9 @@ ${mockito.version} test + + org.axonframework + axon-server-connector + \ No newline at end of file diff --git a/multitenancy/src/main/java/org/axonframework/extensions/multitenancy/components/MultiTenantSubscribableMessageSource.java b/multitenancy/src/main/java/org/axonframework/extensions/multitenancy/components/MultiTenantSubscribableMessageSource.java index bf39af3..35d0caf 100644 --- a/multitenancy/src/main/java/org/axonframework/extensions/multitenancy/components/MultiTenantSubscribableMessageSource.java +++ b/multitenancy/src/main/java/org/axonframework/extensions/multitenancy/components/MultiTenantSubscribableMessageSource.java @@ -1,25 +1,36 @@ +/* + * Copyright (c) 2010-2024. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.axonframework.extensions.multitenancy.components; import java.util.Map; - -/** - * Interface for multi-tenant message sources that can provide tenant segments. - * - * @param The type of the tenant segment - */ import org.axonframework.eventhandling.EventMessage; import org.axonframework.messaging.SubscribableMessageSource; /** * Interface for multi-tenant message sources that can provide tenant segments. * + * @author Stefan Dragisic * @param The type of the tenant segment, which must extend MessageSource + * @since 4.10.0 */ public interface MultiTenantSubscribableMessageSource>> { /** * Returns a map of tenant segments, where the key is the TenantDescriptor - * and the value is the corresponding tenant segment of type T, which extends MessageSource. + * and the value is the corresponding tenant segment of type T, which extends {@link SubscribableMessageSource}. * * @return A map of TenantDescriptor to tenant segments */ diff --git a/multitenancy/src/main/java/org/axonframework/extensions/multitenancy/components/eventstore/MultiTenantPersistentStreamMessageSource.java b/multitenancy/src/main/java/org/axonframework/extensions/multitenancy/components/eventstore/MultiTenantPersistentStreamMessageSource.java new file mode 100644 index 0000000..5ea2fb4 --- /dev/null +++ b/multitenancy/src/main/java/org/axonframework/extensions/multitenancy/components/eventstore/MultiTenantPersistentStreamMessageSource.java @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2010-2024. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.axonframework.extensions.multitenancy.components.eventstore; + + +import io.axoniq.axonserver.connector.event.PersistentStreamProperties; +import org.axonframework.axonserver.connector.event.axon.PersistentStreamMessageSource; +import org.axonframework.config.Configuration; +import org.axonframework.extensions.multitenancy.components.MultiTenantAwareComponent; +import org.axonframework.extensions.multitenancy.components.MultiTenantSubscribableMessageSource; +import org.axonframework.extensions.multitenancy.components.TenantDescriptor; +import org.axonframework.common.Registration; + +import java.util.Collections; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ScheduledExecutorService; + +/** + * A multi-tenant persistent stream message source that extends PersistentStreamMessageSource + * and implements MultiTenantAwareComponent and MultiTenantSubscribableMessageSource interfaces. + *

+ * This class provides functionality to manage message sources for multiple tenants, + * allowing registration and management of tenant-specific persistent stream message sources. + * It maintains a concurrent map of tenant descriptors to their corresponding message sources. + *

+ *

+ * The class supports operations such as registering new tenants, starting tenants, + * and retrieving all tenant segments. It uses a factory to create tenant-specific + * message sources, ensuring proper initialization and configuration for each tenant. + *

+ * @author Stefan Dragisic + * @since 4.10.0 + */ +public class MultiTenantPersistentStreamMessageSource extends PersistentStreamMessageSource + implements MultiTenantAwareComponent, MultiTenantSubscribableMessageSource { + + private final String name; + private final Configuration configuration; + private final TenantPersistentStreamMessageSourceFactory tenantPersistentStreamMessageSourceFactory; + private final Map tenantSegments = new ConcurrentHashMap<>(); + private final PersistentStreamProperties persistentStreamProperties; + private final ScheduledExecutorService scheduler; + private final int batchSize; + private final String context; + + /** + * Constructs a new MultiTenantPersistentStreamMessageSource. + * + * @param name The name of the message source. + * @param persistentStreamProperties Properties for the persistent stream. + * @param scheduler The scheduled executor service for managing tasks. + * @param batchSize The size of each batch of messages to process. + * @param context The context in which this message source operates. + * @param configuration The configuration settings for the message source. + * @param tenantPersistentStreamMessageSourceFactory The factory for creating tenant-specific message sources. + */ + public MultiTenantPersistentStreamMessageSource(String name, PersistentStreamProperties + persistentStreamProperties, ScheduledExecutorService scheduler, int batchSize, String context, Configuration configuration, + TenantPersistentStreamMessageSourceFactory tenantPersistentStreamMessageSourceFactory) { + + super(name, configuration, persistentStreamProperties, scheduler, batchSize, context); + this.tenantPersistentStreamMessageSourceFactory = tenantPersistentStreamMessageSourceFactory; + this.name = name; + this.configuration = configuration; + this.persistentStreamProperties = persistentStreamProperties; + this.scheduler = scheduler; + this.batchSize = batchSize; + this.context = context; + } + + /** + * Registers a new tenant with the message source. + * + * @param tenantDescriptor The descriptor of the tenant to register. + * @return A Registration object that can be used to unregister the tenant. + */ + @Override + public Registration registerTenant(TenantDescriptor tenantDescriptor) { + PersistentStreamMessageSource tenantSegment = tenantPersistentStreamMessageSourceFactory.build(name, + persistentStreamProperties, scheduler, batchSize, context, configuration, tenantDescriptor); + tenantSegments.putIfAbsent(tenantDescriptor, tenantSegment); + + return () -> { + PersistentStreamMessageSource removed = tenantSegments.remove(tenantDescriptor); + return removed != null; + }; + } + + /** + * Registers and starts a new tenant with the message source. + * In this implementation, it's equivalent to just registering the tenant. + * This component doesn't require any additional steps to start a tenant. + * + * @param tenantDescriptor The descriptor of the tenant to register and start. + * @return A Registration object that can be used to unregister the tenant. + */ + @Override + public Registration registerAndStartTenant(TenantDescriptor tenantDescriptor) { + return registerTenant(tenantDescriptor); + } + + /** + * Returns a map of all registered tenant segments. + * + * @return An unmodifiable map where keys are TenantDescriptors and values are PersistentStreamMessageSources. + */ + @Override + public Map tenantSegments() { + return Collections.unmodifiableMap(tenantSegments); + } +} \ No newline at end of file diff --git a/multitenancy-spring-boot-autoconfigure/src/main/java/org/axonframework/extensions/multitenancy/autoconfig/TenantPersistentStreamMessageSourceFactory.java b/multitenancy/src/main/java/org/axonframework/extensions/multitenancy/components/eventstore/TenantPersistentStreamMessageSourceFactory.java similarity index 79% rename from multitenancy-spring-boot-autoconfigure/src/main/java/org/axonframework/extensions/multitenancy/autoconfig/TenantPersistentStreamMessageSourceFactory.java rename to multitenancy/src/main/java/org/axonframework/extensions/multitenancy/components/eventstore/TenantPersistentStreamMessageSourceFactory.java index 550697e..9a0a28c 100644 --- a/multitenancy-spring-boot-autoconfigure/src/main/java/org/axonframework/extensions/multitenancy/autoconfig/TenantPersistentStreamMessageSourceFactory.java +++ b/multitenancy/src/main/java/org/axonframework/extensions/multitenancy/components/eventstore/TenantPersistentStreamMessageSourceFactory.java @@ -1,4 +1,19 @@ -package org.axonframework.extensions.multitenancy.autoconfig; +/* + * Copyright (c) 2010-2024. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.axonframework.extensions.multitenancy.components.eventstore; import io.axoniq.axonserver.connector.event.PersistentStreamProperties; import org.axonframework.axonserver.connector.AxonServerConfiguration; @@ -16,7 +31,7 @@ * * This interface is used to create a {@link PersistentStreamMessageSource} for a given tenant, * @author Stefan Dragisic - * @since 4.10 + * @since 4.10.0 */ @FunctionalInterface public interface TenantPersistentStreamMessageSourceFactory { diff --git a/multitenancy-spring-boot-autoconfigure/src/test/java/org/axonframework/extensions/multitenancy/autoconfig/MultiTenantPersistentStreamMessageSourceTest.java b/multitenancy/src/test/java/org/axonframework/extensions/multitenancy/components/eventstore/MultiTenantPersistentStreamMessageSourceTest.java similarity index 82% rename from multitenancy-spring-boot-autoconfigure/src/test/java/org/axonframework/extensions/multitenancy/autoconfig/MultiTenantPersistentStreamMessageSourceTest.java rename to multitenancy/src/test/java/org/axonframework/extensions/multitenancy/components/eventstore/MultiTenantPersistentStreamMessageSourceTest.java index 1361053..7e53394 100644 --- a/multitenancy-spring-boot-autoconfigure/src/test/java/org/axonframework/extensions/multitenancy/autoconfig/MultiTenantPersistentStreamMessageSourceTest.java +++ b/multitenancy/src/test/java/org/axonframework/extensions/multitenancy/components/eventstore/MultiTenantPersistentStreamMessageSourceTest.java @@ -1,13 +1,27 @@ -package org.axonframework.extensions.multitenancy.autoconfig; +/* + * Copyright (c) 2010-2024. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.axonframework.extensions.multitenancy.components.eventstore; import io.axoniq.axonserver.connector.event.PersistentStreamProperties; -import org.axonframework.axonserver.connector.AxonServerConfiguration; import org.axonframework.axonserver.connector.event.axon.PersistentStreamMessageSource; import org.axonframework.config.Configuration; -import org.axonframework.extensions.multitenancy.autoconfig.MultiTenantPersistentStreamMessageSource; -import org.axonframework.extensions.multitenancy.autoconfig.TenantPersistentStreamMessageSourceFactory; +import org.axonframework.extensions.multitenancy.components.eventstore.MultiTenantPersistentStreamMessageSource; import org.axonframework.extensions.multitenancy.components.TenantDescriptor; import org.axonframework.common.Registration; +import org.axonframework.extensions.multitenancy.components.eventstore.TenantPersistentStreamMessageSourceFactory; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mock; @@ -49,7 +63,7 @@ void setUp() { } @Test - void testRegisterTenant() { + void registerTenant() { TenantDescriptor descriptor = new TenantDescriptor("testTenant"); when(factory.build(anyString(), any(), any(), anyInt(), anyString(), any(), eq(descriptor))) .thenReturn(mockTenantSource); @@ -66,7 +80,7 @@ void testRegisterTenant() { } @Test - void testRegisterAndStartTenant() { + void registerAndStartTenant() { TenantDescriptor descriptor = new TenantDescriptor("testTenant"); when(factory.build(anyString(), any(), any(), anyInt(), anyString(), any(), eq(descriptor))) .thenReturn(mockTenantSource); @@ -83,7 +97,7 @@ void testRegisterAndStartTenant() { } @Test - void testUnregisterTenant() { + void unregisterTenant() { TenantDescriptor descriptor = new TenantDescriptor("testTenant"); when(factory.build(anyString(), any(), any(), anyInt(), anyString(), any(), eq(descriptor))) .thenReturn(mockTenantSource); @@ -96,14 +110,7 @@ void testUnregisterTenant() { } @Test - void testUnregisterNonExistentTenant() { - TenantDescriptor descriptor = new TenantDescriptor("testTenant"); - Registration registration = () -> source.tenantSegments().remove(descriptor) != null; - assertFalse(registration.cancel()); - } - - @Test - void testRegisterMultipleTenants() { + void registerMultipleTenants() { TenantDescriptor descriptor1 = new TenantDescriptor("tenant1"); TenantDescriptor descriptor2 = new TenantDescriptor("tenant2"); @@ -122,7 +129,7 @@ void testRegisterMultipleTenants() { } @Test - void testTenantPersistentStreamMessageSourceFactory() { + void tenantPersistentStreamMessageSourceFactory() { TenantPersistentStreamMessageSourceFactory testFactory = (name, props, sched, batch, ctx, config, tenant) -> { assertEquals("testName", name); diff --git a/pom.xml b/pom.xml index 8a62b87..3c58252 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ ${project.basedir}/../coverage-report/target/site/jacoco-aggregate/jacoco.xml - 4.10.0-SNAPSHOT + 4.10.0 5.3.37 2.7.18