@Test(expected = BasketNotFoundException.class) public void oneUnknown() { basketController.one(UUID.randomUUID()); }
@SuppressWarnings("WeakerAccess") @GetMapping("/baskets/{id}") BasketModel one(@PathVariable UUID id) throws BasketNotFoundException { Optional<BasketModel> basket = basketRepository.findById(id); return basket.orElseThrow(BasketNotFoundException::new); }
BasketController { @SuppressWarnings("WeakerAccess") @GetMapping("/baskets/{id}") BasketModel one(@PathVariable UUID id) throws BasketNotFoundException { Optional<BasketModel> basket = basketRepository.findById(id); return basket.orElseThrow(BasketNotFoundException::new); } }
BasketController { @SuppressWarnings("WeakerAccess") @GetMapping("/baskets/{id}") BasketModel one(@PathVariable UUID id) throws BasketNotFoundException { Optional<BasketModel> basket = basketRepository.findById(id); return basket.orElseThrow(BasketNotFoundException::new); } @Autowired  BasketController(BasketRepository basketRepository); }
BasketController { @SuppressWarnings("WeakerAccess") @GetMapping("/baskets/{id}") BasketModel one(@PathVariable UUID id) throws BasketNotFoundException { Optional<BasketModel> basket = basketRepository.findById(id); return basket.orElseThrow(BasketNotFoundException::new); } @Autowired  BasketController(BasketRepository basketRepository);  }
BasketController { @SuppressWarnings("WeakerAccess") @GetMapping("/baskets/{id}") BasketModel one(@PathVariable UUID id) throws BasketNotFoundException { Optional<BasketModel> basket = basketRepository.findById(id); return basket.orElseThrow(BasketNotFoundException::new); } @Autowired  BasketController(BasketRepository basketRepository);   }