사용자 도구

사이트 도구


java:mockito

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판 양쪽 다음 판
java:mockito [2015/12/09 19:30]
kwon37xi
java:mockito [2016/01/05 22:38]
kwon37xi
줄 5: 줄 5:
 ====== argThat ====== ====== argThat ======
 ''argThat''과 [[http://mockito.github.io/mockito/docs/current/org/mockito/ArgumentMatcher.html|ArgumentMatcher]]를 조합하여 동적인 인자 비교가 가능하다. ''when''과 ''verify''에서 모두 사용가능하다. ''argThat''과 [[http://mockito.github.io/mockito/docs/current/org/mockito/ArgumentMatcher.html|ArgumentMatcher]]를 조합하여 동적인 인자 비교가 가능하다. ''when''과 ''verify''에서 모두 사용가능하다.
 +
 +이를 사용하면 특히 테스트 대상 메소드 내부에서 직접 ''new''로 생성한 값에 대해 ''when''에서 ''ArgumentCaptor''없이 비교가능하여 불필요한 ''verify''호출을 줄일 수 있다.
  
 [[http://mockito.github.io/mockito/docs/current/org/mockito/ArgumentMatcher.html|ArgumentMatcher]] 문서를 참조하면 된다. [[http://mockito.github.io/mockito/docs/current/org/mockito/ArgumentMatcher.html|ArgumentMatcher]] 문서를 참조하면 된다.
java/mockito.txt · 마지막으로 수정됨: 2023/11/30 14:17 저자 kwon37xi