summaryrefslogtreecommitdiffstats
path: root/models/src/test
diff options
context:
space:
mode:
authorSirisha_Manchikanti <sirisha.manchikanti@est.tech>2021-11-02 05:35:12 +0000
committerSirisha_Manchikanti <sirisha.manchikanti@est.tech>2021-11-02 06:05:15 +0000
commita48252db26e2ccd031ddb2046d87737d47c248a6 (patch)
tree69c6a7e25f1a5b67d0c1d598949d0b6ad815f41a /models/src/test
parent9a49920ac001f76d796cbffce823abd7c0c7d9e2 (diff)
Remove code smells in controlloop runtime
Remove code-smells reported by sonar cloud https://sonarcloud.io/project/issues?id=onap_policy-clamp&resolved=false Issue-ID: POLICY-3540 Signed-off-by: Sirisha_Manchikanti <sirisha.manchikanti@est.tech> Change-Id: I8ed1c4599e7eeebbc3a31e74cea4148eb0435847
Diffstat (limited to 'models/src/test')
-rw-r--r--models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoopTest.java2
-rw-r--r--models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ServiceTemplateProviderTest.java9
2 files changed, 5 insertions, 6 deletions
diff --git a/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoopTest.java b/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoopTest.java
index 51a4fc7ae..d9c518b53 100644
--- a/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoopTest.java
+++ b/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoopTest.java
@@ -107,7 +107,7 @@ class ControlLoopTest {
void testControlLoopElementStatisticsList() {
var cl = new ControlLoop();
List<ClElementStatistics> emptylist = cl.getControlLoopElementStatisticsList(cl);
- assertNull(emptylist);
+ assertEquals(List.of(), emptylist);
var cl1 = getControlLoopTest();
List<ClElementStatistics> list = cl1.getControlLoopElementStatisticsList(cl1);
diff --git a/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ServiceTemplateProviderTest.java b/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ServiceTemplateProviderTest.java
index a4cbbfb0b..7f2731abf 100644
--- a/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ServiceTemplateProviderTest.java
+++ b/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ServiceTemplateProviderTest.java
@@ -25,7 +25,6 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -78,7 +77,7 @@ class ServiceTemplateProviderTest {
var serviceTemplateProvider = new ServiceTemplateProvider(modelsProvider);
var serviceTemplate = new ToscaServiceTemplate();
- when(modelsProvider.createServiceTemplate(eq(serviceTemplate))).thenReturn(serviceTemplate);
+ when(modelsProvider.createServiceTemplate(serviceTemplate)).thenReturn(serviceTemplate);
var result = serviceTemplateProvider.createServiceTemplate(serviceTemplate);
@@ -91,7 +90,7 @@ class ServiceTemplateProviderTest {
serviceTemplate.setName("Name");
serviceTemplate.setVersion("1.0.0");
var modelsProvider = mock(PolicyModelsProvider.class);
- when(modelsProvider.deleteServiceTemplate(eq(serviceTemplate.getName()), eq(serviceTemplate.getVersion())))
+ when(modelsProvider.deleteServiceTemplate(serviceTemplate.getName(), serviceTemplate.getVersion()))
.thenReturn(serviceTemplate);
var serviceTemplateProvider = new ServiceTemplateProvider(modelsProvider);
@@ -117,7 +116,7 @@ class ServiceTemplateProviderTest {
serviceTemplate.setName("Name");
serviceTemplate.setVersion("1.0.0");
var modelsProvider = mock(PolicyModelsProvider.class);
- when(modelsProvider.getServiceTemplateList(eq(serviceTemplate.getName()), eq(serviceTemplate.getVersion())))
+ when(modelsProvider.getServiceTemplateList(serviceTemplate.getName(), serviceTemplate.getVersion()))
.thenReturn(List.of(serviceTemplate));
var serviceTemplateProvider = new ServiceTemplateProvider(modelsProvider);
@@ -133,7 +132,7 @@ class ServiceTemplateProviderTest {
serviceTemplate.setName("Name");
serviceTemplate.setVersion("1.0.0");
var modelsProvider = mock(PolicyModelsProvider.class);
- when(modelsProvider.getServiceTemplateList(eq(serviceTemplate.getName()), eq(serviceTemplate.getVersion())))
+ when(modelsProvider.getServiceTemplateList(serviceTemplate.getName(), serviceTemplate.getVersion()))
.thenReturn(List.of(serviceTemplate));
var serviceTemplateProvider = new ServiceTemplateProvider(modelsProvider);