-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add disable key to control auto-creation of defaults bean. add conditional creating of beans define own bean interface for StorageFoundation Supplier remove Component annotation to prevent two beans..
- Loading branch information
1 parent
5cabb32
commit 317ff89
Showing
8 changed files
with
114 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...pse/store/integrations/spring/boot/types/suppliers/EmbeddedStorageFoundationSupplier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.eclipse.store.integrations.spring.boot.types.suppliers; | ||
|
||
/*- | ||
* #%L | ||
* EclipseStore Integrations SpringBoot | ||
* %% | ||
* Copyright (C) 2023 - 2024 MicroStream Software | ||
* %% | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* #L% | ||
*/ | ||
|
||
import org.eclipse.store.storage.embedded.types.EmbeddedStorageFoundation; | ||
|
||
@FunctionalInterface | ||
public interface EmbeddedStorageFoundationSupplier<T extends EmbeddedStorageFoundation<?>> extends java.util.function.Supplier<T> | ||
{ | ||
} |
41 changes: 41 additions & 0 deletions
41
...c/test/java/test/eclipse/store/integrations/spring/boot/DisableStorageAutoCreateTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package test.eclipse.store.integrations.spring.boot; | ||
|
||
/*- | ||
* #%L | ||
* EclipseStore Integrations SpringBoot | ||
* %% | ||
* Copyright (C) 2023 - 2024 MicroStream Software | ||
* %% | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* #L% | ||
*/ | ||
|
||
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.NoSuchBeanDefinitionException; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.context.ApplicationContext; | ||
import org.springframework.test.context.ActiveProfiles; | ||
import org.springframework.test.context.TestPropertySource; | ||
|
||
@TestPropertySource("classpath:application-storage-create-disable.properties") | ||
@SpringBootTest | ||
@ActiveProfiles("disable_auto_create") | ||
public class DisableStorageAutoCreateTest | ||
{ | ||
|
||
@Autowired | ||
ApplicationContext context; | ||
|
||
@Test | ||
void name() | ||
{ | ||
Assertions.assertThrows(NoSuchBeanDefinitionException.class, () -> context.getBean(EmbeddedStorageManager.class)); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
integrations/spring-boot3/src/test/resources/application-storage-create-disable.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
org.eclipse.store.auto-create-default-storage=false | ||
org.eclipse.store.auto-create-default-foundation=false |