간단한 토이 프로젝트를 레이어드 아키텍처로 구성하여 테스트 코드 작성 해보기
Last updated 2 months ago
Java 21
Spring Boot 3.4.2
spring boot web
spring data JPA
H2 Database
Lombok
spring: profiles: default: local datasource: url: jdbc:h2:mem:~/cafeKioskApplication driver-class-name: org.h2.Driver username: sa password: jpa: hibernate: ddl-auto: none --- spring: config: activate: on-profile: local jpa: hibernate: ddl-auto: create show-sql: true properties: hibernate: format_sql: true defer-datasource-initialization: true # (spring boot 2.5 ~) Hibernate 초기화 이후 data.sql 실행 h2: console: enabled: true --- spring: config: activate: on-profile: test jpa: hibernate: ddl-auto: create show-sql: true properties: hibernate: format_sql: true sql: init: mode: never
insert into product(product_number, type, selling_status, name, price) values ('001', 'HANDMADE', 'SELLING', '아메리카노', 4000), ('002', 'HANDMADE', 'HOLD', '카페라떼', 4500), ('003', 'BAKERY', 'STOP_SELLING', '크루아상', 3500);