@Test public void testRequestGroupsInfo() throws Exception { List<Long> groupIds = Arrays.asList(1L, 2L, 3L); String requestGroupsLink = "requestGroupsLink"; when(linkBuilder.getRequestGroupsLink(groupIds)).thenReturn(requestGroupsLink); String answer = "answer"; when(request.get(requestGroupsLink, 200)).thenReturn(answer); when(jsonService.getGroups(answer)).thenReturn(new ArrayList<>()); apiService.requestGroups(groupIds); verify(linkBuilder, times(1)).getRequestGroupsLink(groupIds); verify(request, times(1)).get(requestGroupsLink, 200); verify(jsonService, times(1)).getGroups(answer); }