Skip to content

Commit

Permalink
Used ProxyHandler in MegacliteDestination connectivity test (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesDuboisSAP authored Oct 25, 2023
1 parent 35f9991 commit a6f98f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private Try<HttpDestination> toProxiedDestination( @Nonnull final HttpDestinatio
// be sure to use exactly this instance of connectivityResolver since it has a cache attached
.headerProviders(connectivityResolver);

return proxyUrl.map(builder::proxy).map(DefaultHttpDestination.Builder::build);
return proxyUrl.map(builder::proxy).map(DefaultHttpDestination.Builder::buildInternal);
}

@Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@ public void testConnectivityInformationIsAdded()

sut.setConnectivityResolver(mock);

final DefaultHttpDestination baseDestination =
DefaultHttpDestinationBuilderProxyHandler.setServiceBindingDestinationLoader(sut);

final DefaultHttpDestination result =
DefaultHttpDestination
.builder(baseUrl)
.name("foo")
Expand All @@ -280,14 +282,6 @@ public void testConnectivityInformationIsAdded()
.proxyType(ProxyType.ON_PREMISE)
.build();

final ServiceBindingDestinationOptions options =
ServiceBindingDestinationOptions
.forService(ServiceIdentifier.CONNECTIVITY)
.withOption(ProxyOptions.destinationToBeProxied(baseDestination))
.build();

final HttpDestination result = sut.getDestination(options);

assertThat(result.getUri()).isEqualTo(baseUrl);
assertThat(result.get(DestinationProperty.PROXY_URI).get()).isEqualTo(proxyUrl);
assertThat(result.getHeaders())
Expand Down

0 comments on commit a6f98f7

Please sign in to comment.