### Question:
RestEntityServiceBase extends RestServiceBase { @GET @Path("/") @Produces(MediaType.APPLICATION_JSON) @AuditIgnore public Object getAll(@QueryParam("from") Integer from, @QueryParam("size") Integer size) { return entityService.getAll(from, size, null); }  @GET @Path("/") @Produces(MediaType.APPLICATION_JSON) @AuditIgnore Object getAll(@QueryParam("from") Integer from, @QueryParam("size") Integer size); @GET @Path("/{id}") @Produces(MediaType.APPLICATION_JSON) @AuditIgnore Object get(@PathParam("id") @AuditId String id); @POST @Path("/") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Object create(@AuditContent Map<String, Object> data); @POST @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Object create(@PathParam("id") @AuditId String id, @AuditContent Map<String, Object> data); @DELETE @Path("/{id}") Object delete(@PathParam("id") @AuditId String id);  }### Answer:
@Test public void getAll() { RestEntityServiceBase tested = getTested(); ESDataOnlyResponse res = new ESDataOnlyResponse(null); Mockito.when(tested.entityService.getAll(10, 12, null)).thenReturn(res); Assert.assertEquals(res, tested.getAll(10, 12)); Mockito.verify(tested.entityService).getAll(10, 12, null); Mockito.verifyNoMoreInteractions(tested.entityService); Mockito.reset(tested.entityService); Mockito.when(tested.entityService.getAll(10, 12, null)).thenReturn(null); Assert.assertEquals(null, tested.getAll(10, 12)); Mockito.verify(tested.entityService).getAll(10, 12, null); Mockito.verifyNoMoreInteractions(tested.entityService); Mockito.reset(tested.entityService); Mockito.when(tested.entityService.getAll(10, 12, null)).thenThrow(new RuntimeException("my exception")); try { tested.getAll(10, 12); Assert.fail("RuntimeException expected"); } catch (RuntimeException e) { Mockito.verify(tested.entityService).getAll(10, 12, null); Mockito.verifyNoMoreInteractions(tested.entityService); } }