Add JUnit test for invalid TOSCA mappings JSON
[aai/babel.git] / src / test / java / org / onap / aai / babel / service / TestGenerateArtifactsServiceImpl.java
index d87f3c3..be02e17 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.
@@ -59,20 +59,15 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 public class TestGenerateArtifactsServiceImpl {
 
     static {
-        if (System.getProperty("APP_HOME") == null) {
-            System.setProperty("APP_HOME", ".");
-        }
         System.setProperty("CONFIG_HOME", "src/test/resources");
     }
 
-
     @Inject
     private AAIMicroServiceAuth auth;
 
     @BeforeClass
     public static void setup() {
         new ArtifactTestUtils().setGeneratorSystemProperties();
-
     }
 
     @Test
@@ -84,11 +79,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 +144,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