@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType)
- throws java.security.cert.CertificateException {
+ throws java.security.cert.CertificateException {
}
@Override
public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType)
- throws java.security.cert.CertificateException {
+ throws java.security.cert.CertificateException {
}
@Override
return null;
}
};
- ctx.init(null, new TrustManager[] {
- tm
- }, null);
+ ctx.init(null, new TrustManager[] { tm }, null);
SSLContext.setDefault(ctx);
} catch (Exception ex) {
ex.printStackTrace();
}
});
template.setRequestFactory(factory);
- ResponseEntity<String> entity = template
- .getForEntity("http://localhost:" + this.httpPort + "/designer/index.html", String.class);
+ ResponseEntity<String> entity = template.getForEntity("http://localhost:" + this.httpPort + "/swagger.html",
+ String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.FOUND);
ResponseEntity<String> httpsEntity = template
- .getForEntity("https://localhost:" + this.httpsPort + "/designer/index.html", String.class);
+ .getForEntity("https://localhost:" + this.httpsPort + "/swagger.html", String.class);
assertThat(httpsEntity.getStatusCode()).isEqualTo(HttpStatus.OK);
- assertThat(httpsEntity.getBody()).contains("CLDS");
+ assertThat(httpsEntity.getBody()).contains("Clamp Rest API");
}
@Test
});
template.setRequestFactory(factory);
ResponseEntity<String> httpsEntity = template
- .getForEntity("https://localhost:" + this.httpsPort + "/restservices/clds/api-doc", String.class);
+ .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(), Charset.defaultCharset());
+ FileUtils.writeStringToFile(new File("docs/swagger/swagger.json"), httpsEntity.getBody(),
+ Charset.defaultCharset());
}
/**
@Override
protected void prepareConnection(final HttpURLConnection connection, final String httpMethod)
- throws IOException {
+ throws IOException {
if (connection instanceof HttpsURLConnection) {
((HttpsURLConnection) connection).setHostnameVerifier(this.verifier);
}