From 1503338324d7688b41acb706bbc163d66674ee7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Tue, 15 Oct 2024 16:10:43 +0200 Subject: [PATCH] Fix test --- .../sap/ai/sdk/core/AiCoreServiceTest.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/core/src/test/java/com/sap/ai/sdk/core/AiCoreServiceTest.java b/core/src/test/java/com/sap/ai/sdk/core/AiCoreServiceTest.java index 8b100e11..c12f77c5 100644 --- a/core/src/test/java/com/sap/ai/sdk/core/AiCoreServiceTest.java +++ b/core/src/test/java/com/sap/ai/sdk/core/AiCoreServiceTest.java @@ -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/"); } }