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

[2기 - 흑구] 5주차 RBF

주차
SpringBoot Part3
회고일
Apr 22, 2022
참여자
멘토
Property
tag
문정현
스프링과 MySQL 연동 과정
  1. 도커로 MySQL 컨테이너 생성
  1. customer, voucher 테이블 생성
  1. 스프링 서버 주소에 대한 테이블 접근 권한 부여
  1. 빈 컨텍스트 파일로 DataSource, JdbcTemplate, NamedParameterJdbcTemplate 빈 등록
자바 스프링 웹어플리케이션 세팅 과정
@EnableWebMvc를 context 클래스에 붙여 WebApplication Context파일을 생성한다. 추가적인 view resolver의 커스터마이징과 같은 설정이 필요한 경우에는 WebMvcConfigurer 인터페이스를 상속받은 후 필요한 추가 설정 메소드를 작성하면 된다. @EnableWebMvc @Configuration @ComponentScan public class AppContext implements WebMvcConfigurer { //view resolver와 관련된 설정 메소드 @Override public void configureViewResolvers(ViewResolverRegistry registry) { registry.jsp(); } //추가적인 빈 설정..
자바 스프링 웹어플리케이션 세팅 과정
https://velog.io/@y005/%EC%9E%90%EB%B0%94-%EC%8A%A4%ED%94%84%EB%A7%81-%EC%9B%B9%EC%96%B4%ED%94%8C%EB%A6%AC%EC%BC%80%EC%9D%B4%EC%85%98-%EC%84%B8%ED%8C%85-%EA%B3%BC%EC%A0%95
자바 스프링 웹어플리케이션 세팅 과정
정해민
assertj 필드 비교를 통해 객체 비교하기 - usingRecursiveComparison()
AssertJ - fluent assertions java library
entry point for all assertThat methods and utility methods (e.g. entry) import static org.assertj.core.api.Assertions.*; // basic assertions assertThat(frodo.getName()).isEqualTo("Frodo"); assertThat(frodo).isNotEqualTo(sauron); // chaining string specific assertions assertThat(frodo.getName()).startsWith("Fro") .endsWith("do") .isEqualToIgnoringCase("frodo"); // collection specific assertions (there are plenty more) // in the examples below fellowshipOfTheRing is a List assertThat(fellowshipOfTheRing).hasSize(9) .contains(frodo, sam) .doesNotContain(sauron); // as() is used to describe the test and will be shown before the error message assertThat(frodo.getAge()).as("check %s's age", frodo.getName()).isEqualTo(33); // exception assertion, standard style ...
AssertJ - fluent assertions java library
https://assertj.github.io/doc/#assertj-core-recursive-comparison
AssertJ - fluent assertions java library
yaml 파일 여러개 설정하여 사용하기
Springboot application.yml 여러개 설정하기
예전에 application.yml (or application.properties) 분리하는 방법에 대해 기술한적이 있다. springboot 2.4 이상버전부터는 위와 같은 방법을 사용하지 않아도 된다. (springboot 2.4 미만은 위의 글을 참조해서 설정한다.) 바로 spring.config.import 를 이용하여 여러개의 properties 파일을 참조할 수 있다. spring: config: import: - classpath:/config/a-config.yml - classpath:/config/b-config.yml - classpath:/config/c-config.yml 이런식으로 여러개의 yml을 가지고 올 수 있다.
Springboot application.yml 여러개 설정하기
https://oingdaddy.tistory.com/464
Springboot application.yml 여러개 설정하기
 
최지훈
@PathVariable Annotation에 대한 개념 확인!
💡
https://www.baeldung.com/spring-pathvariable
 
최현웅
@PropertyScan yaml file 인식 문제
Spring boot @PropertySource로 yml 로드 방법
프로젝트를 진행하면서 카카오,네이버에서 제공하는 API를 호출할때 필요한 secret key를 property파일로 분리 한 후 Bean,Configuration으로 등록하여 호출 시 해당 secrey key를 API 호출 시 실어 사용하는 경우가 많았습니다. 이때 많은 사람들이 yml를 사용하지 않고 properties를 사용하는데 저는 yml를 사용하고 하고 싶어서 찾아낸 방법을 공유하고자 합니다. 그러면 우선 @PropertySource를 알아야 할 것 같습니다.
Spring boot @PropertySource로 yml 로드 방법
https://pooney.tistory.com/88
Spring boot @PropertySource로 yml 로드 방법