본문 바로가기

Spring12

@Builder 와 @AllArgsConstructor @NoArgsConstructor 개요 Spring 프로젝트 중 생성자에 값을 넣어주는 문제에 대해 잠시 고민해보았다. 생성자에 넣어주는 값이 예를 들면 title만 넣으려다 title, name, phoneNumber 로 늘어나게 된다면 생성자 수정/추가가 계속 필요하다. 그래서 찾아보던 중 @Builder를 사용해보고자 했다. @Getter public class ColResponseDto { private String title; private int position; private Long boardId; public ColResponseDto(Col columns) { this.title = columns.getTitle(); this.position = columns.getPosition(); this.boardId = col.. 2023. 11. 23.
[Spring][error]parameter 0 of constructor in Junit 테스트 후 스프링부트 실행 중 다음과 같은 오류가 났다. *************************** APPLICATION FAILED TO START *************************** Description: Parameter 0 of constructor in com.*****UserDetailsServiceImpl required a bean of type 'com.example.hanghaero.repository.UserRepository' that could not be found. Action: Consider defining a bean of type 'com.*******' in your configuration. 빈이 등록되지 않아서 찾을 수 없다는 오류 .. 2023. 11. 22.
[Junit5테스트 에러] Parameter 0 of constructor in {###} required a bean of type '{###}' that could not be found. Junit5로 테스트를 하는 도중 에러가 났다. 빈으로 등록을 해주지 않아서 생긴 문제였다... @MockBean을 등록해주어야 한다. 삽질 끝 2023. 11. 22.
맥북(Mac OS) 아나콘다 및 주피터 실행 conda remove --name "가상환경명"​ 윈도우랑 맥북이랑 명령어가 좀 달라서 작성함 (1) 설치 완료 및 패키지를 통해 수행되지 않은 업데이트를 진행 # 아나콘다 버전 확인 conda --version # 아나콘다 최신버전 업데이트 conda update conda (2) 새로운 가상환경 생성하기 conda create --name "가상환경명" python="파이썬 버전" (3) 가상환경 삭제하기 conda remove --name "가상환경명" (4) 가상환경 목록 확인하기 conda info --envs (5) 생성한 가상환경 활성화하기 conda activate "가상환경명" 2023. 11. 19.