Remove redundant methods from codebase 91/79791/1
authormark.j.leonard <mark.j.leonard@gmail.com>
Wed, 6 Mar 2019 15:58:55 +0000 (15:58 +0000)
committermark.j.leonard <mark.j.leonard@gmail.com>
Wed, 6 Mar 2019 16:02:28 +0000 (16:02 +0000)
Delete methods that are never called (or only called from test code)

Issue-ID: AAI-2212
Change-Id: I1554bd76de4a9ac2e3cc05987dac1d04966b9200
Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
src/main/java/org/onap/aai/babel/csar/vnfcatalog/VendorImageConfiguration.java
src/main/java/org/onap/aai/babel/service/data/BabelArtifact.java
src/main/java/org/onap/aai/babel/xml/generator/data/Artifact.java
src/main/java/org/onap/aai/babel/xml/generator/data/GenerationData.java
src/main/java/org/onap/aai/babel/xml/generator/data/GeneratorUtil.java
src/main/java/org/onap/aai/babel/xml/generator/model/Widget.java
src/test/java/org/onap/aai/babel/service/TestGenerateArtifactsServiceImpl.java
src/test/java/org/onap/aai/babel/xml/generator/model/TestGeneratorUtil.java

index 6142aac..bb4476a 100644 (file)
@@ -2,8 +2,8 @@
  * ============LICENSE_START=======================================================
  * org.onap.aai
  * ================================================================================
- * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017-2018 European Software Marketing Ltd.
+ * Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (c) 2017-2019 European Software Marketing Ltd.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.aai.babel.csar.vnfcatalog;
 
 import com.google.gson.annotations.SerializedName;
@@ -79,30 +80,6 @@ class VendorImageConfiguration {
         this.applicationVersion = applicationVersion;
     }
 
