Fix checkstyle issues including javadoc 88/77888/1
authormark.j.leonard <mark.j.leonard@gmail.com>
Tue, 5 Feb 2019 15:47:47 +0000 (15:47 +0000)
committermark.j.leonard <mark.j.leonard@gmail.com>
Tue, 5 Feb 2019 16:25:22 +0000 (16:25 +0000)
Minor code tidy-ups: mostly formatting and Javadoc comments

Change-Id: I8a9ab692428fa09c73bd1fb542100610a86f6eca
Issue-ID: AAI-2121
Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
13 files changed:
src/main/java/org/onap/aai/auth/AAIMicroServiceAuth.java
src/main/java/org/onap/aai/babel/logging/ApplicationMsgs.java
src/main/java/org/onap/aai/babel/xml/generator/ModelGenerator.java
src/main/java/org/onap/aai/babel/xml/generator/api/AaiModelGeneratorImpl.java
src/main/java/org/onap/aai/babel/xml/generator/model/Resource.java
src/main/java/org/onap/aai/babel/xml/generator/model/Widget.java
src/test/java/org/onap/aai/babel/MicroServiceAuthTest.java
src/test/java/org/onap/aai/babel/csar/vnfcatalog/SdcToscaHelper.java
src/test/java/org/onap/aai/babel/parser/TestToscaParser.java
src/test/java/org/onap/aai/babel/service/CsarToXmlConverterTest.java
src/test/java/org/onap/aai/babel/service/TestGenerateArtifactsServiceImpl.java
src/test/java/org/onap/aai/babel/testdata/CsarTest.java
src/test/java/org/onap/aai/babel/util/ArtifactTestUtils.java

index c2402cd..5e4f3c4 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 © 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 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.auth;
 
 import java.security.cert.X509Certificate;
