Notice
Recent Posts
Recent Comments
Link
HwangHub
[Junit] 토이 프로젝트 for JUnit practice : Bank App 1 - 환경 설정 본문
workspace/server_application
[Junit] 토이 프로젝트 for JUnit practice : Bank App 1 - 환경 설정
HwangJerry 2023. 7. 27. 11:30프로젝트 시작하기
기본 의존성 추가 (스프링부트3 + 자바17 사용)
maven repository에 접속해서 jwt 의존성 추가 (작성일 기준 최신 버전)
프로파일 설정
## 개발환경 기본 세팅
server:
port: 8081
servlet:
encoding:
charset: UTF-8
force: true
spring:
config:
activate:
on-profile: dev # 프로파일 설정
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
format_sql: true
show-sql: true
output:
ansi:
enabled: always
logging:
level:
'[study.junit.bank]':DEBUG
## 배포환경 기본 세팅
server:
port: 5000
servlet:
encoding:
charset: UTF-8
force: true
spring:
config:
activate:
on-profile: prod # 프로파일 설정
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:
'[study.junit.bank]':INFO
## 테스트 환경 기본 세팅
server:
port: 8080
servlet:
encoding:
charset: UTF-8
force: true
spring:
config:
activate:
on-profile: test # 프로파일 설정
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
format_sql: true
show-sql: true
output:
ansi:
enabled: always
logging:
level:
'[study.junit.bank]': DEBUG
'[study.junit.bank]': TRACE
참고:
스프링부트 JUnit 테스트 - 시큐리티를 활용한 Bank 애플리케이션 - 정리 1
한달정도 Spring으로 게시판을 5번정도 시큐리티까지 적용해서 만들어보면서 다른 부분은 이해 했는데 test 부분을 제대로 적용해서 만들지 못한거 같아서 관련 강의를 찾아보았다!책으로 볼까도
velog.io
'workspace > server_application' 카테고리의 다른 글
[Spring] @Bean과 @Configuration, @Component (0) | 2023.07.28 |
---|---|
[JUnit] 토이 프로젝트 for JUnit practice : Bank App 2 - SecurityConfig (0) | 2023.07.27 |
[JUnit] MockMVC로 Controller 테스트하기 (0) | 2023.07.26 |
[이펙티브자바] @Builder를 클래스 레벨이 아닌 생성자 레벨에 사용 (0) | 2023.07.25 |
[고민] 유저가 작성한 게시글 조회는 누구의 관심사인가 (0) | 2023.07.24 |
Comments