import org.oransc.enrichment.clients.AsyncRestClient;
import org.oransc.enrichment.clients.AsyncRestClientFactory;
import org.oransc.enrichment.configuration.ApplicationConfig;
+import org.oransc.enrichment.configuration.ImmutableHttpProxyConfig;
import org.oransc.enrichment.configuration.ImmutableWebClientConfig;
import org.oransc.enrichment.configuration.WebClientConfig;
+import org.oransc.enrichment.configuration.WebClientConfig.HttpProxyConfig;
import org.oransc.enrichment.controller.ConsumerSimulatorController;
import org.oransc.enrichment.controller.ProducerSimulatorController;
import org.oransc.enrichment.controllers.consumer.ConsumerConsts;
ResponseEntity<String> resp = restClient().getForEntity(url).block();
assertThat(resp.getStatusCode()).isEqualTo(HttpStatus.OK);
- String indented = (new JSONObject(resp.getBody())).toString(4);
- try (PrintStream out = new PrintStream(new FileOutputStream("../docs/offeredapis/swagger/ecs-api.json"))) {
+ JSONObject jsonObj = new JSONObject(resp.getBody());
+ jsonObj.remove("host");
+ String indented = jsonObj.toString(4);
+ try (PrintStream out = new PrintStream(new FileOutputStream("api/ecs-api.json"))) {
out.print(indented);
}
}
private AsyncRestClient restClient(boolean useTrustValidation) {
WebClientConfig config = this.applicationConfig.getWebClientConfig();
+ HttpProxyConfig httpProxyConfig = ImmutableHttpProxyConfig.builder() //
+ .httpProxyHost("") //
+ .httpProxyPort(0) //
+ .build();
config = ImmutableWebClientConfig.builder() //
.keyStoreType(config.keyStoreType()) //
.keyStorePassword(config.keyStorePassword()) //
.isTrustStoreUsed(useTrustValidation) //
.trustStore(config.trustStore()) //
.trustStorePassword(config.trustStorePassword()) //
- .build();
+ .httpProxyConfig(httpProxyConfig).build();
AsyncRestClientFactory restClientFactory = new AsyncRestClientFactory(config);
- return restClientFactory.createRestClient(baseUrl());
+ return restClientFactory.createRestClientNoHttpProxy(baseUrl());
}
private AsyncRestClient restClient() {