Coverage Summary for Class: UserNotFoundException (com.app.SuperMarketSystem.exception)
| Class | Class, % | Method, % | Line, % |
|---|---|---|---|
| UserNotFoundException | 100% (1/1) | 50% (1/2) | 50% (1/2) |
1 package com.app.SuperMarketSystem.exception; 2 3 import org.springframework.http.HttpStatus; 4 import org.springframework.http.ResponseEntity; 5 import org.springframework.web.bind.annotation.ControllerAdvice; 6 import org.springframework.web.bind.annotation.ExceptionHandler; 7 8 @ControllerAdvice 9 public class UserNotFoundException { 10 @ExceptionHandler(RuntimeException.class) 11 public ResponseEntity<Object> userNotFound(String message) { 12 return new ResponseEntity<>(message, HttpStatus.NOT_FOUND); 13 } 14 }