- URL url = TestGenerateArtifactsServiceImpl.class.getClassLoader().getResource("artifact-generator.properties");
- System.setProperty(GeneratorConstants.PROPERTY_ARTIFACT_GENERATOR_CONFIG_FILE, url.getPath());
+ new ArtifactTestUtils().setGeneratorSystemProperties();
+
+ }
+
+ @Test
+ public void testGenerateArtifacts() throws Exception {
+ Response response = processJsonRequest(CsarTest.VNF_VENDOR_CSAR);
+ assertThat(response.getStatus(), is(Response.Status.OK.getStatusCode()));
+ assertThat(response.getEntity(), is(getResponseJson("response.json")));
+ }
+
+ /**
+ * No VNF Configuration exists.
+ *
+ * @throws URISyntaxException
+ * if the URI cannot be created
+ * @throws IOException
+ * if the resource cannot be loaded
+ */
+ @Test
+ 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")));