WAS:TMP:IS?FIX:WIP:test: `*ConfigurationIT` asserts, if restored messages can be...
[demos/kafka/chat] / src / main / java / de / juplo / kafka / chat / backend / ChatBackendConfiguration.java
index f49e385..ad944fa 100644 (file)
@@ -1,5 +1,10 @@
 package de.juplo.kafka.chat.backend;
 
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
+import org.springframework.boot.autoconfigure.data.mongo.MongoReactiveDataAutoConfiguration;
+import org.springframework.boot.autoconfigure.data.mongo.MongoReactiveRepositoriesAutoConfiguration;
+import org.springframework.boot.autoconfigure.mongo.MongoReactiveAutoConfiguration;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -16,4 +21,15 @@ public class ChatBackendConfiguration
   {
     return Clock.systemDefaultZone();
   }
+
+
+  @ConditionalOnExpression("!'${chat.backend.inmemory.storage-strategy}'.toLowerCase().equals('mongodb')")
+  @Configuration
+  @EnableAutoConfiguration(exclude = {
+      MongoReactiveDataAutoConfiguration.class,
+      MongoReactiveAutoConfiguration.class,
+      MongoReactiveRepositoriesAutoConfiguration.class })
+  public static class DisableMongoDBConfiguration
+  {
+  }
 }