summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk
diff options
context:
space:
mode:
authorSunder Tattavarada <statta@research.att.com>2019-06-14 16:01:45 +0000
committerGerrit Code Review <gerrit@onap.org>2019-06-14 16:01:45 +0000
commit0d5c6d9516afa7b28e64f7445785ecb539849876 (patch)
tree6b36aba76b9b5464d78ae90d0d9f7861e24247ac /ecomp-sdk
parentde6c86a80ecae5285fd3adb74d0a587d2c1b2b06 (diff)
parenta0b38346d5a736bd5b8da211973aefb6622fc4c3 (diff)
Merge "Fix sonar issues in RoleFunctionListController"
Diffstat (limited to 'ecomp-sdk')
-rw-r--r--ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/RoleFunctionListController.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/RoleFunctionListController.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/RoleFunctionListController.java
index 699e83ca..4ac5f37a 100644
--- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/RoleFunctionListController.java
+++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/RoleFunctionListController.java
@@ -67,6 +67,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
public class RoleFunctionListController extends RestrictedBaseController {
private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(RoleFunctionListController.class);
+ private static final String SUCCESS = "SUCCESS";
@Autowired
private RoleService service;
@@ -117,7 +118,7 @@ public class RoleFunctionListController extends RestrictedBaseController {
RoleFunction domainRoleFunction = service.getRoleFunction(user.getOrgUserId(), code);
domainRoleFunction.setName(availableRoleFunction.getName());
domainRoleFunction.setCode(code);
- restCallStatus = "success";
+ restCallStatus = SUCCESS;
service.saveRoleFunction(user.getOrgUserId(), domainRoleFunction);
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "saveRoleFunction failed", e);
@@ -141,7 +142,7 @@ public class RoleFunctionListController extends RestrictedBaseController {
RoleFunction availableRoleFunction = mapper.readValue(data, RoleFunction.class);
String code = availableRoleFunction.getCode();
List<RoleFunction> currentRoleFunction = service.getRoleFunctions(user.getOrgUserId());
- restCallStatus = "success";
+ restCallStatus = SUCCESS;
for (RoleFunction roleF : currentRoleFunction) {
if (roleF.getCode().equals(code)) {
restCallStatus = "code exists";
@@ -177,7 +178,7 @@ public class RoleFunctionListController extends RestrictedBaseController {
service.deleteRoleFunction(user.getOrgUserId(), domainRoleFunction);
logger.info(EELFLoggerDelegate.auditLogger, "Remove role function " + domainRoleFunction.getName());
- restCallStatus = "success";
+ restCallStatus = SUCCESS;
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "removeRoleFunction failed", e);
throw new IOException(e);