Merge "Fix eclipse warnings in clamp"
diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/IntermediaryActivator.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/IntermediaryActivator.java
index d544915..5458f7c 100644
--- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/IntermediaryActivator.java
+++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/IntermediaryActivator.java
@@ -74,8 +74,8 @@
// @formatter:off
addAction("Topic endpoint management",
- () -> TopicEndpointManager.getManager().start(),
- () -> TopicEndpointManager.getManager().shutdown());
+ () -> TopicEndpointManager.getManager().start(),
+ () -> TopicEndpointManager.getManager().shutdown());
publishers.forEach(publisher ->
addAction("Publisher " + publisher.getClass().getSimpleName(),
@@ -84,8 +84,8 @@
listeners.forEach(listener ->
addAction("Listener " + listener.getClass().getSimpleName(),
- () -> msgDispatcher.register(listener.getType(), listener.getScoListener()),
- () -> msgDispatcher.unregister(listener.getType())));
+ () -> msgDispatcher.register(listener.getType(), listener.getScoListener()),
+ () -> msgDispatcher.unregister(listener.getType())));
addAction("Topic Message Dispatcher", this::registerMsgDispatcher, this::unregisterMsgDispatcher);
// @formatter:on
diff --git a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/config/messaging/MessageDispatcherActivator.java b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/config/messaging/MessageDispatcherActivator.java
index e0ab2ba..284094b 100644
--- a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/config/messaging/MessageDispatcherActivator.java
+++ b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/config/messaging/MessageDispatcherActivator.java
@@ -69,8 +69,8 @@
// @formatter:off
addAction("Topic endpoint management",
- () -> TopicEndpointManager.getManager().start(),
- () -> TopicEndpointManager.getManager().shutdown());
+ () -> TopicEndpointManager.getManager().start(),
+ () -> TopicEndpointManager.getManager().shutdown());
publishers.forEach(publisher ->
addAction("Publisher " + publisher.getClass().getSimpleName(),
@@ -79,8 +79,8 @@
listeners.forEach(listener ->
addAction("Listener " + listener.getClass().getSimpleName(),
- () -> msgDispatcher.register(listener.getType(), listener.getScoListener()),
- () -> msgDispatcher.unregister(listener.getType())));
+ () -> msgDispatcher.register(listener.getType(), listener.getScoListener()),
+ () -> msgDispatcher.unregister(listener.getType())));
addAction("Topic Message Dispatcher", this::registerMsgDispatcher, this::unregisterMsgDispatcher);
// @formatter:on
diff --git a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java
index f136b9f..7f04056 100644
--- a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java
+++ b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java
@@ -246,8 +246,8 @@
new ControlLoopInstantiationProvider(clProvider, commissioningProvider, supervisionHandler);
assertThatThrownBy(
- () -> instantiationProvider.deleteControlLoop(controlLoop0.getName(), controlLoop0.getVersion()))
- .hasMessageMatching(CONTROL_LOOP_NOT_FOUND);
+ () -> instantiationProvider.deleteControlLoop(controlLoop0.getName(), controlLoop0.getVersion()))
+ .hasMessageMatching(CONTROL_LOOP_NOT_FOUND);
InstantiationUtils.assertInstantiationResponse(instantiationProvider.createControlLoops(controlLoops),
controlLoops);
@@ -282,8 +282,8 @@
instantiationProvider.updateControlLoops(controlLoops);
assertThatThrownBy(
- () -> instantiationProvider.deleteControlLoop(controlLoop.getName(), controlLoop.getVersion()))
- .hasMessageMatching(String.format(DELETE_BAD_REQUEST, state));
+ () -> instantiationProvider.deleteControlLoop(controlLoop.getName(), controlLoop.getVersion()))
+ .hasMessageMatching(String.format(DELETE_BAD_REQUEST, state));
}
@Test
diff --git a/runtime/src/main/java/org/onap/policy/clamp/clds/client/DcaeInventoryServices.java b/runtime/src/main/java/org/onap/policy/clamp/clds/client/DcaeInventoryServices.java
index 5247331..387ea8c 100644
--- a/runtime/src/main/java/org/onap/policy/clamp/clds/client/DcaeInventoryServices.java
+++ b/runtime/src/main/java/org/onap/policy/clamp/clds/client/DcaeInventoryServices.java
@@ -28,7 +28,6 @@
import java.util.Date;
import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
-import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.ExchangeBuilder;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
diff --git a/runtime/src/main/java/org/onap/policy/clamp/clds/config/CamelConfiguration.java b/runtime/src/main/java/org/onap/policy/clamp/clds/config/CamelConfiguration.java
index 0880e9b..b1141ea 100644
--- a/runtime/src/main/java/org/onap/policy/clamp/clds/config/CamelConfiguration.java
+++ b/runtime/src/main/java/org/onap/policy/clamp/clds/config/CamelConfiguration.java
@@ -91,10 +91,6 @@
@Value("${clamp.config.keyFile:#{null}}")
private String keyFile;
-
- @Autowired
- private ClampProperties clampProperties;
-
private void configureDefaultSslProperties() {
if (trustStore != null) {
System.setProperty("javax.net.ssl.trustStore", Thread.currentThread().getContextClassLoader()
diff --git a/runtime/src/main/java/org/onap/policy/clamp/clds/config/sdc/SdcControllersConfiguration.java b/runtime/src/main/java/org/onap/policy/clamp/clds/config/sdc/SdcControllersConfiguration.java
index 71986f6..f871df7 100644
--- a/runtime/src/main/java/org/onap/policy/clamp/clds/config/sdc/SdcControllersConfiguration.java
+++ b/runtime/src/main/java/org/onap/policy/clamp/clds/config/sdc/SdcControllersConfiguration.java
@@ -88,9 +88,9 @@
Map<String, SdcSingleControllerConfiguration> result = new HashMap<>();
if (jsonRootNode.get(CONTROLLER_SUBTREE_KEY) != null) {
jsonRootNode.get(CONTROLLER_SUBTREE_KEY).getAsJsonObject().entrySet().forEach(
- entry -> result.put(entry.getKey(),
- new SdcSingleControllerConfiguration(entry.getValue().getAsJsonObject(), entry.getKey(),
- keyFile)));
+ entry -> result.put(entry.getKey(),
+ new SdcSingleControllerConfiguration(entry.getValue().getAsJsonObject(), entry.getKey(),
+ keyFile)));
} else {
throw new SdcParametersException(
CONTROLLER_SUBTREE_KEY + " key not found in the file: " + sdcControllerFile);
diff --git a/runtime/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/ToscaMetadataExecutor.java b/runtime/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/ToscaMetadataExecutor.java
index 2d19335..4a41554 100644
--- a/runtime/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/ToscaMetadataExecutor.java
+++ b/runtime/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/ToscaMetadataExecutor.java
@@ -29,10 +29,8 @@
import javax.annotation.PostConstruct;
import org.onap.policy.clamp.clds.tosca.update.execution.cds.ToscaMetadataCdsProcess;
import org.onap.policy.clamp.loop.service.Service;
-import org.onap.policy.clamp.tosca.DictionaryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
@@ -44,9 +42,6 @@
private static final Logger logger =
LoggerFactory.getLogger(ToscaMetadataExecutor.class);
- @Autowired
- private DictionaryService dictionaryService;
-
private Map<String, ToscaMetadataProcess> mapOfProcesses = new HashMap<>();
/**
diff --git a/runtime/src/main/java/org/onap/policy/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java b/runtime/src/main/java/org/onap/policy/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java
index 1d5ed26..9fe199a 100644
--- a/runtime/src/main/java/org/onap/policy/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java
+++ b/runtime/src/main/java/org/onap/policy/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java
@@ -27,7 +27,7 @@
import com.google.gson.JsonObject;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.LinkedHashMap;
+import java.util.Map;
import java.util.Map.Entry;
import org.onap.policy.clamp.clds.tosca.update.elements.ToscaElement;
import org.onap.policy.clamp.clds.tosca.update.elements.ToscaElementProperty;
@@ -59,8 +59,8 @@
private static final String TITLE = "title";
private static final String TYPE = "type";
- private LinkedHashMap<String, ToscaElement> components;
- private LinkedHashMap<String, JsonTemplate> templates;
+ private Map<String, ToscaElement> components;
+ private Map<String, JsonTemplate> templates;
private ToscaMetadataParser metadataParser;
@@ -74,8 +74,8 @@
* @param metadataParser The metadata parser to use for metadata section
* @param serviceModel The service model for clamp enrichment
*/
- public ToscaConverterToJsonSchema(LinkedHashMap<String, ToscaElement> toscaElementsMap,
- LinkedHashMap<String, JsonTemplate> jsonSchemaTemplates, ToscaMetadataParser metadataParser,
+ public ToscaConverterToJsonSchema(Map<String, ToscaElement> toscaElementsMap,
+ Map<String, JsonTemplate> jsonSchemaTemplates, ToscaMetadataParser metadataParser,
Service serviceModel) {
this.components = toscaElementsMap;
this.templates = jsonSchemaTemplates;
@@ -204,43 +204,7 @@
for (String propertyField : toscaElementProperty.getItems().keySet()) {
switch (propertyField) {
case TYPE:
- if (currentPropertyJsonTemplate.hasFields(propertyField)) {
- String fieldtype = (String) toscaElementProperty.getItems().get(propertyField);
- switch (fieldtype.toLowerCase()) {
- case LIST:
- propertiesInJson.addProperty(TYPE, ARRAY);
- break;
- case MAP:
- propertiesInJson.addProperty(TYPE, OBJECT);
- break;
- case "scalar-unit.time":
- case "scalar-unit.frequency":
- case "scalar-unit.size":
- propertiesInJson.addProperty(TYPE, "string");
- break;
- case "timestamp":
- propertiesInJson.addProperty(TYPE, "string");
- propertiesInJson.addProperty(FORMAT, "date-time");
- break;
- case "float":
- propertiesInJson.addProperty(TYPE, "number");
- break;
- case "range":
- propertiesInJson.addProperty(TYPE, "integer");
- if (!checkConstraintPresence(toscaElementProperty, "greater_than")
- && currentPropertyJsonTemplate.hasFields("exclusiveMinimum")) {
- propertiesInJson.addProperty("exclusiveMinimum", false);
- }
- if (!checkConstraintPresence(toscaElementProperty, "less_than")
- && currentPropertyJsonTemplate.hasFields("exclusiveMaximum")) {
- propertiesInJson.addProperty("exclusiveMaximum", false);
- }
- break;
- default:
- propertiesInJson.addProperty(TYPE, currentPropertyJsonTemplate.getName());
- break;
- }
- }
+ parseType(toscaElementProperty, propertyField, propertiesInJson, currentPropertyJsonTemplate);
break;
case METADATA:
if (metadataParser != null) {
@@ -254,37 +218,7 @@
currentPropertyJsonTemplate);
break;
case ENTRY_SCHEMA:
- // Here, a way to check if entry is a component (datatype) or a simple string
- if (getToscaElement(this.extractSpecificFieldFromMap(toscaElementProperty, ENTRY_SCHEMA)) != null) {
- String nameComponent = this.extractSpecificFieldFromMap(toscaElementProperty, ENTRY_SCHEMA);
- var child = new ToscaConverterToJsonSchema(components, templates, metadataParser, serviceModel);
- var propertiesContainer = new JsonObject();
-
- if (((String) toscaElementProperty.getItems().get(TYPE)).equals(MAP)) {
- JsonObject componentAsProperty = child.getJsonSchemaOfToscaElement(nameComponent);
- propertiesContainer.add(nameComponent, componentAsProperty);
- if (currentPropertyJsonTemplate.hasFields(PROPERTIES)) {
- propertiesInJson.add(PROPERTIES, propertiesContainer);
- }
- } else {
- JsonObject componentAsItem = child.getJsonSchemaOfToscaElement(nameComponent);
- if (currentPropertyJsonTemplate.hasFields(PROPERTIES)) {
- propertiesInJson.add("items", componentAsItem);
- propertiesInJson.addProperty(FORMAT, "tabs-top");
- }
- }
- } else if (toscaElementProperty.getItems().get(TYPE).equals(LIST)) {
- // Native cases
- var itemContainer = new JsonObject();
- String valueInEntrySchema =
- this.extractSpecificFieldFromMap(toscaElementProperty, ENTRY_SCHEMA);
- itemContainer.addProperty(TYPE, valueInEntrySchema);
- propertiesInJson.add("items", itemContainer);
- propertiesInJson.addProperty(FORMAT, "tabs-top");
- }
-
- // MAP Case, for now nothing
-
+ parseEntrySchema(toscaElementProperty, propertiesInJson, currentPropertyJsonTemplate);
break;
default:
// Each classical field : type, description, default..
@@ -298,6 +232,81 @@
return propertiesInJson;
}
+ private void parseType(ToscaElementProperty toscaElementProperty, String propertyField, JsonObject propertiesInJson,
+ JsonTemplate currentPropertyJsonTemplate) {
+ if (currentPropertyJsonTemplate.hasFields(propertyField)) {
+ String fieldtype = (String) toscaElementProperty.getItems().get(propertyField);
+ switch (fieldtype.toLowerCase()) {
+ case LIST:
+ propertiesInJson.addProperty(TYPE, ARRAY);
+ break;
+ case MAP:
+ propertiesInJson.addProperty(TYPE, OBJECT);
+ break;
+ case "scalar-unit.time":
+ case "scalar-unit.frequency":
+ case "scalar-unit.size":
+ propertiesInJson.addProperty(TYPE, "string");
+ break;
+ case "timestamp":
+ propertiesInJson.addProperty(TYPE, "string");
+ propertiesInJson.addProperty(FORMAT, "date-time");
+ break;
+ case "float":
+ propertiesInJson.addProperty(TYPE, "number");
+ break;
+ case "range":
+ propertiesInJson.addProperty(TYPE, "integer");
+ if (!checkConstraintPresence(toscaElementProperty, "greater_than")
+ && currentPropertyJsonTemplate.hasFields("exclusiveMinimum")) {
+ propertiesInJson.addProperty("exclusiveMinimum", false);
+ }
+ if (!checkConstraintPresence(toscaElementProperty, "less_than")
+ && currentPropertyJsonTemplate.hasFields("exclusiveMaximum")) {
+ propertiesInJson.addProperty("exclusiveMaximum", false);
+ }
+ break;
+ default:
+ propertiesInJson.addProperty(TYPE, currentPropertyJsonTemplate.getName());
+ break;
+ }
+ }
+ }
+
+ private void parseEntrySchema(ToscaElementProperty toscaElementProperty, JsonObject propertiesInJson,
+ JsonTemplate currentPropertyJsonTemplate) {
+ // Here, a way to check if entry is a component (datatype) or a simple string
+ if (getToscaElement(this.extractSpecificFieldFromMap(toscaElementProperty, ENTRY_SCHEMA)) != null) {
+ String nameComponent = this.extractSpecificFieldFromMap(toscaElementProperty, ENTRY_SCHEMA);
+ var child = new ToscaConverterToJsonSchema(components, templates, metadataParser, serviceModel);
+ var propertiesContainer = new JsonObject();
+
+ if (((String) toscaElementProperty.getItems().get(TYPE)).equals(MAP)) {
+ JsonObject componentAsProperty = child.getJsonSchemaOfToscaElement(nameComponent);
+ propertiesContainer.add(nameComponent, componentAsProperty);
+ if (currentPropertyJsonTemplate.hasFields(PROPERTIES)) {
+ propertiesInJson.add(PROPERTIES, propertiesContainer);
+ }
+ } else {
+ JsonObject componentAsItem = child.getJsonSchemaOfToscaElement(nameComponent);
+ if (currentPropertyJsonTemplate.hasFields(PROPERTIES)) {
+ propertiesInJson.add("items", componentAsItem);
+ propertiesInJson.addProperty(FORMAT, "tabs-top");
+ }
+ }
+ } else if (toscaElementProperty.getItems().get(TYPE).equals(LIST)) {
+ // Native cases
+ var itemContainer = new JsonObject();
+ String valueInEntrySchema =
+ this.extractSpecificFieldFromMap(toscaElementProperty, ENTRY_SCHEMA);
+ itemContainer.addProperty(TYPE, valueInEntrySchema);
+ propertiesInJson.add("items", itemContainer);
+ propertiesInJson.addProperty(FORMAT, "tabs-top");
+ }
+
+ // MAP Case, for now nothing
+ }
+
/**
* Look for a matching Component for the name parameter, in the components list.
*
@@ -326,8 +335,8 @@
*/
@SuppressWarnings("unchecked")
public String extractSpecificFieldFromMap(ToscaElementProperty toscaElementProperty, String fieldName) {
- LinkedHashMap<String, String> entrySchemaFields =
- (LinkedHashMap<String, String>) toscaElementProperty.getItems().get(fieldName);
+ Map<String, String> entrySchemaFields =
+ (Map<String, String>) toscaElementProperty.getItems().get(fieldName);
return entrySchemaFields.get(TYPE);
}
@@ -344,8 +353,8 @@
@SuppressWarnings("unchecked")
ArrayList<Object> constraints = (ArrayList<Object>) toscaElementProperty.getItems().get(CONSTRAINTS);
for (Object constraint : constraints) {
- if (constraint instanceof LinkedHashMap
- && ((LinkedHashMap<?, ?>) constraint).containsKey(nameConstraint)) {
+ if (constraint instanceof Map
+ && ((Map<?, ?>) constraint).containsKey(nameConstraint)) {
presentConstraint = true;
}
}
diff --git a/runtime/src/main/java/org/onap/policy/clamp/clds/tosca/update/templates/JsonTemplateManager.java b/runtime/src/main/java/org/onap/policy/clamp/clds/tosca/update/templates/JsonTemplateManager.java
index af7f8cc..f9b274e 100644
--- a/runtime/src/main/java/org/onap/policy/clamp/clds/tosca/update/templates/JsonTemplateManager.java
+++ b/runtime/src/main/java/org/onap/policy/clamp/clds/tosca/update/templates/JsonTemplateManager.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP CLAMP
* ================================================================================
- * Copyright (C) 2020 AT&T Intellectual Property. All rights
+ * Copyright (C) 2020, 2021 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -38,8 +38,8 @@
import org.onap.policy.clamp.loop.service.Service;
public class JsonTemplateManager {
- private LinkedHashMap<String, JsonTemplate> jsonSchemaTemplates;
- private LinkedHashMap<String, ToscaElement> toscaElements;
+ private Map<String, JsonTemplate> jsonSchemaTemplates;
+ private Map<String, ToscaElement> toscaElements;
/**
* Constructor.
@@ -58,19 +58,19 @@
}
// GETTERS & SETTERS
- public LinkedHashMap<String, ToscaElement> getToscaElements() {
+ public Map<String, ToscaElement> getToscaElements() {
return toscaElements;
}
- public void setToscaElements(LinkedHashMap<String, ToscaElement> toscaElements) {
+ public void setToscaElements(Map<String, ToscaElement> toscaElements) {
this.toscaElements = toscaElements;
}
- public LinkedHashMap<String, JsonTemplate> getJsonSchemaTemplates() {
+ public Map<String, JsonTemplate> getJsonSchemaTemplates() {
return jsonSchemaTemplates;
}
- public void setJsonSchemaTemplates(LinkedHashMap<String, JsonTemplate> jsonSchemaTemplates) {
+ public void setJsonSchemaTemplates(Map<String, JsonTemplate> jsonSchemaTemplates) {
this.jsonSchemaTemplates = jsonSchemaTemplates;
}
@@ -157,10 +157,9 @@
* @param jsonTemplates The template properties as String
* @return a map
*/
- @SuppressWarnings("unused")
- private LinkedHashMap<String, JsonTemplate> initializeTemplates(String jsonTemplates) {
+ private Map<String, JsonTemplate> initializeTemplates(String jsonTemplates) {
- LinkedHashMap<String, JsonTemplate> generatedTemplates = new LinkedHashMap<>();
+ Map<String, JsonTemplate> generatedTemplates = new LinkedHashMap<>();
JsonObject templates = JsonUtils.GSON.fromJson(jsonTemplates, JsonObject.class);
for (Map.Entry<String, JsonElement> templateAsJson : templates.entrySet()) {
diff --git a/runtime/src/main/java/org/onap/policy/clamp/loop/CsarInstaller.java b/runtime/src/main/java/org/onap/policy/clamp/loop/CsarInstaller.java
index aefe455..1542d97 100644
--- a/runtime/src/main/java/org/onap/policy/clamp/loop/CsarInstaller.java
+++ b/runtime/src/main/java/org/onap/policy/clamp/loop/CsarInstaller.java
@@ -43,7 +43,6 @@
import org.onap.policy.clamp.loop.template.LoopElementModel;
import org.onap.policy.clamp.loop.template.LoopTemplate;
import org.onap.policy.clamp.loop.template.LoopTemplatesRepository;
-import org.onap.policy.clamp.loop.template.PolicyModelsRepository;
import org.onap.policy.clamp.policy.PolicyEngineServices;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -63,9 +62,6 @@
private static final Logger logger = LoggerFactory.getLogger(CsarInstaller.class);
@Autowired
- private PolicyModelsRepository policyModelsRepository;
-
- @Autowired
private LoopTemplatesRepository loopTemplatesRepository;
@Autowired
diff --git a/runtime/src/main/java/org/onap/policy/clamp/policy/pdpgroup/PdpGroupPayload.java b/runtime/src/main/java/org/onap/policy/clamp/policy/pdpgroup/PdpGroupPayload.java
index bbf33d5..a161860 100644
--- a/runtime/src/main/java/org/onap/policy/clamp/policy/pdpgroup/PdpGroupPayload.java
+++ b/runtime/src/main/java/org/onap/policy/clamp/policy/pdpgroup/PdpGroupPayload.java
@@ -119,12 +119,12 @@
this.deploymentGroups.getGroups().stream().filter(group ->
group.getName().equals(pdpGroup)).findFirst()
.ifPresentOrElse(group -> group.getDeploymentSubgroups().add(newSubGroup),
- () -> {
- var newGroup = new DeploymentGroup();
- newGroup.setName(pdpGroup);
- newGroup.setDeploymentSubgroups(new ArrayList<>(Arrays.asList(newSubGroup)));
- this.deploymentGroups.getGroups().add(newGroup);
- });
+ () -> {
+ var newGroup = new DeploymentGroup();
+ newGroup.setName(pdpGroup);
+ newGroup.setDeploymentSubgroups(new ArrayList<>(Arrays.asList(newSubGroup)));
+ this.deploymentGroups.getGroups().add(newGroup);
+ });
}
/**
diff --git a/runtime/src/test/java/org/onap/policy/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItTestCase.java b/runtime/src/test/java/org/onap/policy/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItTestCase.java
index 1d78d6c..165fd3f 100644
--- a/runtime/src/test/java/org/onap/policy/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItTestCase.java
+++ b/runtime/src/test/java/org/onap/policy/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItTestCase.java
@@ -29,7 +29,6 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.onap.policy.clamp.clds.Application;
-import org.onap.policy.clamp.clds.tosca.update.execution.ToscaMetadataExecutor;
import org.onap.policy.clamp.clds.tosca.update.parser.metadata.ToscaMetadataParserWithDictionarySupport;
import org.onap.policy.clamp.clds.tosca.update.templates.JsonTemplateManager;
import org.onap.policy.clamp.clds.util.JsonUtils;
@@ -55,9 +54,6 @@
@Autowired
private ToscaMetadataParserWithDictionarySupport toscaMetadataParserWithDictionarySupport;
- @Autowired
- private ToscaMetadataExecutor toscaMetadataExecutor;
-
/**
* This Test validates Tosca yaml with metadata tag that contains policy_model_type and acronym
* parameters which defines the Tosca Policy name and its short name.
diff --git a/runtime/src/test/java/org/onap/policy/clamp/clds/util/LoggingUtilsTest.java b/runtime/src/test/java/org/onap/policy/clamp/clds/util/LoggingUtilsTest.java
index f3ca978..57837ef 100644
--- a/runtime/src/test/java/org/onap/policy/clamp/clds/util/LoggingUtilsTest.java
+++ b/runtime/src/test/java/org/onap/policy/clamp/clds/util/LoggingUtilsTest.java
@@ -2,6 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP CLAMP
* Copyright (C) 2019 Samsung. All rights reserved.
+* Modifications Copyright (C) 2021 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.
@@ -22,7 +23,6 @@
package org.onap.policy.clamp.clds.util;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
@@ -38,7 +38,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.junit.MockitoJUnitRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
diff --git a/runtime/src/test/java/org/onap/policy/clamp/loop/ExternalComponentStateTest.java b/runtime/src/test/java/org/onap/policy/clamp/loop/ExternalComponentStateTest.java
index 567cad6..de8ec4a 100644
--- a/runtime/src/test/java/org/onap/policy/clamp/loop/ExternalComponentStateTest.java
+++ b/runtime/src/test/java/org/onap/policy/clamp/loop/ExternalComponentStateTest.java
@@ -40,6 +40,7 @@
}
@Test
+ @SuppressWarnings("unlikely-arg-type")
public void equalsTest() {
assertThat(state.equals(null)).isFalse();
@@ -68,7 +69,7 @@
public void compareToTest() {
ExternalComponentState state2 = new ExternalComponentState("NOT_SENT",
"The policies defined have NOT yet been created on the policy engine", 90);
- assertThat(state.compareTo(state2)).isEqualTo(0);
+ assertThat(state).isEqualByComparingTo(state2);
ExternalComponentState state3 = new ExternalComponentState("SENT",
"The policies defined have NOT yet been created on the policy engine", 50);