테스트코드

problem 누구나 한번쯤 테스트 코드를 짜다보면 이런 생각을 해봤을 것이다. " 누가 테스트 데이터 좀 자동으로 만들어주면 안되나... " 그래서 찾았다.... solution 네이버페이에서 개발한 오픈소스 Fixture Monkey https://github.com/naver/fixture-monkey GitHub - naver/fixture-monkey: Let Fixture Monkey generate test instances including edge cases automatically Let Fixture Monkey generate test instances including edge cases automatically - naver/fixture-monkey github.com Buil..
given() Mock 객체인 -> productService .getProduct 메서드에 "12315" 를 넣으면 .willReturn( 응답값 ) perform() RESTAPI TEST를 할 수 있는 환경을 만들어준다. >> get - get요청 / post , get , put , delete 어떤 Http통신을 할지 정의를 해줌 - builder구조를 사용한다 ( . 을사용하여 옵션 사용 ) - andExpect() 기대하는 값이 나왔는지 체크해볼 수 있는 메소드 - jsonPath() 기대하는 json값이 나왔는지 - exists() [현재 값이 있는지 판단] -andDo(print()) 위에서 테스트 한 내용을 프린트 verify() 해당 객체의 메소드가 실행 되었는지 체크 값을 Json..
imSoo
'테스트코드' 태그의 글 목록