0
어떻게 Mockito를 사용하여 Jax RS Client를 모의 할 수 있습니까?Jax Rs 2.0 Rest Client Response를 조롱하는 방법?
Foo expected = new Foo();
when(restClient.target(anyString())
.path(anyString()) //Got NPE here
.request(MediaType.APPLICATION_JSON)
.post(Entity.entity(expected, MediaType.APPLICATION_JSON))
.readEntity(Foo.class)
).thenReturn(expected);
적절한 답변과 함께 답변을 작성하십시오. – richersoon
이 작업을 수행하려면 "대상", "경로", "요청", "게시"및 "readEnity"메소드가 반환되는지 알아야합니다. –
any() 할 수 있습니다. – richersoon