티스토리 뷰
728x90
각Service를 추상화
ServiceImpl로 구현체 이름을 변경
Controller 패키지에Service 인터페이스 생성
public interface UserService {
User getByEmail(String email);
User getById(long id);
User create(UserCreate userCreate);
User update(long id, UserUpdate userUpdate);
void login(long id);
void verifyEmail(long id, String certificationCode);
}
public interface CertificationService {
void send(String email, long id, String certificationCode);
}
public interface PostService {
Post getById(long id);
Post create(PostCreate postCreate);
Post update(long id, PostUpdate postUpdate);
}
기존의Service 구현체 의존성을Service 인터페이스가 받도록 수정
private final UserService userService;
ControllerTest 리팩토링
SpringBoot 어노테이션 전부 제거.
특정 유저 정보를 가져오는get 메서드만 필요함
Service 인터페이스를 분할
728x90
'개발 > Spring' 카테고리의 다른 글
018 헥사고날 아키텍처 1 - Java/Spring 테스트를 추가하고 싶은 개발자들의 오답노트 (0) | 2024.07.14 |
---|---|
016 테스트를 소형 테스트로 만들기 - Java/Spring 테스트를 추가하고 싶은 개발자들의 오답노트 (0) | 2024.07.12 |
015 도메인에 테스트 추가하기 - Java/Spring 테스트를 추가하고 싶은 개발자들의 오답노트 (0) | 2024.07.12 |
014 도메인과 영속성 객체 구분하기 - Java/Spring 테스트를 추가하고 싶은 개발자들의 오답노트 (0) | 2024.07.10 |
013 외부 연동을 다루는 방법 - Java/Spring 테스트를 추가하고 싶은 개발자들의 오답노트 (0) | 2024.06.27 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 로그 모니터링
- 해커톤
- tdd
- it 동아리
- 백엔드
- 6팀
- aws 해커톤
- 유저 정보 가져오기
- test
- 연합 동아리
- 서버
- 육.지.행
- 스터디
- 프로그래머스
- 15기
- 해커톤 후기
- 파이썬
- python
- 리빙랩
- 런칭데이
- 중간발표
- spring boot
- 육지행
- 회고
- 글로컬
- 인프런
- 디프만
- 알고리즘
- AWS
- server
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
글 보관함