diff --git a/kura/org.eclipse.kura.rest.identity.provider/src/main/java/org/eclipse/kura/internal/rest/identity/provider/IdentityService.java b/kura/org.eclipse.kura.rest.identity.provider/src/main/java/org/eclipse/kura/internal/rest/identity/provider/IdentityService.java index 8e9db3f67d2..438e2d74c0d 100644 --- a/kura/org.eclipse.kura.rest.identity.provider/src/main/java/org/eclipse/kura/internal/rest/identity/provider/IdentityService.java +++ b/kura/org.eclipse.kura.rest.identity.provider/src/main/java/org/eclipse/kura/internal/rest/identity/provider/IdentityService.java @@ -41,6 +41,7 @@ @SuppressWarnings("restriction") public class IdentityService { + private static final String IDENTITY = "Identity "; private static final String KURA_WEB_CONSOLE_SERVICE_PID = "org.eclipse.kura.web.Console"; private static final String PERMISSION_ROLE_NAME_PREFIX = "kura.permission."; private static final String USER_ROLE_NAME_PREFIX = "kura.user."; @@ -71,7 +72,7 @@ public void createUser(UserDTO user) throws KuraException { this.userAdminHelper.createUser(user.getUserName()); updateUser(user); } else { - throw new KuraException(KuraErrorCode.BAD_REQUEST, "user " + user.getUserName() + " already exists"); + throw new KuraException(KuraErrorCode.BAD_REQUEST, IDENTITY + user.getUserName() + " already exists"); } } @@ -86,7 +87,7 @@ public UserDTO getUser(String userName) throws KuraException { fillPermissions(Collections.singletonMap(user.get().getName(), userFound)); return userFound; } else { - throw new KuraException(KuraErrorCode.NOT_FOUND, "user " + userName + " not found"); + throw new KuraException(KuraErrorCode.NOT_FOUND, IDENTITY + userName + " not found"); } } @@ -182,7 +183,7 @@ public void updateUser(UserDTO userDTOToUpdate) throws KuraException { updatePasswordOptions(userDTOToUpdate, user.get().getCredentials(), user.get().getProperties()); } else { - throw new KuraException(KuraErrorCode.NOT_FOUND, "user " + userDTOToUpdate.getUserName() + " not found"); + throw new KuraException(KuraErrorCode.NOT_FOUND, IDENTITY + userDTOToUpdate.getUserName() + " not found"); } }