Align the clamp code on policy project 89/116289/2
authorsebdet <sebastien.determe@intl.att.com>
Thu, 10 Dec 2020 14:10:15 +0000 (15:10 +0100)
committerS�bastien Determe <sebastien.determe@intl.att.com>
Tue, 5 Jan 2021 16:08:56 +0000 (16:08 +0000)
Inherit from the policy integration parent + fix all checkstyle issues detected by policy checkstyle (google) config

Issue-ID: POLICY-2922
Change-Id: I616846bbda8bb0f6250a842c248836c40e1068cf
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
73 files changed:
pom.xml
src/main/java/org/onap/clamp/authorization/SecureServicePermission.java
src/main/java/org/onap/clamp/clds/ClampServlet.java
src/main/java/org/onap/clamp/clds/client/CdsServices.java
src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java
src/main/java/org/onap/clamp/clds/config/AafConfiguration.java
src/main/java/org/onap/clamp/clds/config/SystemPropertiesLoader.java
src/main/java/org/onap/clamp/clds/config/sdc/SdcControllersConfiguration.java
src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java
src/main/java/org/onap/clamp/clds/model/cds/CdsBpWorkFlowListResponse.java
src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java
src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java
src/main/java/org/onap/clamp/clds/sdc/controller/installer/ChainGenerator.java
src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java
src/main/java/org/onap/clamp/clds/tosca/update/parser/ToscaConverterToJsonSchema.java
src/main/java/org/onap/clamp/clds/tosca/update/parser/metadata/ToscaMetadataParserWithDictionarySupport.java
src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplate.java
src/main/java/org/onap/clamp/clds/tosca/update/templates/JsonTemplateManager.java
src/main/java/org/onap/clamp/clds/util/ClampVersioning.java
src/main/java/org/onap/clamp/clds/util/JsonUtils.java
src/main/java/org/onap/clamp/clds/util/LoggingUtils.java
src/main/java/org/onap/clamp/clds/util/OnapLogConstants.java
src/main/java/org/onap/clamp/configuration/ClampGsonDataFormat.java
src/main/java/org/onap/clamp/dao/model/gson/converter/InstantDeserializer.java
src/main/java/org/onap/clamp/dao/model/gson/converter/InstantSerializer.java
src/main/java/org/onap/clamp/dao/model/jsontype/JsonStringSqlTypeDescriptor.java
src/main/java/org/onap/clamp/dao/model/jsontype/JsonTypeDescriptor.java
src/main/java/org/onap/clamp/dao/model/jsontype/StringJsonUserType.java
src/main/java/org/onap/clamp/loop/CsarInstaller.java
src/main/java/org/onap/clamp/loop/Loop.java
src/main/java/org/onap/clamp/loop/LoopsRepository.java
src/main/java/org/onap/clamp/loop/cds/CdsDataInstaller.java
src/main/java/org/onap/clamp/loop/common/AuditEntity.java
src/main/java/org/onap/clamp/loop/components/external/DcaeComponent.java
src/main/java/org/onap/clamp/loop/components/external/ExternalComponent.java
src/main/java/org/onap/clamp/loop/components/external/PolicyComponent.java
src/main/java/org/onap/clamp/loop/deploy/DcaeDeployParameters.java
src/main/java/org/onap/clamp/loop/log/LoopLog.java
src/main/java/org/onap/clamp/loop/service/Service.java
src/main/java/org/onap/clamp/loop/template/LoopElementModel.java
src/main/java/org/onap/clamp/loop/template/LoopTemplate.java
src/main/java/org/onap/clamp/loop/template/LoopTemplateLoopElementModel.java
src/main/java/org/onap/clamp/loop/template/LoopTemplatesRepository.java
src/main/java/org/onap/clamp/loop/template/PolicyModelId.java
src/main/java/org/onap/clamp/loop/template/PolicyModelsRepository.java
src/main/java/org/onap/clamp/loop/template/PolicyModelsService.java
src/main/java/org/onap/clamp/policy/PolicyService.java
src/main/java/org/onap/clamp/policy/downloader/PolicyEngineController.java
src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java
src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
src/main/java/org/onap/clamp/policy/pdpgroup/PdpGroup.java
src/main/java/org/onap/clamp/policy/pdpgroup/PolicyModelKey.java
src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java
src/test/java/org/onap/clamp/clds/it/AuthorizationControllerItCase.java
src/test/java/org/onap/clamp/clds/it/config/SdcControllersConfigurationItCase.java
src/test/java/org/onap/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java
src/test/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponseCacheTestItCase.java
src/test/java/org/onap/clamp/clds/model/dcae/DcaeInventoryResponseTest.java
src/test/java/org/onap/clamp/clds/model/jsontype/JsonTypeDescriptorTest.java
src/test/java/org/onap/clamp/clds/sdc/controller/installer/ChainGeneratorTest.java
src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java
src/test/java/org/onap/clamp/clds/tosca/update/JsonTemplateFieldTest.java
src/test/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java
src/test/java/org/onap/clamp/clds/util/CryptoUtilsTest.java
src/test/java/org/onap/clamp/clds/util/JsonUtilsTest.java
src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
src/test/java/org/onap/clamp/loop/LoopToJsonTest.java
src/test/java/org/onap/clamp/loop/PolicyComponentTest.java
src/test/java/org/onap/clamp/loop/ServiceTest.java
src/test/java/org/onap/clamp/policy/downloader/PolicyEngineControllerTestItCase.java
src/test/java/org/onap/clamp/policy/microservice/MicroServicePayloadTest.java
src/test/java/org/onap/clamp/policy/pdpgroup/PdpGroupTest.java
src/test/java/org/onap/clamp/policy/pdpgroup/PolicyModelKeyTest.java

