summaryrefslogtreecommitdiffstats
path: root/runtime/src/test/java/org
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2021-06-30 19:46:09 +0100
committerliamfallon <liam.fallon@est.tech>2021-07-01 13:24:33 +0100
commit72d882f65031518e9d1b1a6d6e53c7d42ab8495f (patch)
tree9967da8b1c68762661a5fd4e03b9bd8283cd9cb9 /runtime/src/test/java/org
parent7d04c23c7c51738d68f325e450ac408c1ae9905f (diff)
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 <liam.fallon@est.tech>
Diffstat (limited to 'runtime/src/test/java/org')
-rw-r--r--runtime/src/test/java/org/onap/policy/clamp/clds/it/HttpsItCase.java9
1 files changed, 3 insertions, 6 deletions
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<String> 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<String> 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<String> 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());
}