From 72d882f65031518e9d1b1a6d6e53c7d42ab8495f Mon Sep 17 00:00:00 2001 From: liamfallon Date: Wed, 30 Jun 2021 19:46:09 +0100 Subject: Restore swagger generation in CLAMP THis patch restores the Swagger generation in CLAMP. It changes the target directory for the swagger generation to be the target directory rather than storing the generated Swagger files in the source repository. The reason for this is that it avolds the swagger.json, the swagger.html, and the swagger.pdf files being generated each time a build is done and being checked in multiple times. The swagger files will be produced as an artifact from the build in a later review when all the swagger documentation for CLAMP is consolidated. Issue-ID: POLICY-3209 Change-Id: I6ccb446d01509232bbd4230b76bd7950858e1437 Signed-off-by: liamfallon --- .../src/test/java/org/onap/policy/clamp/clds/it/HttpsItCase.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'runtime/src/test/java/org/onap') diff --git a/runtime/src/test/java/org/onap/policy/clamp/clds/it/HttpsItCase.java b/runtime/src/test/java/org/onap/policy/clamp/clds/it/HttpsItCase.java index c68ee39dc..180c3094d 100644 --- a/runtime/src/test/java/org/onap/policy/clamp/clds/it/HttpsItCase.java +++ b/runtime/src/test/java/org/onap/policy/clamp/clds/it/HttpsItCase.java @@ -39,7 +39,6 @@ import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.conn.ssl.TrustStrategy; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Value; @@ -67,27 +66,25 @@ public class HttpsItCase { @Value("${server.http-to-https-redirection.port}") private String httpPort; - @Ignore @Test public void testDesignerIndex() throws Exception { ResponseEntity entity = - new RestTemplate().getForEntity("http://localhost:" + this.httpPort + "/swagger.html", + new RestTemplate().getForEntity("http://localhost:" + this.httpPort + "/restservices/clds/api-doc", String.class); assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.FOUND); ResponseEntity httpsEntity = getRestTemplate() - .getForEntity("https://localhost:" + this.httpsPort + "/swagger.html", String.class); + .getForEntity("https://localhost:" + this.httpsPort + "/restservices/clds/api-doc", String.class); assertThat(httpsEntity.getStatusCode()).isEqualTo(HttpStatus.OK); assertThat(httpsEntity.getBody()).contains("Clamp Rest API"); } - @Ignore @Test public void testSwaggerJson() throws Exception { ResponseEntity httpsEntity = getRestTemplate() .getForEntity("https://localhost:" + this.httpsPort + "/restservices/clds/api-doc", String.class); assertThat(httpsEntity.getStatusCode()).isEqualTo(HttpStatus.OK); assertThat(httpsEntity.getBody()).contains("swagger"); - FileUtils.writeStringToFile(new File("docs/swagger/swagger.json"), httpsEntity.getBody(), + FileUtils.writeStringToFile(new File("target/swagger/swagger.json"), httpsEntity.getBody(), Charset.defaultCharset()); } -- cgit 1.2.3-korg