### Question:
ConfigServiceImpl implements ConfigService { @Override public Response queryAll(HttpHeaders headers) { List<Config> configList = repository.findAll(); if (configList != null && !configList.isEmpty()) { return new Response<>(1, "Find all config success", configList); } else { return new Response<>(0, "No content", null); } }  @Override Response create(Config info, HttpHeaders headers); @Override Response update(Config info, HttpHeaders headers); @Override Response query(String name, HttpHeaders headers); @Override Response delete(String name, HttpHeaders headers); @Override Response queryAll(HttpHeaders headers);  }### Answer:
@Test public void testQueryAll1() { List<Config> configList = new ArrayList<>(); configList.add(new Config()); Mockito.when(repository.findAll()).thenReturn(configList); Response result = configServiceImpl.queryAll(headers); Assert.assertEquals(new Response<>(1, "Find all config success", configList), result); }
@Test public void testQueryAll2() { Mockito.when(repository.findAll()).thenReturn(null); Response result = configServiceImpl.queryAll(headers); Assert.assertEquals(new Response<>(0, "No content", null), result); }