### Question:
ConfigService implements EntityService { @Override public StreamingOutput getAll(Integer from, Integer size, String[] fieldsToRemove) { return entityService.getAll(from, size, fieldsToRemove); }  @Override StreamingOutput getAll(Integer from, Integer size, String[] fieldsToRemove); @Override List<Map<String, Object>> getAll(); @Override Map<String, Object> get(String id); @Override String create(Map<String, Object> entity); @Override void create(String id, Map<String, Object> entity); @Override void update(String id, Map<String, Object> entity); @Override void delete(String id); @Override ListRequest listRequestInit(); @Override ListRequest listRequestNext(ListRequest previous); static final String CFGNAME_SEARCH_RESPONSE_FIELDS; static final String CFGNAME_SEARCH_FULLTEXT_QUERY_FIELDS; static final String CFGNAME_SEARCH_FULLTEXT_HIGHLIGHT_FIELDS; static final String CFGNAME_SEARCH_FULLTEXT_AGGREGATIONS_FIELDS; static final String CFGNAME_SEARCH_FULLTEXT_FILTER_FIELDS; static final String CFGNAME_NORMALIZATIONS; static final String CFGNAME_SECURITY_RESTAPI_CORS; }### Answer:
@Test public void getAll_pager() { ConfigService tested = getTested(); String[] ff = new String[] { "aa" }; StreamingOutput value = new ESDataOnlyResponse(null); Mockito.when(tested.entityService.getAll(10, 20, ff)).thenReturn(value); Assert.assertEquals(value, tested.getAll(10, 20, ff)); Mockito.reset(tested.entityService); Mockito.when(tested.entityService.getAll(10, 20, ff)).thenReturn(null); Assert.assertEquals(null, tested.getAll(10, 20, ff)); Mockito.verify(tested.entityService).getAll(10, 20, ff); Mockito.verifyNoMoreInteractions(tested.entityService); Mockito.reset(tested.entityService); Mockito.when(tested.entityService.getAll(10, 20, ff)).thenThrow(new RuntimeException("testex")); try { tested.getAll(10, 20, ff); Assert.fail("RuntimeException expected"); } catch (RuntimeException e) { } Mockito.verify(tested.entityService).getAll(10, 20, ff); Mockito.verifyNoMoreInteractions(tested.entityService); }
@Test public void getAll_raw() { ConfigService tested = getTested(); List<Map<String, Object>> value = new ArrayList<Map<String, Object>>(); Mockito.when(tested.entityService.getAll()).thenReturn(value); Assert.assertEquals(value, tested.getAll()); Mockito.reset(tested.entityService); Mockito.when(tested.entityService.getAll()).thenReturn(null); Assert.assertEquals(null, tested.getAll()); Mockito.verify(tested.entityService).getAll(); Mockito.verifyNoMoreInteractions(tested.entityService); Mockito.reset(tested.entityService); Mockito.when(tested.entityService.getAll()).thenThrow(new RuntimeException("testex")); try { tested.getAll(); Assert.fail("RuntimeException expected"); } catch (RuntimeException e) { } Mockito.verify(tested.entityService).getAll(); Mockito.verifyNoMoreInteractions(tested.entityService); }