본문 바로가기 메뉴 바로가기

lingi04

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

lingi04

검색하기 폼
  • 분류 전체보기 (52)
    • 책 (20)
      • 오브젝트 (12)
      • 이펙티브 자바 (0)
      • 시스템 디자인 (2)
      • 데이터 중심 애플리케이션 설계 (6)
    • 프로그래밍 (4)
    • experiences (13)
      • 과제리뷰 (2)
      • refactoring (4)
    • spring boot (12)
      • snippets (7)
      • SpringBoot Test (1)
    • Redis (3)
  • 방명록

InjectMock (1)
mocking 하는 방법

import static org.mockito.Mockito.mock; public class TestClass { @ParameterizedTest public void test() { DummyRepository repository = mock(DummyRepository.class); DummyService service = new DummyService(repository); DummyClass dummy = new DummyClass(); Param param = new Param(); given(repository.getById(dummy.getId())).willReturn(dummy); service.update(dummy.getId(), param, "username"); assertTh..

spring boot/snippets 2021. 12. 22. 23:15
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday

Blog is powered by Tistory / Designed by Tistory

티스토리툴바