문제

My mock object has this method I want to verify being called:

void postResource(String url, int x, String[][] headers)

How do I use the any() methods to verify if postResource was called with any headers parameter?

http = mock(Http.class);
verify(http, never()).postResource(anyString, anyInt(), ?)

Even better, is there a way to just verify a method with any combination of arguments? Something like

verify(http, never()).postResource(anyArguments)
도움이 되었습니까?

해결책

This should work:

Mockito.any(String[][].class)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top