From: Roland Häder Date: Thu, 11 Aug 2016 10:11:22 +0000 (+0200) Subject: Fixed wrong tests: (please cherry-pick) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0bf508bd04ecac604e1935c03d6883232114d226;p=jjobs-ejb.git Fixed wrong tests: (please cherry-pick) - locking/unlocking an existing user account always have a valid user id set --- diff --git a/src/java/org/mxchange/jusercore/model/user/JobsAdminUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/JobsAdminUserSessionBean.java index 8595819..804b054 100644 --- a/src/java/org/mxchange/jusercore/model/user/JobsAdminUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/JobsAdminUserSessionBean.java @@ -169,9 +169,12 @@ public class JobsAdminUserSessionBean extends BaseJobsDatabaseBean implements Ad if (null == user) { // Abort here throw new NullPointerException("user is null"); //NOI18N - } else if (user.getUserId() instanceof Long) { + } else if (user.getUserId() == null) { // Id is set - throw new IllegalArgumentException("user.userId is not null"); //NOI18N + throw new NullPointerException("user.userId is null"); //NOI18N + } else if (user.getUserId() < 1) { + // Id is set + throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is null", user.getUserId())); //NOI18N } else if (user.getUserContact() == null) { // Throw NPE again throw new NullPointerException("user.userContact is null"); //NOI18N @@ -256,9 +259,12 @@ public class JobsAdminUserSessionBean extends BaseJobsDatabaseBean implements Ad if (null == user) { // Abort here throw new NullPointerException("user is null"); //NOI18N - } else if (user.getUserId() instanceof Long) { + } else if (user.getUserId() == null) { // Id is set - throw new IllegalArgumentException("user.userId is not null"); //NOI18N + throw new NullPointerException("user.userId is null"); //NOI18N + } else if (user.getUserId() < 1) { + // Id is set + throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is null", user.getUserId())); //NOI18N } else if (user.getUserContact() == null) { // Throw NPE again throw new NullPointerException("user.userContact is null"); //NOI18N