* ============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.csar.vnfcatalog;
import com.google.gson.annotations.SerializedName;
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 + "]";
* ============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;
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;
- }
}
* ============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.xml.generator.data;
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;
}
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;
}
* ============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.xml.generator.data;
import java.util.ArrayList;
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
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;
}
* ============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.xml.generator.data;
import java.util.Base64;
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.
*
* ============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.
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.aai.babel.xml.generator.model;
import java.util.Collection;
}
/**
- * Copy Constructor
+ * Copy Constructor.
*
* @param baseWidget
- * @throws XmlArtifactGenerationException
+ * @throws XmlArtifactGenerationException
*/
public Widget(Widget baseWidget) throws XmlArtifactGenerationException {
this(baseWidget.getWidgetType(), baseWidget.getName(), baseWidget.getDeleteFlag());
* @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 {
@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")));
}
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));