diff --git a/pom.xml b/pom.xml
index 0b78217..ab21396 100644 (file)
--- a/pom.xml
+++ b/pom.xml
        <name>clamp</name>
 
 
-       <parent>
-               <groupId>org.onap.oparent</groupId>
-               <artifactId>oparent</artifactId>
-               <version>2.1.0</version>
-       </parent>
+    <parent>
+           <groupId>org.onap.policy.parent</groupId>
+         <artifactId>integration</artifactId>
+         <version>3.3.0-SNAPSHOT</version>
+         <relativePath />
+    </parent>
 
        <description>
               This is the MAVEN project that builds everything for ONAP CLAMP.
index 374aab9..0ee126e 100644 (file)
@@ -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
index 8ebc7a1..5ca3dfb 100644 (file)
@@ -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;
index fd3b353..31960cc 100644 (file)
@@ -29,10 +29,8 @@ import com.att.eelf.configuration.EELFManager;
 import com.google.gson.JsonElement;\r
 import com.google.gson.JsonObject;\r
 import com.google.gson.JsonParser;\r
-\r
 import java.util.Date;\r
 import java.util.Map;\r
-\r
 import org.apache.camel.CamelContext;\r
 import org.apache.camel.Exchange;\r
 import org.apache.camel.builder.ExchangeBuilder;\r
index b24bc99..ade96e0 100644 (file)
@@ -26,10 +26,8 @@ package org.onap.clamp.clds.client;
 \r
 import com.att.eelf.configuration.EELFLogger;\r
 import com.att.eelf.configuration.EELFManager;\r
-\r
 import java.io.IOException;\r
 import java.util.Date;\r
-\r
 import org.apache.camel.CamelContext;\r
 import org.apache.camel.Exchange;\r
 import org.apache.camel.builder.ExchangeBuilder;\r
index d9178cb..7c86728 100644 (file)
@@ -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;
index 7480beb..10c6901 100644 (file)
@@ -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;
index ad2751b..b6f1e1a 100644 (file)
@@ -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;
index eca45d6..62c3a1f 100644 (file)
@@ -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;
index f9b43ab..8afb3e8 100644 (file)
@@ -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;
index 5d5027d..0c6ec8d 100644 (file)
@@ -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;
index 2bd259c..7768cd8 100644 (file)
@@ -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
index 471415a..aa1a6af 100644 (file)
@@ -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;
index 9721e33..d23dc79 100644 (file)
@@ -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");
index 33e0842..3fdd192 100644 (file)
@@ -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;
index f64ba68..0b7a9a1 100644 (file)
@@ -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);
             }
         }
index 0b399ba..a278cb6 100644 (file)
@@ -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,
index ec0162c..bcdae5e 100644 (file)
@@ -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;
 
