summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/onap/clamp/authorization/SecureServicePermission.java2
-rw-r--r--src/main/java/org/onap/clamp/clds/ClampServlet.java3
-rw-r--r--src/main/java/org/onap/clamp/clds/client/CdsServices.java2
-rw-r--r--src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java2
-rw-r--r--src/main/java/org/onap/clamp/clds/config/AafConfiguration.java1
-rw-r--r--src/main/java/org/onap/clamp/clds/config/SystemPropertiesLoader.java3
-rw-r--r--src/main/java/org/onap/clamp/clds/config/sdc/SdcControllersConfiguration.java2
-rw-r--r--src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java3
-rw-r--r--src/main/java/org/onap/clamp/clds/model/cds/CdsBpWorkFlowListResponse.java1
-rw-r--r--src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java2
-rw-r--r--src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java2
-rw-r--r--src/main/java/org/onap/clamp/clds/sdc/controller/installer/ChainGenerator.java1
-rw-r--r--src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java2
-rw-r--r--src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java11
-rw-r--r--src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParserWithDictionarySupport.java24
-rw-r--r--src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplate.java3
-rw-r--r--src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplateManager.java12
-rw-r--r--src/main/java/org/onap/clamp/clds/util/ClampVersioning.java1
-rw-r--r--src/main/java/org/onap/clamp/clds/util/JsonUtils.java2
-rw-r--r--src/main/java/org/onap/clamp/clds/util/LoggingUtils.java4
-rw-r--r--src/main/java/org/onap/clamp/clds/util/OnapLogConstants.java22
-rw-r--r--src/main/java/org/onap/clamp/configuration/ClampGsonDataFormat.java2
-rw-r--r--src/main/java/org/onap/clamp/dao/model/gson/converter/InstantDeserializer.java1
-rw-r--r--src/main/java/org/onap/clamp/dao/model/gson/converter/InstantSerializer.java1
-rw-r--r--src/main/java/org/onap/clamp/dao/model/jsontype/JsonStringSqlTypeDescriptor.java1
-rw-r--r--src/main/java/org/onap/clamp/dao/model/jsontype/JsonTypeDescriptor.java2
-rw-r--r--src/main/java/org/onap/clamp/dao/model/jsontype/StringJsonUserType.java1
-rw-r--r--src/main/java/org/onap/clamp/loop/CsarInstaller.java6
-rw-r--r--src/main/java/org/onap/clamp/loop/Loop.java6
-rw-r--r--src/main/java/org/onap/clamp/loop/LoopsRepository.java1
-rw-r--r--src/main/java/org/onap/clamp/loop/cds/CdsDataInstaller.java3
-rw-r--r--src/main/java/org/onap/clamp/loop/common/AuditEntity.java6
-rw-r--r--src/main/java/org/onap/clamp/loop/components/external/DcaeComponent.java47
-rw-r--r--src/main/java/org/onap/clamp/loop/components/external/ExternalComponent.java1
-rw-r--r--src/main/java/org/onap/clamp/loop/components/external/PolicyComponent.java23
-rw-r--r--src/main/java/org/onap/clamp/loop/deploy/DcaeDeployParameters.java18
-rw-r--r--src/main/java/org/onap/clamp/loop/log/LoopLog.java3
-rw-r--r--src/main/java/org/onap/clamp/loop/service/Service.java7
-rw-r--r--src/main/java/org/onap/clamp/loop/template/LoopElementModel.java11
-rw-r--r--src/main/java/org/onap/clamp/loop/template/LoopTemplate.java2
-rw-r--r--src/main/java/org/onap/clamp/loop/template/LoopTemplateLoopElementModel.java2
-rw-r--r--src/main/java/org/onap/clamp/loop/template/LoopTemplatesRepository.java1
-rw-r--r--src/main/java/org/onap/clamp/loop/template/PolicyModelId.java1
-rw-r--r--src/main/java/org/onap/clamp/loop/template/PolicyModelsRepository.java1
-rw-r--r--src/main/java/org/onap/clamp/loop/template/PolicyModelsService.java2
-rw-r--r--src/main/java/org/onap/clamp/policy/PolicyService.java1
-rw-r--r--src/main/java/org/onap/clamp/policy/downloader/PolicyEngineController.java2
-rw-r--r--src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java3
-rw-r--r--src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java8
-rw-r--r--src/main/java/org/onap/clamp/policy/pdpgroup/PdpGroup.java1
-rw-r--r--src/main/java/org/onap/clamp/policy/pdpgroup/PolicyModelKey.java1
-rw-r--r--src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java18
-rw-r--r--src/test/java/org/onap/clamp/clds/it/AuthorizationControllerItCase.java2
-rw-r--r--src/test/java/org/onap/clamp/clds/it/config/SdcControllersConfigurationItCase.java4
-rw-r--r--src/test/java/org/onap/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java3
-rw-r--r--src/test/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponseCacheTestItCase.java1
-rw-r--r--src/test/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponseTest.java1
-rw-r--r--src/test/java/org/onap/clamp/clds/model/jsontype/JsonTypeDescriptorTest.java21
-rw-r--r--src/test/java/org/onap/clamp/clds/sdc/controller/installer/ChainGeneratorTest.java1
-rw-r--r--src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java1
-rw-r--r--src/test/java/org/onap/clamp/clds/tosca/update/JsonTemplateFieldTest.java8
-rw-r--r--src/test/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java2
-rw-r--r--src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java2
-rw-r--r--src/test/java/org/onap/clamp/clds/util/JsonUtilsTest.java1
-rw-r--r--src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java5
-rw-r--r--src/test/java/org/onap/clamp/loop/LoopToJsonTest.java1
-rw-r--r--src/test/java/org/onap/clamp/loop/PolicyComponentTest.java4
-rw-r--r--src/test/java/org/onap/clamp/loop/ServiceTest.java1
-rw-r--r--src/test/java/org/onap/clamp/policy/downloader/PolicyEngineControllerTestItCase.java2
-rw-r--r--src/test/java/org/onap/clamp/policy/microservice/MicroServicePayloadTest.java7
-rw-r--r--src/test/java/org/onap/clamp/policy/pdpgroup/PdpGroupTest.java2
-rw-r--r--src/test/java/org/onap/clamp/policy/pdpgroup/PolicyModelKeyTest.java14
72 files changed, 147 insertions, 224 deletions
diff --git a/src/main/java/org/onap/clamp/authorization/SecureServicePermission.java b/src/main/java/org/onap/clamp/authorization/SecureServicePermission.java
index 374aab90c..0ee126ead 100644
--- a/src/main/java/org/onap/clamp/authorization/SecureServicePermission.java
+++ b/src/main/java/org/onap/clamp/authorization/SecureServicePermission.java
@@ -83,7 +83,7 @@ public class SecureServicePermission {
}
/**
- * Instantiate permission given type from concatenated string
+ * Instantiate permission given type from concatenated string.
*
* @param concatenatedString
* the string type|instance|action, less than 3 params can be
diff --git a/src/main/java/org/onap/clamp/clds/ClampServlet.java b/src/main/java/org/onap/clamp/clds/ClampServlet.java
index 8ebc7a16b..5ca3dfb6e 100644
--- a/src/main/java/org/onap/clamp/clds/ClampServlet.java
+++ b/src/main/java/org/onap/clamp/clds/ClampServlet.java
@@ -27,20 +27,17 @@ package org.onap.clamp.clds;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
-
import fj.data.Array;
import java.io.IOException;
import java.security.Principal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-
import java.util.stream.Collector;
import java.util.stream.Collectors;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-
import org.apache.camel.component.servlet.CamelHttpTransportServlet;
import org.onap.clamp.authorization.SecureServicePermission;
import org.springframework.context.ApplicationContext;
diff --git a/src/main/java/org/onap/clamp/clds/client/CdsServices.java b/src/main/java/org/onap/clamp/clds/client/CdsServices.java
index fd3b3539a..31960cc02 100644
--- a/src/main/java/org/onap/clamp/clds/client/CdsServices.java
+++ b/src/main/java/org/onap/clamp/clds/client/CdsServices.java
@@ -29,10 +29,8 @@ import com.att.eelf.configuration.EELFManager;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
-
import java.util.Date;
import java.util.Map;
-
import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.builder.ExchangeBuilder;
diff --git a/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java b/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java
index b24bc99b2..ade96e0a7 100644
--- a/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java
+++ b/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java
@@ -26,10 +26,8 @@ package org.onap.clamp.clds.client;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
-
import java.io.IOException;
import java.util.Date;
-
import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.builder.ExchangeBuilder;
diff --git a/src/main/java/org/onap/clamp/clds/config/AafConfiguration.java b/src/main/java/org/onap/clamp/clds/config/AafConfiguration.java
index d9178cb9a..7c86728bb 100644
--- a/src/main/java/org/onap/clamp/clds/config/AafConfiguration.java
+++ b/src/main/java/org/onap/clamp/clds/config/AafConfiguration.java
@@ -24,7 +24,6 @@
package org.onap.clamp.clds.config;
import javax.servlet.Filter;
-
import org.onap.clamp.clds.filter.ClampCadiFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
diff --git a/src/main/java/org/onap/clamp/clds/config/SystemPropertiesLoader.java b/src/main/java/org/onap/clamp/clds/config/SystemPropertiesLoader.java
index 7480beb8d..10c6901fb 100644
--- a/src/main/java/org/onap/clamp/clds/config/SystemPropertiesLoader.java
+++ b/src/main/java/org/onap/clamp/clds/config/SystemPropertiesLoader.java
@@ -25,11 +25,8 @@ package org.onap.clamp.clds.config;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
-
import java.util.Properties;
-
import javax.annotation.Resource;
-
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;
diff --git a/src/main/java/org/onap/clamp/clds/config/sdc/SdcControllersConfiguration.java b/src/main/java/org/onap/clamp/clds/config/sdc/SdcControllersConfiguration.java
index ad2751bb8..b6f1e1a65 100644
--- a/src/main/java/org/onap/clamp/clds/config/sdc/SdcControllersConfiguration.java
+++ b/src/main/java/org/onap/clamp/clds/config/sdc/SdcControllersConfiguration.java
@@ -31,9 +31,7 @@ import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
-
import javax.annotation.PostConstruct;
-
import org.onap.clamp.clds.exception.sdc.controller.SdcParametersException;
import org.onap.clamp.clds.util.JsonUtils;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java b/src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java
index eca45d66f..62c3a1fd1 100644
--- a/src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java
+++ b/src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java
@@ -25,13 +25,10 @@ package org.onap.clamp.clds.config.spring;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
-
import java.util.ArrayList;
import java.util.List;
-
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
-
import org.onap.clamp.clds.config.ClampProperties;
import org.onap.clamp.clds.config.sdc.SdcControllersConfiguration;
import org.onap.clamp.clds.exception.sdc.controller.SdcControllerException;
diff --git a/src/main/java/org/onap/clamp/clds/model/cds/CdsBpWorkFlowListResponse.java b/src/main/java/org/onap/clamp/clds/model/cds/CdsBpWorkFlowListResponse.java
index 66025c479..36510ea8f 100644
--- a/src/main/java/org/onap/clamp/clds/model/cds/CdsBpWorkFlowListResponse.java
+++ b/src/main/java/org/onap/clamp/clds/model/cds/CdsBpWorkFlowListResponse.java
@@ -23,7 +23,6 @@
package org.onap.clamp.clds.model.cds;
import com.google.gson.annotations.Expose;
-
import java.util.LinkedList;
import java.util.List;
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java b/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java
index f9b43abb7..8afb3e81a 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java
@@ -26,11 +26,9 @@ package org.onap.clamp.clds.sdc.controller;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
-
import java.util.Date;
import java.util.Map.Entry;
import java.util.concurrent.ThreadLocalRandom;
-
import org.onap.clamp.clds.config.ClampProperties;
import org.onap.clamp.clds.config.sdc.SdcSingleControllerConfiguration;
import org.onap.clamp.clds.exception.sdc.controller.BlueprintParserException;
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java
index 5d5027d29..0c6ec8d83 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java
@@ -30,7 +30,6 @@ import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
-
import java.util.AbstractMap;
import java.util.Collections;
import java.util.HashSet;
@@ -38,7 +37,6 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-
import org.json.JSONObject;
import org.onap.clamp.clds.exception.sdc.controller.BlueprintParserException;
import org.yaml.snakeyaml.Yaml;
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/ChainGenerator.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/ChainGenerator.java
index 2bd259c2b..7768cd817 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/ChainGenerator.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/ChainGenerator.java
@@ -27,7 +27,6 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
-
import org.springframework.stereotype.Component;
@Component
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java
index 471415a37..aa1a6af71 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java
@@ -25,7 +25,6 @@ package org.onap.clamp.clds.sdc.controller.installer;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
-
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -40,7 +39,6 @@ import java.util.Map;
import java.util.Optional;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
-
import org.apache.commons.io.IOUtils;
import org.codehaus.plexus.util.StringUtils;
import org.onap.clamp.clds.exception.sdc.controller.CsarHandlerException;
diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java b/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java
index 9721e33d9..d23dc79ec 100644
--- a/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java
+++ b/src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java
@@ -145,8 +145,7 @@ public class ToscaConverterToJsonSchema {
if (getToscaElement((String) property.getValue().getItems().get("type")) != null) {
jsonSchema.add(property.getValue().getName(),
this.getJsonSchemaOfToscaElement((String) property.getValue().getItems().get("type")));
- }
- else {
+ } else {
jsonSchema.add(property.getValue().getName(), this.complexParse(property.getValue()));
}
}
@@ -176,8 +175,7 @@ public class ToscaConverterToJsonSchema {
String typeProperty = (String) toscaElementProperty.getItems().get("type");
if (typeProperty.toLowerCase().equals("list") || typeProperty.toLowerCase().equals("map")) {
currentPropertyJsonTemplate = templates.get("object");
- }
- else {
+ } else {
String propertyType = (String) toscaElementProperty.getItems().get("type");
currentPropertyJsonTemplate = templates.get(propertyType.toLowerCase());
}
@@ -264,9 +262,8 @@ public class ToscaConverterToJsonSchema {
break;
}
- }
- // Native cases
- else if (toscaElementProperty.getItems().get("type").equals("list")) {
+ } else if (toscaElementProperty.getItems().get("type").equals("list")) {
+ // Native cases
JsonObject itemContainer = new JsonObject();
String valueInEntrySchema =
this.extractSpecificFieldFromMap(toscaElementProperty, "entry_schema");
diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParserWithDictionarySupport.java b/src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParserWithDictionarySupport.java
index 33e084279..3fdd192d6 100644
--- a/src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParserWithDictionarySupport.java
+++ b/src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParserWithDictionarySupport.java
@@ -58,8 +58,7 @@ public class ToscaMetadataParserWithDictionarySupport implements ToscaMetadataPa
if (dictionaryService != null) {
return parseMetadataPossibleValues(toscaElementProperty.getItems(), dictionaryService, serviceModel,
toscaMetadataExecutor);
- }
- else {
+ } else {
return null;
}
}
@@ -163,8 +162,7 @@ public class ToscaMetadataParserWithDictionarySupport implements ToscaMetadataPa
if (dictionaryFullNames.size() > 0) {
if (childObject.get(JsonEditorSchemaConstants.ENUM) != null) {
childObject.get(JsonEditorSchemaConstants.ENUM).getAsJsonArray().add(dictionaryFullNames);
- }
- else {
+ } else {
childObject.add(JsonEditorSchemaConstants.ENUM, dictionaryFullNames);
}
// Add Enum titles for generated translated values during JSON instance
@@ -173,17 +171,14 @@ public class ToscaMetadataParserWithDictionarySupport implements ToscaMetadataPa
enumTitles.add(JsonEditorSchemaConstants.ENUM_TITLES, dictionaryNames);
if (childObject.get(JsonEditorSchemaConstants.OPTIONS) != null) {
childObject.get(JsonEditorSchemaConstants.OPTIONS).getAsJsonArray().add(enumTitles);
- }
- else {
+ } else {
childObject.add(JsonEditorSchemaConstants.OPTIONS, enumTitles);
}
- }
- else {
+ } else {
if (childObject.get(JsonEditorSchemaConstants.ENUM) != null) {
childObject.get(JsonEditorSchemaConstants.ENUM).getAsJsonArray().add(dictionaryNames);
- }
- else {
+ } else {
childObject.add(JsonEditorSchemaConstants.ENUM, dictionaryNames);
}
}
@@ -196,8 +191,7 @@ public class ToscaMetadataParserWithDictionarySupport implements ToscaMetadataPa
dictionaryReference.length()).split("#");
if (dictionaryKeyArray.length > 1) {
processComplexDictionaryElements(dictionaryKeyArray, childObject, dictionaryService);
- }
- else {
+ } else {
processSimpleDictionaryElements(dictionaryKeyArray, childObject, dictionaryService);
}
}
@@ -206,11 +200,9 @@ public class ToscaMetadataParserWithDictionarySupport implements ToscaMetadataPa
String jsonType = null;
if (toscaType.equalsIgnoreCase(ToscaSchemaConstants.TYPE_INTEGER)) {
jsonType = JsonEditorSchemaConstants.TYPE_INTEGER;
- }
- else if (toscaType.equalsIgnoreCase(ToscaSchemaConstants.TYPE_LIST)) {
+ } else if (toscaType.equalsIgnoreCase(ToscaSchemaConstants.TYPE_LIST)) {
jsonType = JsonEditorSchemaConstants.TYPE_ARRAY;
- }
- else {
+ } else {
jsonType = JsonEditorSchemaConstants.TYPE_STRING;
}
return jsonType;
diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplate.java b/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplate.java
index f64ba68cf..0b7a9a171 100644
--- a/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplate.java
+++ b/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplate.java
@@ -197,8 +197,7 @@ public class JsonTemplate {
if (fieldStaticStatus(fieldName)) {
String defaultValue = (String) this.getSpecificField(fieldName).getValue();
jsonSchema.addProperty(fieldName, defaultValue);
- }
- else {
+ } else {
jsonSchema.addProperty(fieldName, value);
}
}
diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplateManager.java b/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplateManager.java
index 0b399ba0b..a278cb667 100644
--- a/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplateManager.java
+++ b/src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplateManager.java
@@ -52,8 +52,7 @@ public class JsonTemplateManager {
if (toscaYamlContent != null && !toscaYamlContent.isEmpty()) {
this.toscaElements = ToscaElementParser.searchAllToscaElements(toscaYamlContent, nativeToscaDatatypes);
this.jsonSchemaTemplates = initializeTemplates(jsonSchemaTemplates);
- }
- else {
+ } else {
toscaElements = null;
}
}
@@ -111,10 +110,9 @@ public class JsonTemplateManager {
if (operation
&& !this.jsonSchemaTemplates.get(nameTemplate).getJsonTemplateFields().contains(jsonTemplateField)) {
this.jsonSchemaTemplates.get(nameTemplate).addField(jsonTemplateField);
- }
- // Operation = false && field is present => remove Field
- else if (!operation
+ } else if (!operation
&& this.jsonSchemaTemplates.get(nameTemplate).getJsonTemplateFields().contains(jsonTemplateField)) {
+ // Operation = false && field is present => remove Field
this.jsonSchemaTemplates.get(nameTemplate).removeField(jsonTemplateField);
}
}
@@ -139,8 +137,8 @@ public class JsonTemplateManager {
* For a given policy type, get a corresponding JsonObject from the tosca model.
*
* @param policyType The policy type in the tosca
- * @param toscaMetadataParser The MetadataParser class that must be used if metadata section are encountered, if null
- * they will be skipped
+ * @param toscaMetadataParser The MetadataParser class that must be used if metadata section are encountered,
+ * if null they will be skipped
* @return an json object defining the equivalent json schema from the tosca for a given policy type
*/
public JsonObject getJsonSchemaForPolicyType(String policyType, ToscaMetadataParser toscaMetadataParser,
diff --git a/src/main/java/org/onap/clamp/clds/util/ClampVersioning.java b/src/main/java/org/onap/clamp/clds/util/ClampVersioning.java
index ec0162cb1..bcdae5e43 100644
--- a/src/main/java/org/onap/clamp/clds/util/ClampVersioning.java
+++ b/src/main/java/org/onap/clamp/clds/util/ClampVersioning.java
@@ -26,7 +26,6 @@ package org.onap.clamp.clds.util;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
-
import java.io.InputStream;
import java.util.Properties;
diff --git a/src/main/java/org/onap/clamp/clds/util/JsonUtils.java b/src/main/java/org/onap/clamp/clds/util/JsonUtils.java
index 8024331f2..fa639a0a1 100644
--- a/src/main/java/org/onap/clamp/clds/util/JsonUtils.java
+++ b/src/main/java/org/onap/clamp/clds/util/JsonUtils.java
@@ -27,9 +27,7 @@ import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
-
import java.time.Instant;
-
import org.onap.clamp.authorization.SecureServicePermission;
import org.onap.clamp.authorization.SecureServicePermissionDeserializer;
import org.onap.clamp.dao.model.gson.converter.InstantDeserializer;
diff --git a/src/main/java/org/onap/clamp/clds/util/LoggingUtils.java b/src/main/java/org/onap/clamp/clds/util/LoggingUtils.java
index 0ac1a14fc..a502a52cb 100644
--- a/src/main/java/org/onap/clamp/clds/util/LoggingUtils.java
+++ b/src/main/java/org/onap/clamp/clds/util/LoggingUtils.java
@@ -168,9 +168,9 @@ public class LoggingUtils {
return dateFormat;
}
- /*********************************************************************************************
+ /* *******************************************************************************************
* Method for ONAP Application Logging Specification v1.2
- ********************************************************************************************/
+ * *******************************************************************************************/
/**
* Report <tt>ENTERING</tt> marker.
diff --git a/src/main/java/org/onap/clamp/clds/util/OnapLogConstants.java b/src/main/java/org/onap/clamp/clds/util/OnapLogConstants.java
index 8952e5df1..8185b7592 100644
--- a/src/main/java/org/onap/clamp/clds/util/OnapLogConstants.java
+++ b/src/main/java/org/onap/clamp/clds/util/OnapLogConstants.java
@@ -190,10 +190,10 @@ public final class OnapLogConstants {
/** MDC reporting outcome description. */
public static final String RESPONSE_DESCRIPTION = "ResponseDesc";
- /** MDC reporting severity */
+ /** MDC reporting severity. */
public static final String RESPONSE_SEVERITY = "Severity";
- /** MDC reporting response status code */
+ /** MDC reporting response status code. */
public static final String RESPONSE_STATUS_CODE = "StatusCode";
/** MDC recording error code. */
@@ -267,20 +267,20 @@ public final class OnapLogConstants {
ASYNCHRONOUS("ASYNCHRONOUS", Markers.INVOKE_ASYNCHRONOUS);
/** Enum value. */
- private String mString;
+ private String enumValue;
/** Corresponding marker. */
- private Marker mMarker;
+ private Marker marker;
/**
* Construct enum.
*
- * @param s enum value.
- * @param m corresponding Marker.
+ * @param enumValue enum value.
+ * @param marker corresponding Marker.
*/
- InvocationMode(final String s, final Marker m) {
- this.mString = s;
- this.mMarker = m;
+ InvocationMode(final String enumValue, final Marker marker) {
+ this.enumValue = enumValue;
+ this.marker = marker;
}
/**
@@ -289,7 +289,7 @@ public final class OnapLogConstants {
* @return Marker.
*/
public Marker getMarker() {
- return this.mMarker;
+ return this.marker;
}
/**
@@ -297,7 +297,7 @@ public final class OnapLogConstants {
*/
@Override
public String toString() {
- return this.mString;
+ return this.enumValue;
}
}
diff --git a/src/main/java/org/onap/clamp/configuration/ClampGsonDataFormat.java b/src/main/java/org/onap/clamp/configuration/ClampGsonDataFormat.java
index ca5f37656..3b56772ca 100644
--- a/src/main/java/org/onap/clamp/configuration/ClampGsonDataFormat.java
+++ b/src/main/java/org/onap/clamp/configuration/ClampGsonDataFormat.java
@@ -23,7 +23,6 @@
package org.onap.clamp.configuration;
import com.google.gson.Gson;
-
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStream;
@@ -32,7 +31,6 @@ import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.lang.reflect.Type;
import java.nio.charset.StandardCharsets;
-
import org.apache.camel.Exchange;
import org.apache.camel.spi.DataFormat;
import org.apache.camel.spi.DataFormatName;
diff --git a/src/main/java/org/onap/clamp/dao/model/gson/converter/InstantDeserializer.java b/src/main/java/org/onap/clamp/dao/model/gson/converter/InstantDeserializer.java
index 2d63e55fa..2c6c47f54 100644
--- a/src/main/java/org/onap/clamp/dao/model/gson/converter/InstantDeserializer.java
+++ b/src/main/java/org/onap/clamp/dao/model/gson/converter/InstantDeserializer.java
@@ -26,7 +26,6 @@ package org.onap.clamp.dao.model.gson.converter;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
-
import java.lang.reflect.Type;
import java.time.Instant;
import java.time.ZoneId;
diff --git a/src/main/java/org/onap/clamp/dao/model/gson/converter/InstantSerializer.java b/src/main/java/org/onap/clamp/dao/model/gson/converter/InstantSerializer.java
index cdb439e46..3705f122b 100644
--- a/src/main/java/org/onap/clamp/dao/model/gson/converter/InstantSerializer.java
+++ b/src/main/java/org/onap/clamp/dao/model/gson/converter/InstantSerializer.java
@@ -27,7 +27,6 @@ import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
-
import java.lang.reflect.Type;
import java.time.Instant;
import java.time.format.DateTimeFormatter;
diff --git a/src/main/java/org/onap/clamp/dao/model/jsontype/JsonStringSqlTypeDescriptor.java b/src/main/java/org/onap/clamp/dao/model/jsontype/JsonStringSqlTypeDescriptor.java
index f5aba4e11..7370e40bf 100644
--- a/src/main/java/org/onap/clamp/dao/model/jsontype/JsonStringSqlTypeDescriptor.java
+++ b/src/main/java/org/onap/clamp/dao/model/jsontype/JsonStringSqlTypeDescriptor.java
@@ -28,7 +28,6 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Types;
-
import org.hibernate.type.descriptor.ValueBinder;
import org.hibernate.type.descriptor.ValueExtractor;
import org.hibernate.type.descriptor.WrapperOptions;
diff --git a/src/main/java/org/onap/clamp/dao/model/jsontype/JsonTypeDescriptor.java b/src/main/java/org/onap/clamp/dao/model/jsontype/JsonTypeDescriptor.java
index 518ec2d04..266809401 100644
--- a/src/main/java/org/onap/clamp/dao/model/jsontype/JsonTypeDescriptor.java
+++ b/src/main/java/org/onap/clamp/dao/model/jsontype/JsonTypeDescriptor.java
@@ -24,9 +24,7 @@
package org.onap.clamp.dao.model.jsontype;
import com.google.gson.JsonObject;
-
import java.io.Serializable;
-
import org.hibernate.type.descriptor.WrapperOptions;
import org.hibernate.type.descriptor.java.AbstractTypeDescriptor;
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
diff --git a/src/main/java/org/onap/clamp/dao/model/jsontype/StringJsonUserType.java b/src/main/java/org/onap/clamp/dao/model/jsontype/StringJsonUserType.java
index 621fa8dad..509057d16 100644
--- a/src/main/java/org/onap/clamp/dao/model/jsontype/StringJsonUserType.java
+++ b/src/main/java/org/onap/clamp/dao/model/jsontype/StringJsonUserType.java
@@ -24,7 +24,6 @@
package org.onap.clamp.dao.model.jsontype;
import com.google.gson.JsonObject;
-
import org.hibernate.type.AbstractSingleColumnStandardBasicType;
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;
diff --git a/src/main/java/org/onap/clamp/loop/CsarInstaller.java b/src/main/java/org/onap/clamp/loop/CsarInstaller.java
index 6752a1a36..a1ef612c6 100644
--- a/src/main/java/org/onap/clamp/loop/CsarInstaller.java
+++ b/src/main/java/org/onap/clamp/loop/CsarInstaller.java
@@ -187,9 +187,9 @@ public class CsarInstaller {
loopElementModel.addPolicyModel(newPolicyModel);
} else {
throw new SdcArtifactInstallerException(
- "Unable to find the policy specified in the blueprint " +
- blueprintArtifact.getBlueprintArtifactName() + ") on the Policy Engine:" +
- microService.getModelType() + "/" + microService.getModelVersion());
+ "Unable to find the policy specified in the blueprint " + blueprintArtifact
+ .getBlueprintArtifactName() + ") on the Policy Engine:"
+ + microService.getModelType() + "/" + microService.getModelVersion());
}
}
return newSet;
diff --git a/src/main/java/org/onap/clamp/loop/Loop.java b/src/main/java/org/onap/clamp/loop/Loop.java
index 36f74221e..9fde19542 100644
--- a/src/main/java/org/onap/clamp/loop/Loop.java
+++ b/src/main/java/org/onap/clamp/loop/Loop.java
@@ -162,8 +162,7 @@ public class Loop extends AuditEntity implements Serializable {
if (LoopElementModel.MICRO_SERVICE_TYPE.equals(element.getLoopElementModel().getLoopElementType())) {
this.addMicroServicePolicy((MicroServicePolicy) element.getLoopElementModel()
.createPolicyInstance(this, toscaConverter));
- }
- else if (LoopElementModel.OPERATIONAL_POLICY_TYPE
+ } else if (LoopElementModel.OPERATIONAL_POLICY_TYPE
.equals(element.getLoopElementModel().getLoopElementType())) {
this.addOperationalPolicy((OperationalPolicy) element.getLoopElementModel()
.createPolicyInstance(this, toscaConverter));
@@ -381,8 +380,7 @@ public class Loop extends AuditEntity implements Serializable {
if (other.name != null) {
return false;
}
- }
- else if (!name.equals(other.name)) {
+ } else if (!name.equals(other.name)) {
return false;
}
return true;
diff --git a/src/main/java/org/onap/clamp/loop/LoopsRepository.java b/src/main/java/org/onap/clamp/loop/LoopsRepository.java
index aaa49116f..c2ef2fd0e 100644
--- a/src/main/java/org/onap/clamp/loop/LoopsRepository.java
+++ b/src/main/java/org/onap/clamp/loop/LoopsRepository.java
@@ -24,7 +24,6 @@
package org.onap.clamp.loop;
import java.util.List;
-
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
diff --git a/src/main/java/org/onap/clamp/loop/cds/CdsDataInstaller.java b/src/main/java/org/onap/clamp/loop/cds/CdsDataInstaller.java
index d18cae1d6..4c331b7d0 100644
--- a/src/main/java/org/onap/clamp/loop/cds/CdsDataInstaller.java
+++ b/src/main/java/org/onap/clamp/loop/cds/CdsDataInstaller.java
@@ -80,8 +80,7 @@ public class CdsDataInstaller {
resourcesPropByType.getAsJsonObject(nodeTemplate.getName())
.add(CONTROLLER_PROPERTIES, controllerProperties);
logger.info("Successfully installed the CDS data in Service");
- }
- else {
+ } else {
logger.warn("Skipping CDS data installation in Service, as sdnc_model_name and "
+ "sdnc_model_version are not provided in the CSAR");
}
diff --git a/src/main/java/org/onap/clamp/loop/common/AuditEntity.java b/src/main/java/org/onap/clamp/loop/common/AuditEntity.java
index 7ce12ec6b..d5a1bfc59 100644
--- a/src/main/java/org/onap/clamp/loop/common/AuditEntity.java
+++ b/src/main/java/org/onap/clamp/loop/common/AuditEntity.java
@@ -74,8 +74,7 @@ public class AuditEntity {
public void setCreatedDate(Instant createdDate) {
if (createdDate != null) {
this.createdDate = createdDate.truncatedTo(ChronoUnit.SECONDS);
- }
- else {
+ } else {
this.createdDate = null;
}
}
@@ -97,8 +96,7 @@ public class AuditEntity {
public void setUpdatedDate(Instant updatedDate) {
if (updatedDate != null) {
this.updatedDate = updatedDate.truncatedTo(ChronoUnit.SECONDS);
- }
- else {
+ } else {
this.updatedDate = null;
}
}
diff --git a/src/main/java/org/onap/clamp/loop/components/external/DcaeComponent.java b/src/main/java/org/onap/clamp/loop/components/external/DcaeComponent.java
index 8b8547195..d6a061f41 100644
--- a/src/main/java/org/onap/clamp/loop/components/external/DcaeComponent.java
+++ b/src/main/java/org/onap/clamp/loop/components/external/DcaeComponent.java
@@ -26,12 +26,10 @@ package org.onap.clamp.loop.components.external;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
import com.google.gson.JsonObject;
-
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.UUID;
-
import javax.persistence.Transient;
import org.apache.camel.Exchange;
import org.json.simple.JSONArray;
@@ -209,22 +207,37 @@ public class DcaeComponent extends ExternalComponent {
if (dcaeResponse == null) {
setState(BLUEPRINT_DEPLOYED);
- } else if (dcaeResponse.getOperationType().equals("install") && dcaeResponse.getStatus().equals("succeeded")) {
- setState(MICROSERVICE_INSTALLED_SUCCESSFULLY);
- } else if (dcaeResponse.getOperationType().equals("install") && dcaeResponse.getStatus().equals("processing")) {
- setState(PROCESSING_MICROSERVICE_INSTALLATION);
- } else if (dcaeResponse.getOperationType().equals("install") && dcaeResponse.getStatus().equals("failed")) {
- setState(MICROSERVICE_INSTALLATION_FAILED);
- } else if (dcaeResponse.getOperationType().equals("uninstall")
- && dcaeResponse.getStatus().equals("succeeded")) {
- setState(MICROSERVICE_UNINSTALLED_SUCCESSFULLY);
- } else if (dcaeResponse.getOperationType().equals("uninstall")
- && dcaeResponse.getStatus().equals("processing")) {
- setState(PROCESSING_MICROSERVICE_UNINSTALLATION);
- } else if (dcaeResponse.getOperationType().equals("uninstall") && dcaeResponse.getStatus().equals("failed")) {
- setState(MICROSERVICE_UNINSTALLATION_FAILED);
} else {
- setState(IN_ERROR);
+ if (dcaeResponse.getOperationType().equals("install") && dcaeResponse.getStatus().equals("succeeded")) {
+ setState(MICROSERVICE_INSTALLED_SUCCESSFULLY);
+ } else {
+ if (dcaeResponse.getOperationType().equals("install") && dcaeResponse.getStatus()
+ .equals("processing")) {
+ setState(PROCESSING_MICROSERVICE_INSTALLATION);
+ } else {
+ if (dcaeResponse.getOperationType().equals("install") && dcaeResponse.getStatus()
+ .equals("failed")) {
+ setState(MICROSERVICE_INSTALLATION_FAILED);
+ } else {
+ if (dcaeResponse.getOperationType().equals("uninstall")
+ && dcaeResponse.getStatus().equals("succeeded")) {
+ setState(MICROSERVICE_UNINSTALLED_SUCCESSFULLY);
+ } else {
+ if (dcaeResponse.getOperationType().equals("uninstall")
+ && dcaeResponse.getStatus().equals("processing")) {
+ setState(PROCESSING_MICROSERVICE_UNINSTALLATION);
+ } else {
+ if (dcaeResponse.getOperationType().equals("uninstall") && dcaeResponse.getStatus()
+ .equals("failed")) {
+ setState(MICROSERVICE_UNINSTALLATION_FAILED);
+ } else {
+ setState(IN_ERROR);
+ }
+ }
+ }
+ }
+ }
+ }
}
return this.getState();
}
diff --git a/src/main/java/org/onap/clamp/loop/components/external/ExternalComponent.java b/src/main/java/org/onap/clamp/loop/components/external/ExternalComponent.java
index 2be707fe4..1cfb93a35 100644
--- a/src/main/java/org/onap/clamp/loop/components/external/ExternalComponent.java
+++ b/src/main/java/org/onap/clamp/loop/components/external/ExternalComponent.java
@@ -24,7 +24,6 @@
package org.onap.clamp.loop.components.external;
import com.google.gson.annotations.Expose;
-
import org.apache.camel.Exchange;
/**
diff --git a/src/main/java/org/onap/clamp/loop/components/external/PolicyComponent.java b/src/main/java/org/onap/clamp/loop/components/external/PolicyComponent.java
index 4ea5b7118..8a5ff7fc6 100644
--- a/src/main/java/org/onap/clamp/loop/components/external/PolicyComponent.java
+++ b/src/main/java/org/onap/clamp/loop/components/external/PolicyComponent.java
@@ -75,7 +75,8 @@ public class PolicyComponent extends ExternalComponent {
/**
* Generates the Json that must be sent to policy to add all policies to Active
* PDP group.
- * @param loop the loop object
+ *
+ * @param loop the loop object
* @param action POST (to add policy to group) or DELETE (to delete policy from group)
* @return The json, payload to send
*/
@@ -113,13 +114,11 @@ public class PolicyComponent extends ExternalComponent {
if (pdpGroupMap.get(pdpGroup) == null) {
pdpSubGroupMap = new HashMap<>();
policyList = new LinkedList<>();
- }
- else {
+ } else {
pdpSubGroupMap = pdpGroupMap.get(pdpGroup);
if (pdpSubGroupMap.get(pdpSubGroup) == null) {
policyList = new LinkedList<>();
- }
- else {
+ } else {
policyList = (List<JsonObject>) pdpSubGroupMap.get(pdpSubGroup);
}
}
@@ -162,12 +161,14 @@ public class PolicyComponent extends ExternalComponent {
ExternalComponentState newState = NOT_SENT;
if (found && deployed) {
newState = SENT_AND_DEPLOYED;
- }
- else if (found) {
- newState = SENT;
- }
- else if (deployed) {
- newState = IN_ERROR;
+ } else {
+ if (found) {
+ newState = SENT;
+ } else {
+ if (deployed) {
+ newState = IN_ERROR;
+ }
+ }
}
return newState;
}
diff --git a/src/main/java/org/onap/clamp/loop/deploy/DcaeDeployParameters.java b/src/main/java/org/onap/clamp/loop/deploy/DcaeDeployParameters.java
index 65506a479..b00c99c5f 100644
--- a/src/main/java/org/onap/clamp/loop/deploy/DcaeDeployParameters.java
+++ b/src/main/java/org/onap/clamp/loop/deploy/DcaeDeployParameters.java
@@ -63,8 +63,7 @@ public class DcaeDeployParameters {
Object defaultValue = ((Map<String, Object>) elem.getValue()).get("default");
if (defaultValue != null) {
addPropertyToNode(deployJsonBody, elem.getKey(), defaultValue);
- }
- else {
+ } else {
deployJsonBody.addProperty(elem.getKey(), "");
}
});
@@ -75,17 +74,13 @@ public class DcaeDeployParameters {
private static void addPropertyToNode(JsonObject node, String key, Object value) {
if (value instanceof String) {
node.addProperty(key, (String) value);
- }
- else if (value instanceof Number) {
+ } else if (value instanceof Number) {
node.addProperty(key, (Number) value);
- }
- else if (value instanceof Boolean) {
+ } else if (value instanceof Boolean) {
node.addProperty(key, (Boolean) value);
- }
- else if (value instanceof Character) {
+ } else if (value instanceof Character) {
node.addProperty(key, (Character) value);
- }
- else {
+ } else {
node.addProperty(key, JsonUtils.GSON.toJson(value));
}
}
@@ -105,8 +100,7 @@ public class DcaeDeployParameters {
generateDcaeDeployParameter(loop.getLoopTemplate().getBlueprint(),
((MicroServicePolicy) loop.getMicroServicePolicies().toArray()[0]).getName()));
- }
- else {
+ } else {
LinkedHashMap<String, JsonObject> deploymentParamMap = init(loop);
for (Map.Entry<String, JsonObject> mapElement : deploymentParamMap.entrySet()) {
deployParamJson.add(mapElement.getKey(), mapElement.getValue());
diff --git a/src/main/java/org/onap/clamp/loop/log/LoopLog.java b/src/main/java/org/onap/clamp/loop/log/LoopLog.java
index e49598879..ad3c7970f 100644
--- a/src/main/java/org/onap/clamp/loop/log/LoopLog.java
+++ b/src/main/java/org/onap/clamp/loop/log/LoopLog.java
@@ -24,11 +24,9 @@
package org.onap.clamp.loop.log;
import com.google.gson.annotations.Expose;
-
import java.io.Serializable;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
-
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
@@ -40,7 +38,6 @@ import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
-
import org.onap.clamp.loop.Loop;
/**
diff --git a/src/main/java/org/onap/clamp/loop/service/Service.java b/src/main/java/org/onap/clamp/loop/service/Service.java
index 338032a16..2ac9d7e87 100644
--- a/src/main/java/org/onap/clamp/loop/service/Service.java
+++ b/src/main/java/org/onap/clamp/loop/service/Service.java
@@ -158,9 +158,10 @@ public class Service implements Serializable {
if (other.serviceUuid != null) {
return false;
}
- }
- else if (!serviceUuid.equals(other.serviceUuid)) {
- return false;
+ } else {
+ if (!serviceUuid.equals(other.serviceUuid)) {
+ return false;
+ }
}
return true;
}
diff --git a/src/main/java/org/onap/clamp/loop/template/LoopElementModel.java b/src/main/java/org/onap/clamp/loop/template/LoopElementModel.java
index 70cdbe233..f210df949 100644
--- a/src/main/java/org/onap/clamp/loop/template/LoopElementModel.java
+++ b/src/main/java/org/onap/clamp/loop/template/LoopElementModel.java
@@ -212,7 +212,7 @@ public class LoopElementModel extends AuditEntity implements Serializable {
}
/**
- * @param shortName the shortName to set.
+ * * @param shortName the shortName to set.
*/
public void setShortName(String shortName) {
this.shortName = shortName;
@@ -255,11 +255,9 @@ public class LoopElementModel extends AuditEntity implements Serializable {
public Policy createPolicyInstance(Loop loop, ToscaConverterWithDictionarySupport toscaConverter) {
if (LoopElementModel.MICRO_SERVICE_TYPE.equals(this.getLoopElementType())) {
return new MicroServicePolicy(loop, loop.getModelService(), this, toscaConverter);
- }
- else if (LoopElementModel.OPERATIONAL_POLICY_TYPE.equals(this.getLoopElementType())) {
+ } else if (LoopElementModel.OPERATIONAL_POLICY_TYPE.equals(this.getLoopElementType())) {
return new OperationalPolicy(loop, loop.getModelService(), this, toscaConverter);
- }
- else {
+ } else {
return null;
}
}
@@ -288,8 +286,7 @@ public class LoopElementModel extends AuditEntity implements Serializable {
if (other.name != null) {
return false;
}
- }
- else if (!name.equals(other.name)) {
+ } else if (!name.equals(other.name)) {
return false;
}
return true;
diff --git a/src/main/java/org/onap/clamp/loop/template/LoopTemplate.java b/src/main/java/org/onap/clamp/loop/template/LoopTemplate.java
index 6f896f3d4..1204c6c62 100644
--- a/src/main/java/org/onap/clamp/loop/template/LoopTemplate.java
+++ b/src/main/java/org/onap/clamp/loop/template/LoopTemplate.java
@@ -223,7 +223,7 @@ public class LoopTemplate extends AuditEntity implements Serializable {
* @param loopElementModel The loopElementModel to add
*/
public void addLoopElementModel(LoopElementModel loopElementModel) {
- this.addLoopElementModel(loopElementModel,this.loopElementModelsUsed.size());
+ this.addLoopElementModel(loopElementModel, this.loopElementModelsUsed.size());
}
/**
diff --git a/src/main/java/org/onap/clamp/loop/template/LoopTemplateLoopElementModel.java b/src/main/java/org/onap/clamp/loop/template/LoopTemplateLoopElementModel.java
index aca16bc04..36fc3fb1d 100644
--- a/src/main/java/org/onap/clamp/loop/template/LoopTemplateLoopElementModel.java
+++ b/src/main/java/org/onap/clamp/loop/template/LoopTemplateLoopElementModel.java
@@ -24,9 +24,7 @@
package org.onap.clamp.loop.template;
import com.google.gson.annotations.Expose;
-
import java.io.Serializable;
-
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
diff --git a/src/main/java/org/onap/clamp/loop/template/LoopTemplatesRepository.java b/src/main/java/org/onap/clamp/loop/template/LoopTemplatesRepository.java
index 07f304de7..c647c261a 100644
--- a/src/main/java/org/onap/clamp/loop/template/LoopTemplatesRepository.java
+++ b/src/main/java/org/onap/clamp/loop/template/LoopTemplatesRepository.java
@@ -24,7 +24,6 @@
package org.onap.clamp.loop.template;
import java.util.List;
-
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
diff --git a/src/main/java/org/onap/clamp/loop/template/PolicyModelId.java b/src/main/java/org/onap/clamp/loop/template/PolicyModelId.java
index c4dd1933b..3fd19171f 100644
--- a/src/main/java/org/onap/clamp/loop/template/PolicyModelId.java
+++ b/src/main/java/org/onap/clamp/loop/template/PolicyModelId.java
@@ -24,7 +24,6 @@
package org.onap.clamp.loop.template;
import com.google.gson.annotations.Expose;
-
import java.io.Serializable;
public class PolicyModelId implements Serializable {
diff --git a/src/main/java/org/onap/clamp/loop/template/PolicyModelsRepository.java b/src/main/java/org/onap/clamp/loop/template/PolicyModelsRepository.java
index a76e386b5..f4b09caeb 100644
--- a/src/main/java/org/onap/clamp/loop/template/PolicyModelsRepository.java
+++ b/src/main/java/org/onap/clamp/loop/template/PolicyModelsRepository.java
@@ -24,7 +24,6 @@
package org.onap.clamp.loop.template;
import java.util.List;
-
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
diff --git a/src/main/java/org/onap/clamp/loop/template/PolicyModelsService.java b/src/main/java/org/onap/clamp/loop/template/PolicyModelsService.java
index 17cf5c1c8..c482c34d5 100644
--- a/src/main/java/org/onap/clamp/loop/template/PolicyModelsService.java
+++ b/src/main/java/org/onap/clamp/loop/template/PolicyModelsService.java
@@ -142,7 +142,7 @@ public class PolicyModelsService {
*/
@Transactional(propagation = Propagation.REQUIRES_NEW)
public PolicyModel savePolicyModelInNewTransaction(PolicyModel policyModel) {
- return policyModelsRepository.saveAndFlush(policyModel);
+ return policyModelsRepository.saveAndFlush(policyModel);
}
/**
diff --git a/src/main/java/org/onap/clamp/policy/PolicyService.java b/src/main/java/org/onap/clamp/policy/PolicyService.java
index ae15f86da..ad092b516 100644
--- a/src/main/java/org/onap/clamp/policy/PolicyService.java
+++ b/src/main/java/org/onap/clamp/policy/PolicyService.java
@@ -25,7 +25,6 @@ package org.onap.clamp.policy;
import java.util.List;
import java.util.Set;
-
import org.onap.clamp.loop.Loop;
public interface PolicyService<T extends Policy> {
diff --git a/src/main/java/org/onap/clamp/policy/downloader/PolicyEngineController.java b/src/main/java/org/onap/clamp/policy/downloader/PolicyEngineController.java
index 0c3f677a1..b9777029a 100644
--- a/src/main/java/org/onap/clamp/policy/downloader/PolicyEngineController.java
+++ b/src/main/java/org/onap/clamp/policy/downloader/PolicyEngineController.java
@@ -25,9 +25,7 @@ package org.onap.clamp.policy.downloader;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
-
import java.time.Instant;
-
import org.json.simple.parser.ParseException;
import org.onap.clamp.clds.client.PolicyEngineServices;
import org.onap.clamp.loop.template.PolicyModelsRepository;
diff --git a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java
index 77627a31a..a654edab9 100644
--- a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java
+++ b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java
@@ -267,8 +267,7 @@ public class MicroServicePolicy extends Policy implements Serializable {
if (other.name != null) {
return false;
}
- }
- else if (!name.equals(other.name)) {
+ } else if (!name.equals(other.name)) {
return false;
}
return true;
diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
index 0381f0a2a..9bae7bd04 100644
--- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
+++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
@@ -29,12 +29,10 @@ import com.att.eelf.configuration.EELFManager;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
-
import java.io.IOException;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-
import org.onap.clamp.clds.util.JsonUtils;
import org.onap.clamp.clds.util.ResourceFileUtils;
import org.onap.clamp.loop.service.Service;
@@ -57,7 +55,7 @@ public class OperationalPolicyRepresentationBuilder {
public static final String TYPE_ARRAY = "array";
private OperationalPolicyRepresentationBuilder() {
- throw new IllegalStateException("This is Utility class, not supposed to be initiated.");
+ throw new IllegalStateException("This is Utility class, not supposed to be initiated.");
}
/**
@@ -282,7 +280,7 @@ public class OperationalPolicyRepresentationBuilder {
jsonObject.add("artifact_version", createSchemaProperty(
"artifact version", STRING, artifactVersion, "True", null));
jsonObject.add("mode", createCdsInputProperty(
- "mode", STRING, "async" ,null));
+ "mode", STRING, "async", null));
jsonObject.add("data", createDataProperty(inputs, workFlowName));
return jsonObject;
}
@@ -308,7 +306,7 @@ public class OperationalPolicyRepresentationBuilder {
dataObj, workFlowName);
} else {
dataObj.add(entry.getKey(),
- createCdsInputProperty(key, inputProperty.get(TYPE).getAsString(),null,
+ createCdsInputProperty(key, inputProperty.get(TYPE).getAsString(), null,
entry.getValue().getAsJsonObject()));
}
}
diff --git a/src/main/java/org/onap/clamp/policy/pdpgroup/PdpGroup.java b/src/main/java/org/onap/clamp/policy/pdpgroup/PdpGroup.java
index a3cf4e053..6a070c550 100644
--- a/src/main/java/org/onap/clamp/policy/pdpgroup/PdpGroup.java
+++ b/src/main/java/org/onap/clamp/policy/pdpgroup/PdpGroup.java
@@ -26,7 +26,6 @@ package org.onap.clamp.policy.pdpgroup;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.annotations.Expose;
-
import java.util.List;
/**
diff --git a/src/main/java/org/onap/clamp/policy/pdpgroup/PolicyModelKey.java b/src/main/java/org/onap/clamp/policy/pdpgroup/PolicyModelKey.java
index 707b3bd2f..6d9343dc5 100644
--- a/src/main/java/org/onap/clamp/policy/pdpgroup/PolicyModelKey.java
+++ b/src/main/java/org/onap/clamp/policy/pdpgroup/PolicyModelKey.java
@@ -24,7 +24,6 @@
package org.onap.clamp.policy.pdpgroup;
import com.google.gson.annotations.Expose;
-
import java.io.Serializable;
public class PolicyModelKey implements Serializable {
diff --git a/src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java b/src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java
index 06df124ce..311244f48 100644
--- a/src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java
+++ b/src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java
@@ -44,15 +44,17 @@ import org.onap.clamp.clds.util.ResourceFileUtils;
public class SdcSingleControllerConfigurationTest {
/**
- * @param fileName file for sdc controller configuration.
+ * This method loads the SDC controller configuration from a file located in the resource folder.
+ *
+ * @param fileName file for sdc controller configuration.
* @param sdcControllerName sdc controller name.
* @return instance of SdcSingleControllerConfiguration.
*/
public static SdcSingleControllerConfiguration loadControllerConfiguration(String fileName,
- String sdcControllerName) {
+ String sdcControllerName) {
InputStreamReader streamReader = new InputStreamReader(ResourceFileUtils.getResourceAsStream(fileName),
- StandardCharsets.UTF_8);
+ StandardCharsets.UTF_8);
JsonObject jsonNode = JsonUtils.GSON.fromJson(streamReader, JsonObject.class);
return new SdcSingleControllerConfiguration(jsonNode, sdcControllerName);
@@ -61,7 +63,7 @@ public class SdcSingleControllerConfigurationTest {
@Test
public final void testTheInit() throws SdcParametersException, IOException {
SdcSingleControllerConfiguration sdcConfig = loadControllerConfiguration("clds/sdc-controller-config-TLS.json",
- "sdc-controller1");
+ "sdc-controller1");
assertEquals("User", sdcConfig.getUser());
assertEquals("ThePassword", sdcConfig.getPassword());
assertEquals("consumerGroup", sdcConfig.getConsumerGroup());
@@ -72,7 +74,7 @@ public class SdcSingleControllerConfigurationTest {
assertEquals(30, sdcConfig.getPollingTimeout());
assertThat(SdcSingleControllerConfiguration.SUPPORTED_ARTIFACT_TYPES_LIST)
- .hasSameSizeAs(sdcConfig.getRelevantArtifactTypes());
+ .hasSameSizeAs(sdcConfig.getRelevantArtifactTypes());
assertEquals("ThePassword", sdcConfig.getKeyStorePassword());
assertTrue(sdcConfig.activateServerTLSAuth());
assertThat(sdcConfig.getMsgBusAddress()).contains("localhost");
@@ -81,7 +83,7 @@ public class SdcSingleControllerConfigurationTest {
@Test(expected = SdcParametersException.class)
public final void testAllRequiredParameters() throws IOException {
SdcSingleControllerConfiguration sdcConfig = loadControllerConfiguration("clds/sdc-controller-config-TLS.json",
- "sdc-controller1");
+ "sdc-controller1");
// No exception should be raised
sdcConfig.testAllRequiredParameters();
sdcConfig = loadControllerConfiguration("clds/sdc-controller-config-bad.json", "sdc-controller1");
@@ -91,7 +93,7 @@ public class SdcSingleControllerConfigurationTest {
@Test
public final void testAllRequiredParametersEmptyEncrypted() throws IOException {
SdcSingleControllerConfiguration sdcConfig = loadControllerConfiguration(
- "clds/sdc-controller-config-empty-encrypted.json", "sdc-controller1");
+ "clds/sdc-controller-config-empty-encrypted.json", "sdc-controller1");
sdcConfig.testAllRequiredParameters();
assertNull(sdcConfig.getKeyStorePassword());
}
@@ -99,7 +101,7 @@ public class SdcSingleControllerConfigurationTest {
@Test
public final void testConsumerGroupWithNull() throws IOException {
SdcSingleControllerConfiguration sdcConfig = loadControllerConfiguration("clds/sdc-controller-config-NULL.json",
- "sdc-controller1");
+ "sdc-controller1");
assertTrue(sdcConfig.getConsumerGroup() == null);
}
}
diff --git a/src/test/java/org/onap/clamp/clds/it/AuthorizationControllerItCase.java b/src/test/java/org/onap/clamp/clds/it/AuthorizationControllerItCase.java
index 207e93684..48338f17c 100644
--- a/src/test/java/org/onap/clamp/clds/it/AuthorizationControllerItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/AuthorizationControllerItCase.java
@@ -121,7 +121,7 @@ public class AuthorizationControllerItCase {
@Test
public void testIsUserPermitted() {
- assertEquals(AuthorizationController.getPrincipalName(sc),"admin");
+ assertEquals(AuthorizationController.getPrincipalName(sc), "admin");
assertTrue(auth.isUserPermitted(new SecureServicePermission("permission-type-cl", "dev", "read")));
assertTrue(auth.isUserPermitted(new SecureServicePermission("permission-type-cl-manage", "dev", "DEPLOY")));
assertTrue(auth.isUserPermitted(
diff --git a/src/test/java/org/onap/clamp/clds/it/config/SdcControllersConfigurationItCase.java b/src/test/java/org/onap/clamp/clds/it/config/SdcControllersConfigurationItCase.java
index 0c08a2e36..cfdbe7753 100644
--- a/src/test/java/org/onap/clamp/clds/it/config/SdcControllersConfigurationItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/config/SdcControllersConfigurationItCase.java
@@ -25,10 +25,8 @@ import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import com.google.gson.JsonSyntaxException;
-
import java.io.IOException;
import java.util.Map;
-
import org.junit.Test;
import org.junit.runner.RunWith;
import org.onap.clamp.clds.config.sdc.SdcControllersConfiguration;
@@ -45,7 +43,7 @@ import org.springframework.test.util.ReflectionTestUtils;
*/
@RunWith(SpringRunner.class)
@SpringBootTest
-@ActiveProfiles({"clamp-default","clamp-default-user","clamp-sdc-controller"})
+@ActiveProfiles({"clamp-default", "clamp-default-user", "clamp-sdc-controller"})
public class SdcControllersConfigurationItCase {
@Autowired
diff --git a/src/test/java/org/onap/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java b/src/test/java/org/onap/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java
index a8c3e58d4..a3aa8b49b 100644
--- a/src/test/java/org/onap/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java
@@ -33,7 +33,6 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
-
import org.assertj.core.api.Assertions;
import org.junit.Before;
import org.junit.Test;
@@ -58,7 +57,7 @@ import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
-@ActiveProfiles({"clamp-default","clamp-default-user","clamp-sdc-controller"})
+@ActiveProfiles({"clamp-default", "clamp-default-user", "clamp-sdc-controller"})
public class SdcSingleControllerItCase {
private static final String CSAR_ARTIFACT_NAME = "testArtifact.csar";
diff --git a/src/test/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponseCacheTestItCase.java b/src/test/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponseCacheTestItCase.java
index 50da40049..bd0c94d52 100644
--- a/src/test/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponseCacheTestItCase.java
+++ b/src/test/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponseCacheTestItCase.java
@@ -28,7 +28,6 @@ import static org.junit.Assert.assertEquals;
import java.util.HashSet;
import java.util.Set;
-
import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.builder.ExchangeBuilder;
diff --git a/src/test/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponseTest.java b/src/test/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponseTest.java
index fc4872c3b..c5217fdc9 100644
--- a/src/test/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponseTest.java
+++ b/src/test/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponseTest.java
@@ -26,7 +26,6 @@ package org.onap.clamp.clds.model.dcae;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.TreeSet;
-
import org.junit.Test;
public class DcaeInventoryResponseTest {
diff --git a/src/test/java/org/onap/clamp/clds/model/jsontype/JsonTypeDescriptorTest.java b/src/test/java/org/onap/clamp/clds/model/jsontype/JsonTypeDescriptorTest.java
index 560f54cf4..86b3497c6 100644
--- a/src/test/java/org/onap/clamp/clds/model/jsontype/JsonTypeDescriptorTest.java
+++ b/src/test/java/org/onap/clamp/clds/model/jsontype/JsonTypeDescriptorTest.java
@@ -25,7 +25,6 @@ package org.onap.clamp.clds.model.jsontype;
import static org.assertj.core.api.Assertions.assertThat;
import com.google.gson.JsonObject;
-
import org.hibernate.HibernateException;
import org.junit.Test;
import org.onap.clamp.dao.model.jsontype.JsonTypeDescriptor;
@@ -37,10 +36,10 @@ public class JsonTypeDescriptorTest {
@Test
public void testFromString() {
JsonObject object = new JsonObject();
- object.addProperty("one","oneValue");
+ object.addProperty("one", "oneValue");
JsonObject child = new JsonObject();
- child.addProperty("two","twoValue");
- object.add("child",child);
+ child.addProperty("two", "twoValue");
+ object.add("child", child);
JsonObject jsonResult = descriptor.fromString("{\"one\":\"oneValue\",\"child\":{\"two\":\"twoValue\"}}");
@@ -53,10 +52,10 @@ public class JsonTypeDescriptorTest {
assertThat(res1).isNull();
JsonObject object = new JsonObject();
- object.addProperty("one","oneValue");
+ object.addProperty("one", "oneValue");
JsonObject child = new JsonObject();
- child.addProperty("two","twoValue");
- object.add("child",child);
+ child.addProperty("two", "twoValue");
+ object.add("child", child);
String res2 = descriptor.unwrap(object, String.class, null);
assertThat(res2.replace("\n", "").replace(" ", ""))
.isEqualTo("{\"one\":\"oneValue\",\"child\":{\"two\":\"twoValue\"}}");
@@ -70,7 +69,7 @@ public class JsonTypeDescriptorTest {
@Test(expected = HibernateException.class)
public void testUnwrapExpectationThrown() {
JsonObject object = new JsonObject();
- object.addProperty("one","oneValue");
+ object.addProperty("one", "oneValue");
descriptor.unwrap(object, Integer.class, null);
}
@@ -81,10 +80,10 @@ public class JsonTypeDescriptorTest {
assertThat(res1).isNull();
JsonObject object = new JsonObject();
- object.addProperty("one","oneValue");
+ object.addProperty("one", "oneValue");
JsonObject child = new JsonObject();
- child.addProperty("two","twoValue");
- object.add("child",child);
+ child.addProperty("two", "twoValue");
+ object.add("child", child);
JsonObject res2 = descriptor.wrap("{\"one\":\"oneValue\",\"child\":{\"two\":\"twoValue\"}}", null);
assertThat(res2).isEqualTo(object);
}
diff --git a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/ChainGeneratorTest.java b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/ChainGeneratorTest.java
index 83b3dda01..a6b34f95d 100644
--- a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/ChainGeneratorTest.java
+++ b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/ChainGeneratorTest.java
@@ -27,7 +27,6 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-
import org.junit.Assert;
import org.junit.Test;
diff --git a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java
index f04e3fa3c..f2a9de7a0 100644
--- a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java
+++ b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java
@@ -36,7 +36,6 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
-
import org.apache.commons.io.IOUtils;
import org.junit.Test;
import org.mockito.Mockito;
diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/JsonTemplateFieldTest.java b/src/test/java/org/onap/clamp/clds/tosca/update/JsonTemplateFieldTest.java
index 29f5a1da8..7f0047e4f 100644
--- a/src/test/java/org/onap/clamp/clds/tosca/update/JsonTemplateFieldTest.java
+++ b/src/test/java/org/onap/clamp/clds/tosca/update/JsonTemplateFieldTest.java
@@ -39,10 +39,10 @@ public class JsonTemplateFieldTest extends TestCase {
* Test fieldsEqual method.
*/
public void testFieldsEqualsMethod() {
- assertFalse(JsonTemplateField.fieldsEquals(field1,field3));
- assertFalse(JsonTemplateField.fieldsEquals(field1,field4));
- assertFalse(JsonTemplateField.fieldsEquals(field1,field5));
- assertTrue(JsonTemplateField.fieldsEquals(field1,field6));
+ assertFalse(JsonTemplateField.fieldsEquals(field1, field3));
+ assertFalse(JsonTemplateField.fieldsEquals(field1, field4));
+ assertFalse(JsonTemplateField.fieldsEquals(field1, field5));
+ assertTrue(JsonTemplateField.fieldsEquals(field1, field6));
}
/**
diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java b/src/test/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java
index 1d4ee4311..4fae89f09 100644
--- a/src/test/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java
+++ b/src/test/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java
@@ -46,7 +46,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Application.class)
-@ActiveProfiles({"clamp-default","clamp-default-user","default-dictionary-elements"})
+@ActiveProfiles({"clamp-default", "clamp-default-user", "default-dictionary-elements"})
public class ToscaConverterWithDictionarySupportItCase {
@Autowired
diff --git a/src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java b/src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java
index f6054d538..42123aaf4 100644
--- a/src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java
+++ b/src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java
@@ -31,10 +31,8 @@ import static org.junit.Assert.assertNotNull;
import static org.mockito.ArgumentMatchers.eq;
import java.security.InvalidKeyException;
-
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
-
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.lang3.ArrayUtils;
import org.junit.Test;
diff --git a/src/test/java/org/onap/clamp/clds/util/JsonUtilsTest.java b/src/test/java/org/onap/clamp/clds/util/JsonUtilsTest.java
index bc2ec2122..a986c159d 100644
--- a/src/test/java/org/onap/clamp/clds/util/JsonUtilsTest.java
+++ b/src/test/java/org/onap/clamp/clds/util/JsonUtilsTest.java
@@ -30,7 +30,6 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import java.io.IOException;
-
import org.junit.Test;
public class JsonUtilsTest {
diff --git a/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java b/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
index f986ca935..a9f8f4f5f 100644
--- a/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
+++ b/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
@@ -215,9 +215,8 @@ public class CsarInstallerItCase {
Mockito.when(notificationData.getServiceArtifacts()).thenReturn(serviceArtifactsList);
CsarHandler csarHandler = new CsarHandler(notificationData, "", "");
- csarHandler
- .setFilePath(Thread.currentThread().getContextClassLoader().getResource(CSAR_ARTIFACT_NAME_CDS).
- getFile());
+ csarHandler.setFilePath(Thread.currentThread().getContextClassLoader().getResource(CSAR_ARTIFACT_NAME_CDS)
+ .getFile());
Assert.assertEquals(csarHandler.getPolicyModelYaml(), Optional
.ofNullable(ResourceFileUtils.getResourceAsString("example/sdc/expected-result/policy-data.yaml")));
}
diff --git a/src/test/java/org/onap/clamp/loop/LoopToJsonTest.java b/src/test/java/org/onap/clamp/loop/LoopToJsonTest.java
index 1d6940f83..99c8f1ff9 100644
--- a/src/test/java/org/onap/clamp/loop/LoopToJsonTest.java
+++ b/src/test/java/org/onap/clamp/loop/LoopToJsonTest.java
@@ -27,6 +27,7 @@ package org.onap.clamp.loop;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertNotNull;
+
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
diff --git a/src/test/java/org/onap/clamp/loop/PolicyComponentTest.java b/src/test/java/org/onap/clamp/loop/PolicyComponentTest.java
index 4d2bfe280..8afdd0583 100644
--- a/src/test/java/org/onap/clamp/loop/PolicyComponentTest.java
+++ b/src/test/java/org/onap/clamp/loop/PolicyComponentTest.java
@@ -23,6 +23,8 @@
package org.onap.clamp.loop;
+import static org.assertj.core.api.Assertions.assertThat;
+
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import java.io.IOException;
@@ -38,8 +40,6 @@ import org.onap.clamp.loop.template.PolicyModel;
import org.onap.clamp.policy.microservice.MicroServicePolicy;
import org.onap.clamp.policy.operational.OperationalPolicy;
-import static org.assertj.core.api.Assertions.assertThat;
-
public class PolicyComponentTest {
/**
diff --git a/src/test/java/org/onap/clamp/loop/ServiceTest.java b/src/test/java/org/onap/clamp/loop/ServiceTest.java
index 2b6fab8b6..7507d42e9 100644
--- a/src/test/java/org/onap/clamp/loop/ServiceTest.java
+++ b/src/test/java/org/onap/clamp/loop/ServiceTest.java
@@ -26,7 +26,6 @@ package org.onap.clamp.loop;
import static org.assertj.core.api.Assertions.assertThat;
import com.google.gson.JsonObject;
-
import org.junit.Test;
import org.onap.clamp.clds.util.JsonUtils;
import org.onap.clamp.loop.service.Service;
diff --git a/src/test/java/org/onap/clamp/policy/downloader/PolicyEngineControllerTestItCase.java b/src/test/java/org/onap/clamp/policy/downloader/PolicyEngineControllerTestItCase.java
index 51b93767f..47afb91c4 100644
--- a/src/test/java/org/onap/clamp/policy/downloader/PolicyEngineControllerTestItCase.java
+++ b/src/test/java/org/onap/clamp/policy/downloader/PolicyEngineControllerTestItCase.java
@@ -45,7 +45,7 @@ import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
-@ActiveProfiles({"clamp-default","clamp-policy-controller"})
+@ActiveProfiles({"clamp-default", "clamp-policy-controller"})
public class PolicyEngineControllerTestItCase {
@Autowired
diff --git a/src/test/java/org/onap/clamp/policy/microservice/MicroServicePayloadTest.java b/src/test/java/org/onap/clamp/policy/microservice/MicroServicePayloadTest.java
index 0bfb6ece0..c43e62403 100644
--- a/src/test/java/org/onap/clamp/policy/microservice/MicroServicePayloadTest.java
+++ b/src/test/java/org/onap/clamp/policy/microservice/MicroServicePayloadTest.java
@@ -37,10 +37,11 @@ public class MicroServicePayloadTest {
public void testPayloadConstruction() throws IOException {
MicroServicePolicy policy = new MicroServicePolicy("testPolicy", new PolicyModel(
"onap.policies.monitoring.cdap.tca.hi.lo.app",
- ResourceFileUtils.getResourceAsString("tosca/tosca_example.yaml"),"1.0.0"), false,null,null, null,null);
+ ResourceFileUtils.getResourceAsString("tosca/tosca_example.yaml"), "1.0.0"), false, null, null, null,
+ null);
policy.setConfigurationsJson(JsonUtils.GSON.fromJson(
- ResourceFileUtils.getResourceAsString("tosca/micro-service-policy-properties.json"), JsonObject.class));
+ ResourceFileUtils.getResourceAsString("tosca/micro-service-policy-properties.json"), JsonObject.class));
JSONAssert.assertEquals(ResourceFileUtils.getResourceAsString("tosca/micro-service-policy-payload.json"),
- policy.createPolicyPayload(), false);
+ policy.createPolicyPayload(), false);
}
}
diff --git a/src/test/java/org/onap/clamp/policy/pdpgroup/PdpGroupTest.java b/src/test/java/org/onap/clamp/policy/pdpgroup/PdpGroupTest.java
index b6f7c5491..46980d19f 100644
--- a/src/test/java/org/onap/clamp/policy/pdpgroup/PdpGroupTest.java
+++ b/src/test/java/org/onap/clamp/policy/pdpgroup/PdpGroupTest.java
@@ -27,11 +27,9 @@ import static org.assertj.core.api.Assertions.assertThat;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
-
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
-
import org.junit.Test;
public class PdpGroupTest {
diff --git a/src/test/java/org/onap/clamp/policy/pdpgroup/PolicyModelKeyTest.java b/src/test/java/org/onap/clamp/policy/pdpgroup/PolicyModelKeyTest.java
index 413ce60ab..3befcf2d3 100644
--- a/src/test/java/org/onap/clamp/policy/pdpgroup/PolicyModelKeyTest.java
+++ b/src/test/java/org/onap/clamp/policy/pdpgroup/PolicyModelKeyTest.java
@@ -32,9 +32,9 @@ public class PolicyModelKeyTest {
@Test
public void testEqualsMethod() throws IOException {
- PolicyModelKey key1 = new PolicyModelKey("name1","1.0.0");
- PolicyModelKey key2 = new PolicyModelKey(null,"1.0.0");
- PolicyModelKey key3 = new PolicyModelKey("name1",null);
+ PolicyModelKey key1 = new PolicyModelKey("name1", "1.0.0");
+ PolicyModelKey key2 = new PolicyModelKey(null, "1.0.0");
+ PolicyModelKey key3 = new PolicyModelKey("name1", null);
assertThat(key1.equals(null)).isFalse();
assertThat(key1.equals("key2")).isFalse();
@@ -42,13 +42,13 @@ public class PolicyModelKeyTest {
assertThat(key2.equals(key1)).isFalse();
assertThat(key3.equals(key1)).isFalse();
- PolicyModelKey key4 = new PolicyModelKey("name2","1.0.0");
- PolicyModelKey key5 = new PolicyModelKey("name1","2.0.0");
+ PolicyModelKey key4 = new PolicyModelKey("name2", "1.0.0");
+ PolicyModelKey key5 = new PolicyModelKey("name1", "2.0.0");
assertThat(key1.equals(key4)).isFalse();
assertThat(key1.equals(key5)).isFalse();
- PolicyModelKey key6 = new PolicyModelKey("name(.*)","1.0.0");
- PolicyModelKey key7 = new PolicyModelKey("name1","1.0.0");
+ PolicyModelKey key6 = new PolicyModelKey("name(.*)", "1.0.0");
+ PolicyModelKey key7 = new PolicyModelKey("name1", "1.0.0");
assertThat(key1.equals(key6)).isTrue();
assertThat(key1.equals(key7)).isTrue();
}