rename test profile and small changes
This commit is contained in:
@@ -63,20 +63,21 @@ open class Config(
|
|||||||
private var configFilePath: File? = null
|
private var configFilePath: File? = null
|
||||||
|
|
||||||
init {
|
init {
|
||||||
if (!env.activeProfiles.contains("test")) {
|
configFilePath = if (env.activeProfiles.contains("integration-test")) {
|
||||||
configFilePath = getConfigPath()
|
ResourceUtils.getFile("classpath:integration/dshackle.yaml")
|
||||||
Global.version = env.getProperty("version.app", Global.version).let {
|
|
||||||
if (it.contains("SNAPSHOT")) {
|
|
||||||
listOfNotNull(it, env.getProperty("version.commit")).joinToString("-")
|
|
||||||
} else {
|
|
||||||
it
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Security.addProvider(BouncyCastleProvider())
|
|
||||||
} else {
|
} else {
|
||||||
configFilePath = ResourceUtils.getFile("classpath:integration/dshackle.yaml")
|
getConfigPath()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Global.version = env.getProperty("version.app", Global.version).let {
|
||||||
|
if (it.contains("SNAPSHOT")) {
|
||||||
|
listOfNotNull(it, env.getProperty("version.commit")).joinToString("-")
|
||||||
|
} else {
|
||||||
|
it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Security.addProvider(BouncyCastleProvider())
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getConfigPath(): File {
|
fun getConfigPath(): File {
|
||||||
@@ -101,7 +102,7 @@ open class Config(
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@Profile("!test")
|
@Profile("!integration-test")
|
||||||
open fun mainConfig(@Autowired fileResolver: FileResolver): MainConfig {
|
open fun mainConfig(@Autowired fileResolver: FileResolver): MainConfig {
|
||||||
val f = configFilePath ?: throw IllegalStateException("Config path is not set")
|
val f = configFilePath ?: throw IllegalStateException("Config path is not set")
|
||||||
log.info("Using config: ${f.absolutePath}")
|
log.info("Using config: ${f.absolutePath}")
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import java.net.URI
|
|||||||
|
|
||||||
@SpringBootTest(properties = ["spring.main.allow-bean-definition-overriding=true"])
|
@SpringBootTest(properties = ["spring.main.allow-bean-definition-overriding=true"])
|
||||||
@Import(Config::class)
|
@Import(Config::class)
|
||||||
@ActiveProfiles("test")
|
@ActiveProfiles("integration-test")
|
||||||
class IntegrationTest {
|
class IntegrationTest {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -78,7 +78,7 @@ class IntegrationTest {
|
|||||||
@TestConfiguration
|
@TestConfiguration
|
||||||
open class Config {
|
open class Config {
|
||||||
@Bean
|
@Bean
|
||||||
@Profile("test")
|
@Profile("integration-test")
|
||||||
open fun mainConfig(@Autowired fileResolver: FileResolver): MainConfig {
|
open fun mainConfig(@Autowired fileResolver: FileResolver): MainConfig {
|
||||||
val reader = MainConfigReader(fileResolver)
|
val reader = MainConfigReader(fileResolver)
|
||||||
val config = reader.read(
|
val config = reader.read(
|
||||||
|
|||||||
Reference in New Issue
Block a user