반응형
junit
-
Mock 객체 확인백기선(인프런 강의)/더 자바, 애플리케이션을 테스트하는 다양한 방법 2020. 5. 29. 08:58
Mock 객체가 어떻게 사용됐는지 확인이 가능하다. 예시코드는 아래의 깃사이트에서 다운로드 받을 수 있으며 https://github.com/keesun/inflearn-the-java-test 캡쳐한 index를 다운받으면 된다. Verifying exact number of invocations javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html#exact_verification 특정 메소드가 특정 매개변수로 몇번 호출 되었는지, 최소 한번은 호출됐는지, 전혀 호출되지 않았는지 예시코드 import static org.junit.jupiter.api.Assertions.assertEquals; import static org..