summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormark.j.leonard <mark.j.leonard@gmail.com>2019-03-06 15:58:55 +0000
committermark.j.leonard <mark.j.leonard@gmail.com>2019-03-06 16:02:28 +0000
commitf03e49cdf5c8d54733416ab244826b9429c9c86c (patch)
treee59505492cbd714011b05e4e24e76f188e2d125d
parentff0718120f36e14b065047f0b3f29665f2191e53 (diff)
Remove redundant methods from codebase
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>
-rw-r--r--src/main/java/org/onap/aai/babel/csar/vnfcatalog/VendorImageConfiguration.java29
-rw-r--r--src/main/java/org/onap/aai/babel/service/data/BabelArtifact.java20
-rw-r--r--src/main/java/org/onap/aai/babel/xml/generator/data/Artifact.java25
-rw-r--r--src/main/java/org/onap/aai/babel/xml/generator/data/GenerationData.java17
-rw-r--r--src/main/java/org/onap/aai/babel/xml/generator/data/GeneratorUtil.java17
-rw-r--r--src/main/java/org/onap/aai/babel/xml/generator/model/Widget.java11
-rw-r--r--src/test/java/org/onap/aai/babel/service/TestGenerateArtifactsServiceImpl.java2
-rw-r--r--src/test/java/org/onap/aai/babel/xml/generator/model/TestGeneratorUtil.java17
8 files changed, 25 insertions, 113 deletions
diff --git a/src/main/java/org/onap/aai/babel/csar/vnfcatalog/VendorImageConfiguration.java b/src/main/java/org/onap/aai/babel/csar/vnfcatalog/VendorImageConfiguration.java
index 6142aac..bb4476a 100644
--- a/src/main/java/org/onap/aai/babel/csar/vnfcatalog/VendorImageConfiguration.java
+++ b/src/main/java/org/onap/aai/babel/csar/vnfcatalog/VendorImageConfiguration.java
@@ -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 + "]";
diff --git a/src/main/java/org/onap/aai/babel/service/data/BabelArtifact.java b/src/main/java/org/onap/aai/babel/service/data/BabelArtifact.java
index 81c237e..86bf0cc 100644
--- a/src/main/java/org/onap/aai/babel/service/data/BabelArtifact.java
+++ b/src/main/java/org/onap/aai/babel/service/data/BabelArtifact.java
@@ -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,14 +18,14 @@
* 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;
- }
}
diff --git a/src/main/java/org/onap/aai/babel/xml/generator/data/Artifact.java b/src/main/java/org/onap/aai/babel/xml/generator/data/Artifact.java
index 50dfc89..2a2e32c 100644
--- a/src/main/java/org/onap/aai/babel/xml/generator/data/Artifact.java
+++ b/src/main/java/org/onap/aai/babel/xml/generator/data/Artifact.java
@@ -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;
}
diff --git a/src/main/java/org/onap/aai/babel/xml/generator/data/GenerationData.java b/src/main/java/org/onap/aai/babel/xml/generator/data/GenerationData.java
index f59cb66..8ca8b6b 100644
--- a/src/main/java/org/onap/aai/babel/xml/generator/data/GenerationData.java
+++ b/src/main/java/org/onap/aai/babel/xml/generator/data/GenerationData.java
@@ -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;
}
diff --git a/src/main/java/org/onap/aai/babel/xml/generator/data/GeneratorUtil.java b/src/main/java/org/onap/aai/babel/xml/generator/data/GeneratorUtil.java
index 42c8893..16f6b13 100644
--- a/src/main/java/org/onap/aai/babel/xml/generator/data/GeneratorUtil.java
+++ b/src/main/java/org/onap/aai/babel/xml/generator/data/GeneratorUtil.java
@@ -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,21 +28,11 @@ 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.
*
* @param input Input byte array to be encoded
diff --git a/src/main/java/org/onap/aai/babel/xml/generator/model/Widget.java b/src/main/java/org/onap/aai/babel/xml/generator/model/Widget.java
index 67fac05..44beb65 100644
--- a/src/main/java/org/onap/aai/babel/xml/generator/model/Widget.java
+++ b/src/main/java/org/onap/aai/babel/xml/generator/model/Widget.java
@@ -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 {
diff --git a/src/test/java/org/onap/aai/babel/service/TestGenerateArtifactsServiceImpl.java b/src/test/java/org/onap/aai/babel/service/TestGenerateArtifactsServiceImpl.java
index be02e17..0673d04 100644
--- a/src/test/java/org/onap/aai/babel/service/TestGenerateArtifactsServiceImpl.java
+++ b/src/test/java/org/onap/aai/babel/service/TestGenerateArtifactsServiceImpl.java
@@ -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")));
}
diff --git a/src/test/java/org/onap/aai/babel/xml/generator/model/TestGeneratorUtil.java b/src/test/java/org/onap/aai/babel/xml/generator/model/TestGeneratorUtil.java
index 9b5d05f..1fc5d13 100644
--- a/src/test/java/org/onap/aai/babel/xml/generator/model/TestGeneratorUtil.java
+++ b/src/test/java/org/onap/aai/babel/xml/generator/model/TestGeneratorUtil.java
@@ -50,23 +50,6 @@ public class TestGeneratorUtil {
}
@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));
}