// Path: spring-boot-error-handling/src/main/java/de/chclaus/examples/service/user/UserService.java
// @Service
// public class UserService {
// 
//   /**
//    * Method to demonstrate a fake user lookup.
//    * @param username The username... There is just an admin account.
//    * @return a DTO representation of an user.
//    */
//   public UserDTO findUserByName(String username) {
// 
//     // We just have an administrator account. Nothing else. ;)
//     if ("admin".equals(username)) {
//       return new UserDTO(username);
//     }
// 
//     throw new UsernameNotFoundException(String.format("Username not found. username=%s", username));
//   }
// }


import de.chclaus.examples.service.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
package de.chclaus.examples.controller.user;


/**
 * An example controller to demonstrate exception (error) handling.
 *
 * @author Christian Claus (ch.claus@me.com)
 */
@RestController
public class UserController {

  @Autowired
// Path: spring-boot-error-handling/src/main/java/de/chclaus/examples/service/user/UserService.java
// @Service
// public class UserService {
// 
//   /**
//    * Method to demonstrate a fake user lookup.
//    * @param username The username... There is just an admin account.
//    * @return a DTO representation of an user.
//    */
//   public UserDTO findUserByName(String username) {
// 
//     // We just have an administrator account. Nothing else. ;)
//     if ("admin".equals(username)) {
//       return new UserDTO(username);
//     }
// 
//     throw new UsernameNotFoundException(String.format("Username not found. username=%s", username));
//   }
// }


// Path: spring-boot-error-handling/src/main/java/de/chclaus/examples/controller/user/UserController.java
import de.chclaus.examples.service.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

package de.chclaus.examples.controller.user;


/**
 * An example controller to demonstrate exception (error) handling.
 *
 * @author Christian Claus (ch.claus@me.com)
 */
@RestController
public class UserController {

  @Autowired
  private UserService userService;