merge: влить dev (ПУУД, angular-motion-lib, fix requests) в tgu-ops-ui
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
package org.nstart.dep265.requestservice
|
||||
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
import kotlin.io.path.readText
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
class RequestServiceConfigTest {
|
||||
@Test
|
||||
fun `local profile uses concrete postgres datasource`() {
|
||||
val config = configRepositoryFile().readText()
|
||||
|
||||
assertTrue(config.contains("on-profile: local"))
|
||||
assertTrue(config.contains("url: jdbc:postgresql://\${pcp.infra.postgres.host}:\${pcp.infra.postgres.port}/pcp_requests"))
|
||||
assertTrue(config.contains("username: postgres"))
|
||||
assertTrue(config.contains("password: password"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `shared datasource keeps environment placeholders for deployed profiles`() {
|
||||
val config = configRepositoryFile().readText()
|
||||
|
||||
assertTrue(config.contains("url: \"\${SPRING_DATASOURCE_URL}\""))
|
||||
assertTrue(config.contains("username: \"\${SPRING_DATASOURCE_USERNAME}\""))
|
||||
assertTrue(config.contains("password: \"\${SPRING_DATASOURCE_PASSWORD}\""))
|
||||
}
|
||||
|
||||
private fun configRepositoryFile(): Path {
|
||||
val rootPath = Path.of("config-repo/pcp-request-service.yaml")
|
||||
if (Files.exists(rootPath)) {
|
||||
return rootPath
|
||||
}
|
||||
return Path.of("../../config-repo/pcp-request-service.yaml")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user