Junit Test Application-2-yml 세팅

jaegeunsong97·2023년 8월 2일
0

Junit Bank Application 깃허브

Junit Bank Application 기록 노션

  • application-dev.yml
server:
  port: 8081
  servlet:
    encoding:
      charset: utf-8
      force: true

spring:
  datasource:
    url: jdbc:h2:mem:test;MODE=MySQL
    driver-class-name: org.h2.Driver
    username: sa
    password: 
  h2:
    console:
      enabled: true
  jpa:
    open-in-view: false
    hibernate:
      ddl-auto: create
    properties:
      '[hibernate.default_batch_fetch_size]': 100
      '[hibernate.format_sql]': true
    show-sql: true
  output:
    ansi:
      enabled: always

logging:
  level:
    '[shop.mtcoding.bank]': DEBUG
    '[org.hibernate.type]': TRACE
  • application-prod.yml
server:
  port: 5000 # 배포
  servlet:
    encoding:
      charset: utf-8
      force: true

spring:
  datasource:
    url: jdbc:mariadb://${rds.hostname}:${rds.port}/${rds.db.name}
    driver-class-name: org.mariadb.jdbc.Driver
    username: ${rds.username}
    password: ${rds.password}
  jpa:
    open-in-view: false
    hibernate:
      ddl-auto: none
    properties:
      '[hibernate.default_batch_fetch_size]': 100

logging:
  level:
    '[shop.mtcoding.bank]': INFO
  • application-test.yml
server:
  port: 8080
  servlet:
    encoding:
      charset: utf-8
      force: true

spring:
  datasource:
    url: jdbc:h2:mem:test;MODE=MySQL
    driver-class-name: org.h2.Driver
    username: sa
    password: 
  h2:
    console:
      enabled: true
  jpa:
    open-in-view: false
    hibernate:
      ddl-auto: create
    properties:
      '[hibernate.default_batch_fetch_size]': 100
      '[hibernate.format_sql]': true
    show-sql: true
  output:
    ansi:
      enabled: always

logging:
  level:
    '[shop.mtcoding.bank]': DEBUG
    '[org.hibernate.type]': TRACE
  • application.yml

dev로 되어있으면 application-dev를 읽는다.

spring:
  profiles:
    active:
    - dev
profile
블로그 이전 : https://medium.com/@jaegeunsong97

0개의 댓글