-    public String getApplication() {
-        return application;
-    }
-
-    public void setApplication(String application) {
-        this.application = application;
-    }
-
-    public String getApplicationVendor() {
-        return applicationVendor;
-    }
-
-    public void setApplicationVendor(String applicationVendor) {
-        this.applicationVendor = applicationVendor;
-    }
-
-    public String getApplicationVersion() {
-        return applicationVersion;
-    }
-
-    public void setApplicationVersion(String applicationVersion) {
-        this.applicationVersion = applicationVersion;
-    }
-
     @Override
     public String toString() {
         return "VendorImage [" + application + ", " + applicationVendor + ", " + applicationVersion + "]";
index 81c237e..86bf0cc 100644 (file)
@@ -2,8 +2,8 @@
  * ============LICENSE_START=======================================================
  * org.onap.aai
  * ================================================================================
- * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017-2018 European Software Marketing Ltd.
+ * Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (c) 2017-2019 European Software Marketing Ltd.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.aai.babel.service.data;
 
 /** Bean representing the return artifacts of the Babel microservice. */
 public class BabelArtifact {
 
     public enum ArtifactType {
-        MODEL,
-        VNFCATALOG;
+        MODEL, VNFCATALOG;
     }
 
     String name;
@@ -42,23 +42,11 @@ public class BabelArtifact {
         return name;
     }
 
-    public void setName(String name) {
-        this.name = name;
-    }
-
     public ArtifactType getType() {
         return type;
     }
 
-    public void setType(String type) {
-        this.type = ArtifactType.valueOf(type);
-    }
-
     public String getPayload() {
         return payload;
     }
-
-    public void setPayload(String payload) {
-        this.payload = payload;
-    }
 }
index 50dfc89..2a2e32c 100644 (file)
@@ -2,8 +2,8 @@
  * ============LICENSE_START=======================================================
  * org.onap.aai
  * ================================================================================
- * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017-2018 European Software Marketing Ltd.
+ * Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (c) 2017-2019 European Software Marketing Ltd.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.aai.babel.xml.generator.data;
 
 public class Artifact {
@@ -50,18 +51,6 @@ public class Artifact {
         return payload;
     }
 
-    public String getChecksum() {
-        return checksum;
-    }
-
-    public String getType() {
-        return type;
-    }
-
-    public String getGroupType() {
-        return groupType;
-    }
-
     public String getName() {
         return name;
     }
@@ -70,18 +59,10 @@ public class Artifact {
         this.name = name;
     }
 
-    public String getLabel() {
-        return label;
-    }
-
     public void setLabel(String label) {
         this.label = label;
     }
 
-    public String getDescription() {
-        return description;
-    }
-
     public void setDescription(String description) {
         this.description = description;
     }
index f59cb66..8ca8b6b 100644 (file)
@@ -2,8 +2,8 @@
  * ============LICENSE_START=======================================================
  * org.onap.aai
  * ================================================================================
- * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017-2018 European Software Marketing Ltd.
+ * Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (c) 2017-2019 European Software Marketing Ltd.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.aai.babel.xml.generator.data;
 
 import java.util.ArrayList;
@@ -30,17 +31,12 @@ public class GenerationData {
     List<Artifact> resultData = new ArrayList<>();
     Map<String, List<String>> errorData = new HashMap<>();
 
-    public void add(List<Artifact> resultData, Map<String, List<String>> errorData) {
-        this.resultData.addAll(resultData);
-        this.errorData.putAll(errorData);
-    }
-
     public void add(Artifact generatedArtifact) {
         resultData.add(generatedArtifact);
     }
 
     /**
-     * Add the error code to the list of error codes for the given ID
+     * Add the error code to the list of error codes for the given ID.
      *
      * @param generatorId the generator id
      * @param errorCode the error code
@@ -50,11 +46,6 @@ public class GenerationData {
         errorData.get(generatorId).add(errorCode);
     }
 
-    public void add(GenerationData generationData) {
-        this.resultData.addAll(generationData.resultData);
-        this.errorData.putAll(generationData.errorData);
-    }
-
     public List<Artifact> getResultData() {
         return resultData;
     }
index 42c8893..16f6b13 100644 (file)
@@ -2,8 +2,8 @@
  * ============LICENSE_START=======================================================
  * org.onap.aai
  * ================================================================================
- * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017-2018 European Software Marketing Ltd.
+ * Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (c) 2017-2019 European Software Marketing Ltd.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.aai.babel.xml.generator.data;
 
 import java.util.Base64;
@@ -27,20 +28,10 @@ import org.apache.commons.codec.digest.DigestUtils;
 public final class GeneratorUtil {
 
     /*
-     * Private constructor to prevent instantiation
+     * Private constructor to prevent instantiation.
      */
     private GeneratorUtil() {}
 
-    /**
-     * Decodes Base64 encode byte array input.
-     *
-     * @param input Base64 encoded byte array
-     * @return Decoded byte array
-     */
-    public static byte[] decode(byte[] input) {
-        return input != null ? Base64.getDecoder().decode(input) : new byte[0];
-    }
-
     /**
      * Encode a byte array input using Base64 encoding.
      *
index 67fac05..44beb65 100644 (file)
@@ -2,8 +2,8 @@
  * ============LICENSE_START=======================================================
  * org.onap.aai
  * ================================================================================
- * Copyright © 2017-2019 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017-2019 European Software Marketing Ltd.
+ * Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (c) 2017-2019 European Software Marketing Ltd.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.aai.babel.xml.generator.model;
 
 import java.util.Collection;
@@ -54,10 +55,10 @@ public class Widget extends Model {
     }
 
     /**
-     * Copy Constructor
+     * Copy Constructor.
      * 
      * @param baseWidget
-     * @throws XmlArtifactGenerationException
+     * @throws XmlArtifactGenerationException 
      */
     public Widget(Widget baseWidget) throws XmlArtifactGenerationException {
         this(baseWidget.getWidgetType(), baseWidget.getName(), baseWidget.getDeleteFlag());
@@ -75,7 +76,7 @@ public class Widget extends Model {
      * @param type
      *            the type
      * @return a new widget of the specified type
-     * @throws XmlArtifactGenerationException
+     * @throws XmlArtifactGenerationException 
      *             if there is no configuration defined for the specified type
      */
     public static Widget getWidget(Type type) throws XmlArtifactGenerationException {
index be02e17..0673d04 100644 (file)
@@ -73,7 +73,7 @@ public class TestGenerateArtifactsServiceImpl {
     @Test
     public void testGenerateArtifacts() throws Exception {
         Response response = processJsonRequest(CsarTest.VNF_VENDOR_CSAR);
-        assertThat(response.getStatus(), is(Response.Status.OK.getStatusCode()));
+        assertThat(response.toString(), response.getStatus(), is(Response.Status.OK.getStatusCode()));
         assertThat(response.getEntity(), is(getResponseJson("response.json")));
     }
 
index 9b5d05f..1fc5d13 100644 (file)
@@ -49,23 +49,6 @@ public class TestGeneratorUtil {
         assertThat(result, is(EMPTY_BYTE_ARRAY));
     }
 
-    @Test
-    public void shouldDecodeUsingBase64() {
-        byte[] input = Base64.getEncoder().encode(TEST_BYTES);
-        byte[] expected = Base64.getDecoder().decode(input);
-
-        byte[] result = GeneratorUtil.decode(input);
-
-        assertThat(result, is(expected));
-    }
-
-    @Test
-    public void shouldReturnEmptyByteArrayWhenNullPassedToDecode() {
-        byte[] result = GeneratorUtil.decode(null);
-
-        assertThat(result, is(EMPTY_BYTE_ARRAY));
-    }
-
     @Test
     public void shouldReturnNullWhenNullPassedToCheckSum() {
         assertNull(GeneratorUtil.checkSum(null));