Class TestDataSourceConfigurer
java.lang.Object
com.foreach.across.test.support.config.TestDataSourceConfigurer
- All Implemented Interfaces:
AcrossContextConfigurer
,org.springframework.beans.factory.Aware
,org.springframework.context.EnvironmentAware
@Order(-2147483648)
@Configuration
@PropertySource("classpath:across-test.properties") @PropertySource(value="file:${user.home}/dev-configs/across-test.properties",ignoreResourceNotFound=true)
public class TestDataSourceConfigurer
extends Object
implements org.springframework.context.EnvironmentAware, AcrossContextConfigurer
Adds support for test datasource detection to an
AcrossContext
.
DevelopmentModeCondition datasources can be configured in the ${user.home}/dev-configs/across-test.properties with properties
of the form:
- acrossTest.datasource.NAME.driver
- acrossTest.datasource.NAME.url
- acrossTest.datasource.NAME.username
- acrossTest.datasource.NAME.password
If no specific datasource is set, this configuration will ensure that a HSQL memory database is used.
If the AcrossContext
already has a datasource configured, it will kept.
To use this in IntelliJ, go the across-bamboo-specs repository, and run:
docker-compose -f docker-dbs.yml up
- Since:
- 1.1.2
- Author:
- Arne Vandamme
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(AcrossContext context) void
setDataSourceName
(String dataSourceName) void
setEnvironment
(@NotNull org.springframework.core.env.Environment environment)
-
Constructor Details
-
TestDataSourceConfigurer
public TestDataSourceConfigurer()
-
-
Method Details
-
setEnvironment
public void setEnvironment(@NotNull @NotNull org.springframework.core.env.Environment environment) - Specified by:
setEnvironment
in interfaceorg.springframework.context.EnvironmentAware
-
setDataSourceName
-
configure
- Specified by:
configure
in interfaceAcrossContextConfigurer
-
testDataSource
-