HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
🚀
Random Bit Flip
/
[2기 - 훈] 5주차 RBF
[2기 - 훈] 5주차 RBF
[2기 - 훈] 5주차 RBF

[2기 - 훈] 5주차 RBF

주차
SpringBoot Part3
회고일
Apr 22, 2022
참여자
멘토
Property
tag
5주차 부터는 매일 진행하는 스크럼에서 나눈 내용을 기록할 계획입니다
1주 간의 수업과 과제를 진행하면서 새로 알게 된 개념이나 잘못 알았던 개념에 대해 이야기 해봅시다.

wix-embedded-mysql

notion image
wix 라이브러리가 deprecated 되어 Testcontainers를 사용하길 권장
https://www.testcontainers.org/
 

이번 과제에서 사용법

gradle 설정
예제 코드
 

Voucher 테이블

Voucher 인터페이스 삭제

인터페이스를 삭제하고 클래스 별로 Voucher 생성
 

타입을 Voucher 테이블 안에서 관리

타입을 연관관계 테이블에서 관리

 

@Parameterized

https://www.baeldung.com/parameterized-tests-junit-5
 

이메일 검증 정규식

www.baeldung.com
https://www.baeldung.com/java-email-validation-regex
 

AssertJ 에서 throw를 처리하는 방법

www.baeldung.com
https://www.baeldung.com/assertj-exception-assertion
 

React 강의 오류

 
import 후에 React만 적으셔야 됩니다.
 
testImplementation "org.testcontainers:testcontainers:1.16.3" testImplementation "org.testcontainers:junit-jupiter:1.16.3" testImplementation "org.testcontainers:mysql:1.16.3"
@Testcontainers class Test { @Container private static final MySQLContainer mySQLContainer = new MySQLContainer("mysql:8.0.11"); @Configuration @ComponentScan( basePackages = {"org.prgrms.kdt.customer"}) static class Config { @Bean public DataSource dataSource() { mySQLContainer.withInitScript("schema.sql").start(); var dataSource = DataSourceBuilder .create() .driverClassName("com.mysql.cj.jdbc.Driver") .url(mySQLContainer.getJdbcUrl()) .username(mySQLContainer.getUsername()) .password(mySQLContainer.getPassword()) .type(HikariDataSource.class) .build(); return dataSource; } } }
CREATE TABLE Voucher{ voucher_id binary(16) ... voucher_type varchar(15) }
CREATE TABLE WALLET? { voucher_id binary(16) customer_id binary(16) voucher_type varchar(15) }
import React, {useEffect, useState} from 'react';