forked from blcham/record-manager
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#84] Replace application.properties with application.yml in tests
- Loading branch information
Showing
7 changed files
with
44 additions
and
22 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
23 changes: 23 additions & 0 deletions
23
src/test/java/cz/cvut/kbss/study/persistence/ConfigDataApplicationContextInitializer.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,23 @@ | ||
package cz.cvut.kbss.study.persistence; | ||
|
||
import org.springframework.boot.DefaultBootstrapContext; | ||
import org.springframework.boot.DefaultPropertiesPropertySource; | ||
import org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor; | ||
import org.springframework.boot.env.RandomValuePropertySource; | ||
import org.springframework.context.ApplicationContextInitializer; | ||
import org.springframework.context.ConfigurableApplicationContext; | ||
import org.springframework.core.env.ConfigurableEnvironment; | ||
|
||
public class ConfigDataApplicationContextInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> { | ||
public ConfigDataApplicationContextInitializer() { | ||
} | ||
|
||
public void initialize(ConfigurableApplicationContext applicationContext) { | ||
ConfigurableEnvironment environment = applicationContext.getEnvironment(); | ||
RandomValuePropertySource.addToEnvironment(environment); | ||
DefaultBootstrapContext bootstrapContext = new DefaultBootstrapContext(); | ||
ConfigDataEnvironmentPostProcessor.applyTo(environment, applicationContext, bootstrapContext, new String[0]); | ||
bootstrapContext.close(applicationContext); | ||
DefaultPropertiesPropertySource.moveToEnd(environment); | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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,4 @@ | ||
persistenceDriver: cz.cvut.kbss.ontodriver.rdf4j.Rdf4jDataSource | ||
repositoryUrl: study-test-repository | ||
formGenRepositoryUrl: test-formGen-repository | ||
formGenServiceUrl: http://localhost:8081/formGenerator |