From 441e7bb9bfb6316027867a16a6556c4343ff8b42 Mon Sep 17 00:00:00 2001 From: Zdenek Jonas Date: Tue, 7 Nov 2023 10:55:49 +0100 Subject: [PATCH] refactor test --- .../boot/types/EclipseConfigurationSqlSpringTest.java | 2 +- .../integrations/spring/boot/types/StorageBeanTest.java | 2 +- .../spring/boot/types/root/AutostartRootTest.java | 6 ++---- .../test/resources/application-autostart-root.properties | 4 ++++ .../src/test/resources/application-run.properties | 3 +++ .../{sql-test.properties => application-sql.properties} | 0 .../src/test/resources/autostart-root.properties | 7 ------- 7 files changed, 11 insertions(+), 13 deletions(-) create mode 100644 integrations/spring-boot3/src/test/resources/application-autostart-root.properties create mode 100644 integrations/spring-boot3/src/test/resources/application-run.properties rename integrations/spring-boot3/src/test/resources/{sql-test.properties => application-sql.properties} (100%) delete mode 100644 integrations/spring-boot3/src/test/resources/autostart-root.properties diff --git a/integrations/spring-boot3/src/test/java/org/eclipse/store/integrations/spring/boot/types/EclipseConfigurationSqlSpringTest.java b/integrations/spring-boot3/src/test/java/org/eclipse/store/integrations/spring/boot/types/EclipseConfigurationSqlSpringTest.java index cfc316ce..7ac24c85 100644 --- a/integrations/spring-boot3/src/test/java/org/eclipse/store/integrations/spring/boot/types/EclipseConfigurationSqlSpringTest.java +++ b/integrations/spring-boot3/src/test/java/org/eclipse/store/integrations/spring/boot/types/EclipseConfigurationSqlSpringTest.java @@ -25,7 +25,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -@TestPropertySource("classpath:sql-test.properties") +@TestPropertySource("classpath:application-sql.properties") @SpringBootTest(classes = {EclipseStoreConfiguration.class}) public class EclipseConfigurationSqlSpringTest { diff --git a/integrations/spring-boot3/src/test/java/org/eclipse/store/integrations/spring/boot/types/StorageBeanTest.java b/integrations/spring-boot3/src/test/java/org/eclipse/store/integrations/spring/boot/types/StorageBeanTest.java index af48626f..44a1563b 100644 --- a/integrations/spring-boot3/src/test/java/org/eclipse/store/integrations/spring/boot/types/StorageBeanTest.java +++ b/integrations/spring-boot3/src/test/java/org/eclipse/store/integrations/spring/boot/types/StorageBeanTest.java @@ -27,7 +27,7 @@ import org.springframework.context.annotation.Primary; import org.springframework.test.context.TestPropertySource; -@TestPropertySource("classpath:application-test.properties") +@TestPropertySource("classpath:application-run.properties") @SpringBootTest(classes = {EclipseStoreConfiguration.class, StorageBeanTest.class}) public class StorageBeanTest { diff --git a/integrations/spring-boot3/src/test/java/org/eclipse/store/integrations/spring/boot/types/root/AutostartRootTest.java b/integrations/spring-boot3/src/test/java/org/eclipse/store/integrations/spring/boot/types/root/AutostartRootTest.java index 6a2feb27..4373fedf 100644 --- a/integrations/spring-boot3/src/test/java/org/eclipse/store/integrations/spring/boot/types/root/AutostartRootTest.java +++ b/integrations/spring-boot3/src/test/java/org/eclipse/store/integrations/spring/boot/types/root/AutostartRootTest.java @@ -1,17 +1,15 @@ package org.eclipse.store.integrations.spring.boot.types.root; import org.eclipse.store.integrations.spring.boot.types.EclipseStoreConfiguration; -import org.eclipse.store.storage.embedded.types.EmbeddedStorage; import org.eclipse.store.storage.embedded.types.EmbeddedStorageManager; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.TestPropertySource; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertTrue; -@TestPropertySource("classpath:autostart-root.properties") +@TestPropertySource("classpath:application-autostart-root.properties") @SpringBootTest(classes = {EclipseStoreConfiguration.class}) public class AutostartRootTest { diff --git a/integrations/spring-boot3/src/test/resources/application-autostart-root.properties b/integrations/spring-boot3/src/test/resources/application-autostart-root.properties new file mode 100644 index 00000000..c9800b65 --- /dev/null +++ b/integrations/spring-boot3/src/test/resources/application-autostart-root.properties @@ -0,0 +1,4 @@ +debug=true +org.eclipse.store.storage-directory=${java.io.tmpdir}/${random.int} +org.eclipse.store.auto-start=true +org.eclipse.store.root=org.eclipse.store.integrations.spring.boot.types.root.Root diff --git a/integrations/spring-boot3/src/test/resources/application-run.properties b/integrations/spring-boot3/src/test/resources/application-run.properties new file mode 100644 index 00000000..92e9e479 --- /dev/null +++ b/integrations/spring-boot3/src/test/resources/application-run.properties @@ -0,0 +1,3 @@ +debug=true +org.eclipse.store.storage-directory=${java.io.tmpdir}/${random.int} +org.eclipse.store.auto-start=false diff --git a/integrations/spring-boot3/src/test/resources/sql-test.properties b/integrations/spring-boot3/src/test/resources/application-sql.properties similarity index 100% rename from integrations/spring-boot3/src/test/resources/sql-test.properties rename to integrations/spring-boot3/src/test/resources/application-sql.properties diff --git a/integrations/spring-boot3/src/test/resources/autostart-root.properties b/integrations/spring-boot3/src/test/resources/autostart-root.properties deleted file mode 100644 index 474330da..00000000 --- a/integrations/spring-boot3/src/test/resources/autostart-root.properties +++ /dev/null @@ -1,7 +0,0 @@ -debug=true -org.eclipse.store.storage-filesystem.sql.postgres.data-source-provider=MyDataSourceProvider -org.eclipse.store.storage-filesystem.sql.postgres.password=password1 -org.eclipse.store.storage-filesystem.sql.postgres.user=postgres -org.eclipse.store.storage-directory=microstream_storage -org.eclipse.store.auto-start=true -org.eclipse.store.root=org.eclipse.store.integrations.spring.boot.types.root.Root