Skip to content

Commit

Permalink
Fixed sonar lint issue
Browse files Browse the repository at this point in the history
Signed-off-by: Nicola Timeus <[email protected]>
  • Loading branch information
nicolatimeus committed Oct 30, 2023
1 parent 436145e commit caf0a66
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
Expand Down Expand Up @@ -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");
}
}

Expand All @@ -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");
}
}

Expand Down Expand Up @@ -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");
}

}
Expand Down

0 comments on commit caf0a66

Please sign in to comment.