### Question:
PriceServiceImpl implements PriceService { @Override public Response findByRouteIdAndTrainType(String routeId, String trainType, HttpHeaders headers) { PriceServiceImpl.LOGGER.info("[Price Service][Find By Route And Train Type] Rote: {} Train Type: {}", routeId, trainType); PriceConfig priceConfig = priceConfigRepository.findByRouteIdAndTrainType(routeId, trainType); PriceServiceImpl.LOGGER.info("[Price Service][Find By Route Id And Train Type]"); if (priceConfig == null) { return new Response<>(0, noThatConfig, null); } else { return new Response<>(1, "Success", priceConfig); } }  @Override Response createNewPriceConfig(PriceConfig createAndModifyPriceConfig, HttpHeaders headers); @Override PriceConfig findById(String id, HttpHeaders headers); @Override Response findByRouteIdAndTrainType(String routeId, String trainType, HttpHeaders headers); @Override Response findAllPriceConfig(HttpHeaders headers); @Override Response deletePriceConfig(PriceConfig c, HttpHeaders headers); @Override Response updatePriceConfig(PriceConfig c, HttpHeaders headers);  }### Answer:
@Test public void testFindByRouteIdAndTrainType1() { Mockito.when(priceConfigRepository.findByRouteIdAndTrainType(Mockito.anyString(), Mockito.anyString())).thenReturn(null); Response result = priceServiceImpl.findByRouteIdAndTrainType("route_id", "train_type", headers); Assert.assertEquals(new Response<>(0, "No that config", null), result); }
@Test public void testFindByRouteIdAndTrainType2() { PriceConfig priceConfig = new PriceConfig(); Mockito.when(priceConfigRepository.findByRouteIdAndTrainType(Mockito.anyString(), Mockito.anyString())).thenReturn(priceConfig); Response result = priceServiceImpl.findByRouteIdAndTrainType("route_id", "train_type", headers); Assert.assertEquals(new Response<>(1, "Success", priceConfig), result); }