diff options
Diffstat (limited to 'models')
4 files changed, 6 insertions, 9 deletions
diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoop.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoop.java index 4d3d37236..cf22b7228 100644 --- a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoop.java +++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/concepts/ControlLoop.java @@ -107,7 +107,7 @@ public class ControlLoop extends ToscaEntity implements Comparable<ControlLoop> */ public List<ClElementStatistics> getControlLoopElementStatisticsList(final ControlLoop controlLoop) { if (MapUtils.isEmpty(controlLoop.elements)) { - return null; + return List.of(); } return controlLoop.elements.values().stream().map(ControlLoopElement::getClElementStatistics) diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/messages/rest/instantiation/ControlLoopPrimedResponse.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/messages/rest/instantiation/ControlLoopPrimedResponse.java index 993c6e592..4d2dfaf01 100644 --- a/models/src/main/java/org/onap/policy/clamp/controlloop/models/messages/rest/instantiation/ControlLoopPrimedResponse.java +++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/messages/rest/instantiation/ControlLoopPrimedResponse.java @@ -24,8 +24,6 @@ import java.util.List; import lombok.Getter; import lombok.Setter; import lombok.ToString; -import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopOrderedState; -import org.onap.policy.clamp.controlloop.models.messages.rest.GenericNameVersion; import org.onap.policy.clamp.controlloop.models.messages.rest.SimpleResponse; 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); |