From e326e733a7b3e013011fce8ecf081a86a097cc15 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 20 Dec 2016 10:30:53 +0300 Subject: juick-spring-www: fix tests --- .../com/juick/www/controllers/ShowMessageController.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'juick-spring-www/src/main/java/com') diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/ShowMessageController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/ShowMessageController.java index 62e7293b..406c27ed 100644 --- a/juick-spring-www/src/main/java/com/juick/www/controllers/ShowMessageController.java +++ b/juick-spring-www/src/main/java/com/juick/www/controllers/ShowMessageController.java @@ -83,11 +83,11 @@ public class ShowMessageController { // Check validity of user name before quering from database if (WebUtils.isNotUserName(userName)) { model.addAttribute("userName", userName); - return "userNotFound"; + throw new HttpNotFoundException(); } User user = userService.getUserByName(userName); - if (user == null) { + if (user.getUid() == 0) { model.addAttribute("userName", userName); throw new HttpNotFoundException(); } @@ -106,7 +106,7 @@ public class ShowMessageController { } User user = userService.getUserByName(userName); - if (user == null) { + if (user.getUid() == 0) { model.addAttribute("userName", userName); throw new HttpNotFoundException(); } @@ -125,7 +125,7 @@ public class ShowMessageController { } User user = userService.getUserByName(userName); - if (user == null) { + if (user.getUid() == 0) { model.addAttribute("userName", userName); throw new HttpNotFoundException(); } @@ -144,7 +144,7 @@ public class ShowMessageController { } User user = userService.getUserByName(userName); - if (user == null) { + if (user.getUid() == 0) { model.addAttribute("userName", userName); throw new HttpNotFoundException(); } @@ -170,7 +170,7 @@ public class ShowMessageController { } User user = userService.getUserByName(userName); - if (user == null) { + if (user.getUid() == 0) { model.addAttribute("userName", userName); throw new HttpNotFoundException(); } -- cgit v1.2.3