Fix Technical Debt for TrafficGenerator 39/28439/3
authorvdmeer <sven.van.der.meer@ericsson.com>
Wed, 17 Jan 2018 18:52:14 +0000 (18:52 +0000)
committervdmeer <sven.van.der.meer@ericsson.com>
Wed, 17 Jan 2018 20:59:19 +0000 (20:59 +0000)
Changed formatting for checkstyle, changed sequence of statements
Left empty constructors as requested

Issue-ID: POLICY-455
Change-Id: I0e443bba69cede4c006a841d8d34c82391ff1040
Signed-off-by: vdmeer.sven <sven.van.der.meer@ericsson.com>
controlloop/common/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/PGRequest.java
controlloop/common/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/PGStream.java
controlloop/common/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/PGStreams.java
controlloop/common/model-impl/trafficgenerator/src/main/java/org/onap/policy/vnf/trafficgenerator/util/Serialization.java
controlloop/common/model-impl/trafficgenerator/src/test/java/org/onap/policy/vnf/trafficgenerator/TestDemo.java

index d08d942..7bbaf3c 100644 (file)
@@ -22,20 +22,19 @@ package org.onap.policy.vnf.trafficgenerator;
 
 import java.io.Serializable;
 
-
 import com.google.gson.annotations.SerializedName;
 
 public class PGRequest implements Serializable {
 
-       /**
-        * 
-        */
-       private static final long serialVersionUID = -3283942659786236032L;
-       
-       @SerializedName("pg-streams")
-       public PGStreams pgStreams;
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -3283942659786236032L;
 
-       public PGRequest() {
-       }
+    @SerializedName("pg-streams")
+    public PGStreams pgStreams;
 
+    public PGRequest() {
+        //required by author
+    }
 }
index de5a2c3..a606eee 100644 (file)
@@ -26,17 +26,17 @@ import com.google.gson.annotations.SerializedName;
 
 public class PGStream implements Serializable {
 
-       /**
-        * 
-        */
-       private static final long serialVersionUID = 5567635677419358210L;
-       
-       @SerializedName("id")
-       public String streamId;
-       @SerializedName("is-enabled")
-       public String isEnabled;
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 5567635677419358210L;
 
-       public PGStream() {
-       }
+    @SerializedName("id")
+    public String streamId;
+    @SerializedName("is-enabled")
+    public String isEnabled;
 
+    public PGStream() {
+        //required by author
+    }
 }
index dc0d408..2264c20 100644 (file)
@@ -28,15 +28,15 @@ import com.google.gson.annotations.SerializedName;
 
 public class PGStreams implements Serializable {
 
-       /**
-        * 
-        */
-       private static final long serialVersionUID = 5567635677419358210L;
-       
-       @SerializedName("pg-stream")
-       public List<PGStream> pgStream= new LinkedList<PGStream>();
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 5567635677419358210L;
 
-       public PGStreams() {
-       }
+    @SerializedName("pg-stream")
+    public List<PGStream> pgStream = new LinkedList<>();
 
+    public PGStreams() {
+        // required by author
+    }
 }
index 9bfe2ff..3443bfc 100644 (file)
@@ -25,11 +25,8 @@ import com.google.gson.GsonBuilder;
 
 public final class Serialization {
 
-       private Serialization(){
-       }
+    public static final Gson gsonPretty =
+            new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create();
 
-       final static public Gson gsonPretty = new GsonBuilder().disableHtmlEscaping()
-                       .setPrettyPrinting()
-//                     .registerTypeAdapter(AAIQueryParameters.class, new notificationTypeAdapter())
-                       .create();
+    private Serialization() {}
 }
index 4b3599d..0ae5f13 100644 (file)
@@ -30,24 +30,25 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class TestDemo {
-       private static final Logger logger = LoggerFactory.getLogger(TestDemo.class);
-       @Test
-       public void test() {
-               PGRequest request = new PGRequest();
-               request.pgStreams = new PGStreams();
-               
-               PGStream pgStream;
-               for(int i = 0; i < 5; i++){
-                       pgStream = new PGStream();
-                       pgStream.streamId = "fw_udp"+(i+1);
-                       pgStream.isEnabled = "true";
-                       request.pgStreams.pgStream.add(pgStream);
-               }
-                               
-               String body = Serialization.gsonPretty.toJson(request);
-               logger.debug(body);
-               
-               // fail("Not yet implemented");
-       }
+    private static final Logger logger = LoggerFactory.getLogger(TestDemo.class);
+
+    @Test
+    public void test() {
+        PGRequest request = new PGRequest();
+        request.pgStreams = new PGStreams();
+
+        PGStream pgStream;
+        for (int i = 0; i < 5; i++) {
+            pgStream = new PGStream();
+            pgStream.streamId = "fw_udp" + (i + 1);
+            pgStream.isEnabled = "true";
+            request.pgStreams.pgStream.add(pgStream);
+        }
+
+        String body = Serialization.gsonPretty.toJson(request);
+        logger.debug(body);
+
+        // fail("Not yet implemented");
+    }
 
 }