@@ -41,6 +42,7 @@ public class AAIMicroServiceAuth {
     /**
      * @param babelAuthConfig
      * @throws AAIAuthException
+     *             if the Auth Policy cannot be loaded
      */
     @Inject
     public AAIMicroServiceAuth(final BabelAuthConfig babelAuthConfig) throws AAIAuthException {
index 7178810..7d18a40 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 © 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 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.logging;
 
 import com.att.eelf.i18n.EELFResourceManager;
@@ -25,18 +26,18 @@ import org.onap.aai.cl.eelf.LogMessageEnum;
 
 public enum ApplicationMsgs implements LogMessageEnum {
 
-    DISTRIBUTION_EVENT,
-    MESSAGE_AUDIT,
-    MESSAGE_METRIC,
-    MISSING_REQUEST_ID,
-    PROCESS_REQUEST_ERROR,
-    INVALID_CSAR_FILE,
-    INVALID_REQUEST_JSON,
-    BABEL_REQUEST_PAYLOAD,
-    BABEL_RESPONSE_PAYLOAD,
-    LOAD_PROPERTIES,
-    PROCESSING_VNF_CATALOG_ERROR,
-    TEMP_FILE_ERROR,
+    DISTRIBUTION_EVENT, //
+    MESSAGE_AUDIT, //
+    MESSAGE_METRIC, //
+    MISSING_REQUEST_ID, //
+    PROCESS_REQUEST_ERROR, //
+    INVALID_CSAR_FILE, //
+    INVALID_REQUEST_JSON, //
+    BABEL_REQUEST_PAYLOAD, //
+    BABEL_RESPONSE_PAYLOAD, //
+    LOAD_PROPERTIES, //
+    PROCESSING_VNF_CATALOG_ERROR, //
+    TEMP_FILE_ERROR, //
     MISSING_SERVICE_METADATA;
 
     static {
index f474321..bbd1ff3 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 © 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 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;
 
 import java.util.Base64;
@@ -42,6 +43,7 @@ import org.onap.aai.cl.api.Logger;
  */
 public class ModelGenerator implements ArtifactGenerator {
 
+
     private static final Logger logger = LogHelper.INSTANCE;
 
     private static final String VERSION_DELIMITER = ".";
@@ -52,9 +54,11 @@ public class ModelGenerator implements ArtifactGenerator {
      * Invokes the TOSCA artifact generator API with the input artifacts.
      *
      * @param csarArchive
-     * @param csarArtifacts the input artifacts
+     * @param csarArtifacts
+     *     the input artifacts
      * @return {@link List} of output artifacts
-     * @throws XmlArtifactGenerationException if there is an error trying to generate XML artifacts
+     * @throws XmlArtifactGenerationException
+     *     if there is an error trying to generate XML artifacts
      */
     @Override
     public List<BabelArtifact> generateArtifacts(byte[] csarArchive, List<Artifact> csarArtifacts)
@@ -89,9 +93,12 @@ public class ModelGenerator implements ArtifactGenerator {
     /**
      * Creates an instance of an input artifact for the generator.
      *
-     * @param payload the payload downloaded from SDC
-     * @param artifactName name of the artifact to create
-     * @param artifactVersion version of the artifact to create
+     * @param payload
+     *     the payload downloaded from SDC
+     * @param artifactName
+     *     name of the artifact to create
+     * @param artifactVersion
+     *     version of the artifact to create
      * @return an {@link Artifact} object constructed from the payload and artifactInfo
      */
     public static Artifact createArtifact(byte[] payload, String artifactName, String artifactVersion) {
index 488faae..3bff7e7 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 © 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 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.api;
 
 import java.io.StringWriter;
@@ -52,7 +53,8 @@ public class AaiModelGeneratorImpl implements AaiModelGenerator {
     /**
      * Method to generate the AAI model for a Service.
      *
-     * @param service Java object model representing an AAI {@link Service} model
+     * @param service
+     *            Java object model representing an AAI {@link Service} model
      * @return XML representation of the service model in String format
      */
     @Override
@@ -111,7 +113,8 @@ public class AaiModelGeneratorImpl implements AaiModelGenerator {
     /**
      * Method to generate the AAI model for a Resource.
      *
-     * @param resource Java object model representing an AAI {@link Resource} model
+     * @param resource
+     *            Java object model representing an AAI {@link Resource} model
      * @return XML representation of the resource model in String format
      */
     @Override
@@ -164,10 +167,11 @@ public class AaiModelGeneratorImpl implements AaiModelGenerator {
     /**
      * Method to create the <model-element></model-element> holding the relationship value for a resource/widget model.
      *
-     * @param newDataDelFlag Value of the <new-data-del-flag></new-data-del-flag> attribute for a widget/resource in the
-     *        model xml
-     * @param relationshipValue Value of the <relationship-value></relationship-value> attribute for the widget/resource
-     *        in the model xml
+     * @param newDataDelFlag
+     *            Value of the <new-data-del-flag></new-data-del-flag> attribute for a widget/resource in the model xml
+     * @param relationshipValue
+     *            Value of the <relationship-value></relationship-value> attribute for the widget/resource in the model
+     *            xml
      * @return Java object representation for the <model-element></model-element> holding the relationship
      */
     private ModelElement createRelationshipModelElement(String newDataDelFlag, String modelVersionId,
@@ -200,8 +204,10 @@ public class AaiModelGeneratorImpl implements AaiModelGenerator {
      * Method to create the child model elements of the widget. Handles the generation of recursive child widget
      * elements (if any)
      *
-     * @param parent Reference to the parent widget model element
-     * @param widgetChildrenSet Set of children obtained from the tosca/widget definition
+     * @param parent
+     *            Reference to the parent widget model element
+     * @param widgetChildrenSet
+     *            Set of children obtained from the tosca/widget definition
      */
     private void generateWidgetChildren(ModelElement parent, Set<Widget> widgetChildrenSet) {
         for (Widget widget : widgetChildrenSet) {
@@ -223,21 +229,19 @@ public class AaiModelGeneratorImpl implements AaiModelGenerator {
     /**
      * Converts the data delete flag value from boolean to String as per AAI model.
      *
-     * @param delFlag Boolean value as true/false from the annotation
+     * @param delFlag
+     *            Boolean value as true/false from the annotation
      * @return Converted value to a flag as per AAI model
      */
     private String getNewDataDelFlagValue(boolean delFlag) {
-        if (delFlag) {
-            return "T";
-        } else {
-            return "F";
-        }
+        return delFlag ? "T" : "F";
     }
 
     /**
      * JAXB marshalling helper method to convert the Java object model to XML String.
      *
-     * @param model Java Object model of a service/widget/resource
+     * @param model
+     *            Java Object model of a service/widget/resource
      * @return XML representation of the Java model in String format
      */
     private String getModelAsString(Model model) {
index 121bc19..dffff62 100644 (file)
@@ -18,6 +18,7 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.aai.babel.xml.generator.model;
 
 import java.util.Collections;
@@ -29,7 +30,7 @@ public class Resource extends Model {
 
     private Type type;
     private boolean deleteFlag;
-    private boolean isResource = true;     
+    private boolean isResource = true;
     private Map<String, Object> properties = Collections.emptyMap();
 
     Widget vserver = null;
@@ -106,18 +107,17 @@ public class Resource extends Model {
     public boolean addWidget(Widget widget) {
         if (type == Type.VFMODULE) {
             if (widget.memberOf(members)) {
-                if (vserver == null && widget.getId().equals(new VServerWidget().getId())) {
+                if (vserver == null && widget instanceof VServerWidget) {
                     addVserverWidget(widget);
-                } else if (widget.getId().equals(new LIntfWidget().getId())) {
+                } else if (widget instanceof LIntfWidget) {
                     return addLIntfWidget(widget);
-                } else if (widget.getId().equals(new VolumeWidget().getId())) {
+                } else if (widget instanceof VolumeWidget) {
                     addVolumeWidget(widget);
                     return true;
                 }
-                if (widget.getId().equals(new OamNetwork().getId())) {
-                    return false;
+                if (!(widget instanceof OamNetwork)) {
+                    return widgets.add(widget);
                 }
-                return widgets.add(widget);
             }
             return false;
         } else {
index 11a9612..be84526 100644 (file)
@@ -114,8 +114,7 @@ public abstract class Widget extends Model {
     }
 
     public String getName() {
-        ModelWidget widgetModel = this.getClass().getAnnotation(ModelWidget.class);
-        return widgetModel.name();
+        return this.getClass().getAnnotation(ModelWidget.class).name();
     }
 
     /**
index a8f1f92..aae7846 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 © 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 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;
 
 import static org.hamcrest.CoreMatchers.is;
@@ -37,7 +38,7 @@ import org.onap.aai.babel.config.BabelAuthConfig;
 import org.springframework.mock.web.MockHttpServletRequest;
 
 /**
- * Tests @{link AAIMicroServiceAuth}
+ * Tests @{link AAIMicroServiceAuth}.
  */
 
 public class MicroServiceAuthTest {
@@ -54,10 +55,10 @@ public class MicroServiceAuthTest {
      * of a policy file that does not exist.
      *
      * @throws AAIAuthException
-     * @throws IOException
+     *             if the Auth policy file cannot be loaded
      */
     @Test(expected = AAIAuthException.class)
-    public void missingPolicyFile() throws AAIAuthException, IOException {
+    public void missingPolicyFile() throws AAIAuthException {
         String defaultFile = AAIMicroServiceAuthCore.getDefaultAuthFileName();
         try {
             AAIMicroServiceAuthCore.setDefaultAuthFileName("invalid.default.file");
@@ -70,14 +71,17 @@ public class MicroServiceAuthTest {
     }
 
     /**
-     * Test loading of a temporary file created with the specified roles
+     * Test loading of a temporary file created with the specified roles.
      *
      * @throws AAIAuthException
+     *             if the test creates invalid Auth Policy roles
      * @throws IOException
+     *             for I/O failures
      * @throws JSONException
+     *             if this test creates an invalid JSON object
      */
     @Test
-    public void createLocalAuthFile() throws AAIAuthException, IOException, JSONException {
+    public void createLocalAuthFile() throws JSONException, AAIAuthException, IOException {
         JSONObject roles = createRoleObject("role", createUserObject("user"), createFunctionObject("func"));
         createAuthService(roles);
         assertThat(AAIMicroServiceAuthCore.authorize("nosuchuser", "method:func"), is(false));
@@ -85,9 +89,10 @@ public class MicroServiceAuthTest {
     }
 
     /**
-     * Test that the default policy file is loaded when a non-existent file is passed to the authorisation clas.
+     * Test that the default policy file is loaded when a non-existent file is passed to the authorisation class.
      *
      * @throws AAIAuthException
+     *             if the Auth Policy cannot be loaded
      */
     @Test
     public void createAuthFromDefaultFile() throws AAIAuthException {
@@ -99,9 +104,10 @@ public class MicroServiceAuthTest {
     }
 
     /**
-     * Test loading of the policy file relative to CONFIG_HOME
+     * Test loading of the policy file relative to CONFIG_HOME.
      *
      * @throws AAIAuthException
+     *             if the Auth Policy cannot be loaded
      */
     @Test
     public void createAuth() throws AAIAuthException {
@@ -129,12 +135,17 @@ public class MicroServiceAuthTest {
     }
 
     /**
-     * @param rolesJson
-     * @return
+     * Create a test Auth policy JSON file and pass this to the Auth Service.
+     * 
+     * @param roles
+     *            the Auth policy JSON content
+     * @return a new Auth Service configured with the supplied roles
      * @throws IOException
+     *             for I/O failures
      * @throws AAIAuthException
+     *             if the auth policy file cannot be loaded
      */
-    private AAIMicroServiceAuth createAuthService(JSONObject roles) throws IOException, AAIAuthException {
+    private AAIMicroServiceAuth createAuthService(JSONObject roles) throws AAIAuthException, IOException {
         File file = File.createTempFile("auth-policy", "json");
         file.deleteOnExit();
         FileWriter fileWriter = new FileWriter(file);
@@ -148,11 +159,14 @@ public class MicroServiceAuthTest {
     }
 
     /**
-     * Assert authorisation results for an admin user based on the test policy file
+     * Assert authorisation results for an admin user based on the test policy file.
      *
      * @param auth
+     *            the Auth Service to test
      * @param adminUser
+     *            admin username
      * @throws AAIAuthException
+     *             if the Auth Service is not initialized
      */
     private void assertAdminUserAuthorisation(AAIMicroServiceAuth auth, String adminUser) throws AAIAuthException {
         assertThat(AAIMicroServiceAuthCore.authorize(adminUser, "GET:actions"), is(true));
index 9fcc5a4..6fbb1f1 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 © 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 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.
@@ -31,7 +31,9 @@ public class SdcToscaHelper {
     private ArrayList<NodeTemplate> smnodetemplates = new ArrayList<>();
 
     /**
-     * @return
+     * Create the test SubstitutionMappings.
+     * 
+     * @return the new Substitution Mappings
      */
     public SubstitutionMappings buildMappings() {
         LinkedHashMap<String, Object> defProps = getImagesDefProps();
@@ -78,7 +80,7 @@ public class SdcToscaHelper {
     }
 
     /**
-     *
+     * Create a new NodeTemplate and add it to the list (for populating the Substitution Mappings).
      */
     public void addNodeTemplate() {
         String name = "node name";
@@ -98,7 +100,11 @@ public class SdcToscaHelper {
     }
 
     /**
+     * Simulate the creation of a NodeTemplate by the SDC TOSCA parser. Populate the properties of the NodeTemplate with
+     * the supplied images.
+     * 
      * @param images
+     *            the value of the images property
      */
     public void addNodeTemplate(Object images) {
         LinkedHashMap<String, Object> properties = new LinkedHashMap<>();
index f8d8478..348e1a1 100644 (file)
@@ -18,6 +18,7 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.aai.babel.parser;
 
 import static org.hamcrest.CoreMatchers.equalTo;
@@ -64,8 +65,8 @@ public class TestToscaParser {
         GenerationData data =
                 generator.generateArtifact(CsarTest.VNF_VENDOR_CSAR.getContent(), ymlFiles, additionalParams);
 
-        assertThat(data.getErrorData().size(), is(equalTo(0)));
-        assertThat(data.getResultData().size(), is(equalTo(2)));
+        assertThat("Number of errors produced", data.getErrorData().size(), is(equalTo(0)));
+        assertThat("Number of resources generated", data.getResultData().size(), is(equalTo(2)));
     }
 
 }
index 1ead8e6..bcd1e8a 100644 (file)
@@ -113,9 +113,6 @@ public class CsarToXmlConverterTest {
      *             if there is an error either extracting the YAML files or generating XML artifacts
      * @throws IOException
      *             if an I/O exception occurs loading the test CSAR file
-     * @throws IOException
-     * @throws XmlArtifactGenerationException
-     * @throws CsarConverterException
      */
     @Test
     public void testArtifactGeneratorConfigMissing() throws CsarConverterException, IOException {
@@ -131,13 +128,13 @@ public class CsarToXmlConverterTest {
     /**
      * Test that an Exception is thrown when the Artifact Generator's Group Filter properties are not present.
      *
-     * @throws IOException
-     * @throws XmlArtifactGenerationException
      * @throws CsarConverterException
+     *             if there is an error either extracting the YAML files or generating XML artifacts
+     * @throws IOException
+     *             if an I/O exception occurs
      */
     @Test
-    public void generateXmlFromCsarFilterTypesSystemPropertyNotSet()
-            throws IOException, XmlArtifactGenerationException, CsarConverterException {
+    public void generateXmlFromCsarFilterTypesSystemPropertyNotSet() throws CsarConverterException, IOException {
         exception.expect(CsarConverterException.class);
         exception.expectMessage("Cannot generate artifacts. System property "
                 + ArtifactGeneratorToscaParser.PROPERTY_GROUP_FILTERS_CONFIG_FILE + " not configured");
@@ -195,6 +192,13 @@ public class CsarToXmlConverterTest {
         assertThatGeneratedFilesMatchExpected(createExpectedXmlFiles(filesToLoad), CsarTest.SERVICE_PROXY_CSAR_FILE);
     }
 
+    /**
+     * A Matcher for comparing generated XML Strings with expected XML content.
+     * 
+     * @param expected
+     *            the expected XML String
+     * @return a new Matcher for comparing XML Strings
+     */
     public Matcher<String> matches(final String expected) {
         return new BaseMatcher<String>() {
             protected String theExpected = expected;
index d87f3c3..a38686f 100644 (file)
@@ -84,11 +84,14 @@ public class TestGenerateArtifactsServiceImpl {
 
     /**
      * No VNF Configuration exists.
-     *
-     * @throws Exception
+     * 
+     * @throws URISyntaxException
+     *             if the URI cannot be created
+     * @throws IOException
+     *             if the resource cannot be loaded
      */
     @Test
-    public void testGenerateArtifactsWithoutVnfConfiguration() throws Exception {
+    public void testGenerateArtifactsWithoutVnfConfiguration() throws IOException, URISyntaxException {
         Response response = processJsonRequest(CsarTest.NO_VNF_CONFIG_CSAR);
         assertThat(response.getStatus(), is(Response.Status.OK.getStatusCode()));
         assertThat(response.getEntity(), is(getResponseJson("validNoVnfConfigurationResponse.json")));
@@ -146,6 +149,7 @@ public class TestGenerateArtifactsServiceImpl {
      * Create a (mocked) HTTPS request and invoke the Babel generate artifacts API.
      *
      * @param csar
+     *            test CSAR file
      * @return the Response from the HTTP API
      * @throws URISyntaxException
      *             if the URI cannot be created
index 4f4c8ad..8b28551 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 © 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 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.
@@ -66,8 +66,10 @@ public enum CsarTest {
      * Extract YAML Artifacts.
      *
      * @return the extracted artifacts
-     * @throws InvalidArchiveException if the CSAR is invalid
-     * @throws IOException for I/O errors
+     * @throws InvalidArchiveException
+     *             if the CSAR is invalid
+     * @throws IOException
+     *             for I/O errors
      */
     public List<Artifact> extractArtifacts() throws InvalidArchiveException, IOException {
         return new YamlExtractor().extract(getContent(), getName(), "v1");
@@ -77,14 +79,22 @@ public enum CsarTest {
      * Extract VNF Vendor Image Artifacts.
      *
      * @return the extracted artifacts
-     * @throws IOException
      * @throws ToscaToCatalogException
-     *
+     *             if the CSAR content is not valid
+     * @throws IOException
+     *             if an I/O exception occursSince:
      */
     public BabelArtifact extractVnfVendorImages() throws ToscaToCatalogException, IOException {
         return new VnfVendorImageExtractor().extract(getContent());
     }
 
+    /**
+     * Create a BabelRequest containing the encoded CSAR content.
+     * 
+     * @return a new Babel request for this CSAR
+     * @throws IOException
+     *             if an I/O exception occurs
+     */
     public String getJsonRequest() throws IOException {
         BabelRequest request = new BabelRequest();
         request.setArtifactName(getName());
index 6608c00..445dd84 100644 (file)
@@ -56,6 +56,9 @@ public class ArtifactTestUtils {
     private static final String JSON_RESPONSES_FOLDER = "response/";
     private static final String CSAR_INPUTS_FOLDER = "compressedArtifacts/";
 
+    /**
+     * Initialise System Properties for test configuration files.
+     */
     public void setGeneratorSystemProperties() {
         System.setProperty(ArtifactGeneratorToscaParser.PROPERTY_ARTIFACT_GENERATOR_CONFIG_FILE,
                 getResourcePath(Resources.ARTIFACT_GENERATOR_CONFIG));
@@ -143,6 +146,15 @@ public class ArtifactTestUtils {
         return Files.lines(Paths.get(getResource(resourceFile).toURI())).collect(Collectors.joining());
     }
 
+    /**
+     * Create Properties from the content of the named resource (e.g. a file on the classpath).
+     * 
+     * @param resourceName
+     *            the resource name
+     * @return Properties loaded from the named resource
+     * @throws IOException
+     *             if an error occurred when reading from the named resource
+     */
     public Properties getResourceAsProperties(String resourceName) throws IOException {
         final Properties properties = new Properties();
         InputStream in = ArtifactTestUtils.class.getClassLoader().getResourceAsStream(resourceName);