From 12f4f86b94e9947af42a13ea4779c67687071eb5 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 23 Feb 2024 12:42:34 +0100 Subject: [PATCH] TMP --- .../mongodb}/MongoDbStorageNotActiveConfiguration.java | 4 +++- .../storage/nostorage/NoStorageStorageConfiguration.java | 9 --------- 2 files changed, 3 insertions(+), 10 deletions(-) rename src/{test/java/de/juplo/kafka/chat/backend => main/java/de/juplo/kafka/chat/backend/storage/mongodb}/MongoDbStorageNotActiveConfiguration.java (62%) diff --git a/src/test/java/de/juplo/kafka/chat/backend/MongoDbStorageNotActiveConfiguration.java b/src/main/java/de/juplo/kafka/chat/backend/storage/mongodb/MongoDbStorageNotActiveConfiguration.java similarity index 62% rename from src/test/java/de/juplo/kafka/chat/backend/MongoDbStorageNotActiveConfiguration.java rename to src/main/java/de/juplo/kafka/chat/backend/storage/mongodb/MongoDbStorageNotActiveConfiguration.java index 47d4c7d8..18ec2416 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/MongoDbStorageNotActiveConfiguration.java +++ b/src/main/java/de/juplo/kafka/chat/backend/storage/mongodb/MongoDbStorageNotActiveConfiguration.java @@ -1,11 +1,13 @@ -package de.juplo.kafka.chat.backend; +package de.juplo.kafka.chat.backend.storage.mongodb; import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Lazy; +@ConditionalOnExpression("#{${chat.backend.inmemory.storage-strategy} != 'mongodb'}") @Configuration @Slf4j public class MongoDbStorageNotActiveConfiguration diff --git a/src/main/java/de/juplo/kafka/chat/backend/storage/nostorage/NoStorageStorageConfiguration.java b/src/main/java/de/juplo/kafka/chat/backend/storage/nostorage/NoStorageStorageConfiguration.java index d497d957..47e59783 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/storage/nostorage/NoStorageStorageConfiguration.java +++ b/src/main/java/de/juplo/kafka/chat/backend/storage/nostorage/NoStorageStorageConfiguration.java @@ -5,7 +5,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Lazy; @ConditionalOnProperty( @@ -22,12 +21,4 @@ public class NoStorageStorageConfiguration { return new NoStorageStorageStrategy(); } - - @Bean - @Lazy(false) - public String foo() - { - log.info("FOO (woanders)!"); - return "FOO"; - } } -- 2.20.1