generated from pricelees/issue-pr-template
refactor: 테스트용 프로파일 / 로깅 설정 분리
This commit is contained in:
parent
dd4e022d6d
commit
f5192750c3
@ -12,6 +12,7 @@ import org.springframework.boot.test.context.TestConfiguration
|
||||
import org.springframework.boot.test.web.server.LocalServerPort
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Import
|
||||
import org.springframework.test.context.ActiveProfiles
|
||||
import roomescape.admin.infrastructure.persistence.AdminRepository
|
||||
import roomescape.member.infrastructure.persistence.MemberRepository
|
||||
import roomescape.member.infrastructure.persistence.UserRepository
|
||||
@ -26,6 +27,7 @@ object KotestConfig : AbstractProjectConfig() {
|
||||
}
|
||||
|
||||
@Import(TestConfig::class)
|
||||
@ActiveProfiles("test")
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
abstract class FunSpecSpringbootTest : FunSpec({
|
||||
extension(DatabaseCleanerExtension())
|
||||
|
||||
@ -1,5 +1,47 @@
|
||||
logging:
|
||||
level:
|
||||
root: INFO
|
||||
org.springframework.orm.jpa: INFO
|
||||
org.springframework.transaction: DEBUG
|
||||
config: classpath:logback-test.xml
|
||||
|
||||
spring:
|
||||
jpa:
|
||||
properties:
|
||||
hibernate:
|
||||
format_sql: true
|
||||
hibernate:
|
||||
ddl-auto: validate
|
||||
datasource:
|
||||
hikari:
|
||||
jdbc-url: jdbc:h2:mem:test
|
||||
driver-class-name: org.h2.Driver
|
||||
username: sa
|
||||
password:
|
||||
sql:
|
||||
init:
|
||||
mode: always
|
||||
schema-locations: classpath:schema/schema-h2.sql
|
||||
|
||||
security:
|
||||
jwt:
|
||||
token:
|
||||
secret-key: daijawligagaf@LIJ$@U)9nagnalkkgalijaddljfi
|
||||
ttl-seconds: 1800
|
||||
|
||||
payment:
|
||||
confirm-secret-key: test_gsk_docs_OaPz8L5KdmQXkzRz3y47BMw6
|
||||
read-timeout: 3
|
||||
connect-timeout: 30
|
||||
|
||||
jdbc:
|
||||
datasource-proxy:
|
||||
enabled: true
|
||||
include-parameter-values: false
|
||||
query:
|
||||
enable-logging: true
|
||||
log-level: DEBUG
|
||||
logger-name: all-query-logger
|
||||
multiline: true
|
||||
includes: connection,query,keys,fetch
|
||||
|
||||
management:
|
||||
tracing:
|
||||
sampling:
|
||||
probability: 1
|
||||
20
src/test/resources/logback-test.xml
Normal file
20
src/test/resources/logback-test.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<include resource="logback-local.xml"/>
|
||||
|
||||
<logger name="roomescape" level="INFO" additivity="false">
|
||||
<appender-ref ref="CONSOLE" />
|
||||
</logger>
|
||||
|
||||
<logger name="org.springframework.orm.jpa" level="INFO" additivity="false">
|
||||
<appender-ref ref="CONSOLE" />
|
||||
</logger>
|
||||
|
||||
<logger name="org.springframework.transaction" level="INFO" additivity="false">
|
||||
<appender-ref ref="CONSOLE" />
|
||||
</logger>
|
||||
|
||||
<logger name="all-query-logger" level="INFO" additivity="false">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
</configuration>
|
||||
Loading…
x
Reference in New Issue
Block a user