TMP
authorKai Moritz <kai@juplo.de>
Fri, 23 Feb 2024 11:01:43 +0000 (12:01 +0100)
committerKai Moritz <kai@juplo.de>
Fri, 23 Feb 2024 15:13:05 +0000 (16:13 +0100)
src/main/java/de/juplo/kafka/chat/backend/storage/nostorage/NoStorageStorageConfiguration.java
src/main/resources/application.yml
src/test/java/de/juplo/kafka/chat/backend/storage/mongodb/MongoDbStorageNotActiveConfiguration.java

index dc2bdfc..e27b298 100644 (file)
@@ -16,11 +16,6 @@ import org.springframework.context.annotation.Configuration;
     havingValue = "none",
     matchIfMissing = true)
 @Configuration
-@EnableAutoConfiguration(
-    exclude = {
-        MongoReactiveDataAutoConfiguration.class,
-        MongoReactiveRepositoriesAutoConfiguration.class,
-        MongoAutoConfiguration.class })
 public class NoStorageStorageConfiguration
 {
   @Bean
@@ -28,4 +23,19 @@ public class NoStorageStorageConfiguration
   {
     return new NoStorageStorageStrategy();
   }
+
+  @Configuration
+  @EnableAutoConfiguration(
+      exclude = {
+          MongoReactiveDataAutoConfiguration.class,
+          MongoReactiveRepositoriesAutoConfiguration.class,
+          MongoAutoConfiguration.class })
+  public static class DisableMongoConfiguration
+  {
+    @Bean
+    public String foo()
+    {
+      return "FOO";
+    }
+  }
 }
index b3d69ed..81d7af9 100644 (file)
@@ -18,8 +18,6 @@ import org.springframework.context.annotation.Configuration;
 import java.util.List;
 
 
-@AutoConfigureBefore(MongoReactiveAutoConfiguration.class)
-@ConditionalOnExpression("#{${chat.backend.inmemory.storage-strategy} != 'mongodb'}")
 @Configuration
 public class MongoDbStorageNotActiveConfiguration
 {