### Question:
ConsignPriceServiceImpl implements ConsignPriceService { @Override public Response queryPriceInformation(HttpHeaders headers) { StringBuilder sb = new StringBuilder(); ConsignPrice price = repository.findByIndex(0); sb.append("The price of weight within "); sb.append(price.getInitialWeight()); sb.append(" is "); sb.append(price.getInitialPrice()); sb.append(". The price of extra weight within the region is "); sb.append(price.getWithinPrice()); sb.append(" and beyond the region is "); sb.append(price.getBeyondPrice()); sb.append("\n"); return new Response<>(1, success, sb.toString()); }  @Override Response getPriceByWeightAndRegion(double weight, boolean isWithinRegion, HttpHeaders headers); @Override Response queryPriceInformation(HttpHeaders headers); @Override Response createAndModifyPrice(ConsignPrice config, HttpHeaders headers); @Override Response getPriceConfig(HttpHeaders headers);  }### Answer:
@Test public void testQueryPriceInformation() { ConsignPrice priceConfig = new ConsignPrice(UUID.randomUUID(), 1, 2.0, 3.0, 3.5, 4.0); Mockito.when(repository.findByIndex(0)).thenReturn(priceConfig); Response result = consignPriceServiceImpl.queryPriceInformation(headers); String str = "The price of weight within 2.0 is 3.0. The price of extra weight within the region is 3.5 and beyond the region is 4.0\n"; Assert.assertEquals(new Response<>(1, "Success", str), result); }