index 8024331..fa639a0 100644 (file)
@@ -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;
index 0ac1a14..a502a52 100644 (file)
@@ -168,9 +168,9 @@ public class LoggingUtils {
         return dateFormat;
     }
 
-    /*********************************************************************************************
+    /* *******************************************************************************************
      * Method for ONAP Application Logging Specification v1.2
-     ********************************************************************************************/
+     * *******************************************************************************************/
 
     /**
      * Report <tt>ENTERING</tt> marker.
index 8952e5d..8185b75 100644 (file)
@@ -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;
         }
     }
 
index ca5f376..3b56772 100644 (file)
@@ -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;
index 2d63e55..2c6c47f 100644 (file)
@@ -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;
index cdb439e..3705f12 100644 (file)
@@ -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;
index f5aba4e..7370e40 100644 (file)
@@ -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;
index 518ec2d..2668094 100644 (file)
@@ -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;
index 621fa8d..509057d 100644 (file)
@@ -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;
index 6752a1a..a1ef612 100644 (file)
@@ -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;
index 36f7422..9fde195 100644 (file)
@@ -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;
index aaa4911..c2ef2fd 100644 (file)
@@ -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;
index d18cae1..4c331b7 100644 (file)
@@ -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");
                     }
index 7ce12ec..d5a1bfc 100644 (file)
@@ -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;
         }
     }
index 8b85471..d6a061f 100644 (file)
@@ -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();
     }
index 4ea5b71..8a5ff7f 100644 (file)
@@ -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;
     }
index 65506a4..b00c99c 100644 (file)
@@ -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());
index e495988..ad3c797 100644 (file)
 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;
 
 /**
index 338032a..2ac9d7e 100644 (file)
@@ -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;
     }
index 70cdbe2..f210df9 100644 (file)
@@ -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;
index 6f896f3..1204c6c 100644 (file)
@@ -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());
     }
 
     /**
index aca16bc..36fc3fb 100644 (file)
@@ -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;
index 07f304d..c647c26 100644 (file)
@@ -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;
index c4dd193..3fd1917 100644 (file)
@@ -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 {
index a76e386..f4b09ca 100644 (file)
@@ -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;
index 17cf5c1..c482c34 100644 (file)
@@ -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);
     }
 
     /**
index ae15f86..ad092b5 100644 (file)
@@ -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> {
index 0c3f677..b977702 100644 (file)
@@ -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;
index 77627a3..a654eda 100644 (file)
@@ -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;
index 0381f0a..9bae7bd 100644 (file)
@@ -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()));
             }
         }
index a3cf4e0..6a070c5 100644 (file)
@@ -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;
 
 /**
index 707b3bd..6d9343d 100644 (file)
@@ -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 {
index 06df124..311244f 100644 (file)
@@ -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);
     }
 }
index 207e936..48338f1 100644 (file)
@@ -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(
index 0c08a2e..cfdbe77 100644 (file)
@@ -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
index a8c3e58..a3aa8b4 100644 (file)
@@ -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";
index 50da400..bd0c94d 100644 (file)
@@ -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;
index fc4872c..c5217fd 100644 (file)
@@ -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 {
index 560f54c..86b3497 100644 (file)
@@ -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);
     }
index f04e3fa..f2a9de7 100644 (file)
@@ -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;
index 29f5a1d..7f0047e 100644 (file)
@@ -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));
     }
 
     /**
index 1d4ee43..4fae89f 100644 (file)
@@ -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
index f6054d5..42123aa 100644 (file)
@@ -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;
index bc2ec21..a986c15 100644 (file)
@@ -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 {
index f986ca9..a9f8f4f 100644 (file)
@@ -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")));
     }
index 1d6940f..99c8f1f 100644 (file)
@@ -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;
index 4d2bfe2..8afdd05 100644 (file)
@@ -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 {
 
     /**
index 2b6fab8..7507d42 100644 (file)
@@ -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;
index 51b9376..47afb91 100644 (file)
@@ -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
index 0bfb6ec..c43e624 100644 (file)
@@ -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);
     }
 }
index b6f7c54..46980d1 100644 (file)
@@ -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 {
index 413ce60..3befcf2 100644 (file)
@@ -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();
     }