From e173fc5ab13b095d8f70fd8a8d4d063adeba6e6b Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Fri, 5 Jul 2019 10:52:20 -0400 Subject: Fix sonar issues in policy/endpoints Sonar fixes, other than code coverage. These changes are disruptive and will likely cause breakage in a number of policy repos. Renamed constants. Moved constants/factories from interfaces to classes. Change-Id: I182d50320aa6b53e383081af806c60dd2f806cbe Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn --- .../policy/common/endpoints/utils/ParameterUtilsTest.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'policy-endpoints/src/test/java/org/onap/policy/common/endpoints/utils/ParameterUtilsTest.java') diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/utils/ParameterUtilsTest.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/utils/ParameterUtilsTest.java index 7e5c3a12..06c16e9c 100644 --- a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/utils/ParameterUtilsTest.java +++ b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/utils/ParameterUtilsTest.java @@ -1,6 +1,8 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,6 +36,7 @@ import org.onap.policy.common.endpoints.parameters.TopicParameterGroup; * @author Ajith Sreekumar (ajith.sreekumar@est.tech) */ public class ParameterUtilsTest { + private static final String SERVERS = ".servers"; /** * Test getTopicProperties from TopicParameterGroup. @@ -49,9 +52,9 @@ public class ParameterUtilsTest { assertEquals(CommonTestData.TOPIC_NAME, topicProperties.getProperty(CommonTestData.TOPIC_INFRA + ".sink.topics")); assertEquals(CommonTestData.TOPIC_SERVER, topicProperties - .getProperty(CommonTestData.TOPIC_INFRA + ".source.topics." + CommonTestData.TOPIC_NAME + ".servers")); + .getProperty(CommonTestData.TOPIC_INFRA + ".source.topics." + CommonTestData.TOPIC_NAME + SERVERS)); assertEquals(CommonTestData.TOPIC_SERVER, topicProperties - .getProperty(CommonTestData.TOPIC_INFRA + ".sink.topics." + CommonTestData.TOPIC_NAME + ".servers")); + .getProperty(CommonTestData.TOPIC_INFRA + ".sink.topics." + CommonTestData.TOPIC_NAME + SERVERS)); } @Test @@ -62,12 +65,12 @@ public class ParameterUtilsTest { assertEquals(CommonTestData.TOPIC_NAME, topicProperties.getProperty(CommonTestData.TOPIC_INFRA + ".source.topics")); assertEquals(CommonTestData.TOPIC_SERVER, topicProperties - .getProperty(CommonTestData.TOPIC_INFRA + ".source.topics." + CommonTestData.TOPIC_NAME + ".servers")); + .getProperty(CommonTestData.TOPIC_INFRA + ".source.topics." + CommonTestData.TOPIC_NAME + SERVERS)); ParameterUtils.updateTopicProperties(topicProperties, "sink", CommonTestData.TOPIC_INFRA, CommonTestData.TOPIC_NAME, Arrays.asList(CommonTestData.TOPIC_SERVER)); assertEquals(CommonTestData.TOPIC_NAME, topicProperties.getProperty(CommonTestData.TOPIC_INFRA + ".sink.topics")); assertEquals(CommonTestData.TOPIC_SERVER, topicProperties - .getProperty(CommonTestData.TOPIC_INFRA + ".sink.topics." + CommonTestData.TOPIC_NAME + ".servers")); + .getProperty(CommonTestData.TOPIC_INFRA + ".sink.topics." + CommonTestData.TOPIC_NAME + SERVERS)); } } -- cgit 1.2.3-korg