Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
a-d committed Oct 15, 2024
1 parent 0afd536 commit 1503338
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions core/src/test/java/com/sap/ai/sdk/core/AiCoreServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,24 @@ void testCustomization() {
new AiCoreService() {
@Nonnull
@Override
protected ApiClient getApiClient(@Nonnull final Destination destination) {
return new ApiClient().setBasePath("foo");
protected Destination getBaseDestination() {
return DefaultHttpDestination.builder("https://ai").build();
}

@Nonnull
@Override
protected ApiClient getApiClient(@Nonnull Destination destination) {
return new ApiClient().setBasePath("https://fizz.buzz").setUserAgent("SAP");
}
;
};

final var customServiceForDeployment =
customService.forDeployment("deployment").withResourceGroup("group");
ApiClient client = customServiceForDeployment.client();
assertThat(client.getBasePath()).isEqualTo("foo");

final var client = customServiceForDeployment.client();
assertThat(client.getBasePath()).isEqualTo("https://fizz.buzz");

final var destination = customServiceForDeployment.destination().asHttp();
assertThat(destination.getUri()).hasToString("https://ai/v2/inference/deployments/deployment/");
}
}

0 comments on commit 1503338

Please sign in to comment.