|
5 | 5 | package com.sap.cloud.sdk.cloudplatform.connectivity;
|
6 | 6 |
|
7 | 7 | import static com.sap.cloud.sdk.cloudplatform.connectivity.BtpServiceOptions.IasOptions;
|
| 8 | +import static com.sap.cloud.sdk.cloudplatform.connectivity.BtpServicePropertySuppliers.AI_CORE; |
8 | 9 | import static com.sap.cloud.sdk.cloudplatform.connectivity.BtpServicePropertySuppliers.BUSINESS_LOGGING;
|
9 | 10 | import static com.sap.cloud.sdk.cloudplatform.connectivity.BtpServicePropertySuppliers.BUSINESS_RULES;
|
10 | 11 | import static com.sap.cloud.sdk.cloudplatform.connectivity.BtpServicePropertySuppliers.CONNECTIVITY;
|
|
16 | 17 | import static org.assertj.core.api.Assertions.entry;
|
17 | 18 |
|
18 | 19 | import java.lang.reflect.Modifier;
|
| 20 | +import java.net.URI; |
19 | 21 | import java.nio.file.Files;
|
20 | 22 | import java.nio.file.Path;
|
21 | 23 | import java.security.KeyStore;
|
@@ -246,6 +248,35 @@ void testThrowsWithoutOption()
|
246 | 248 | }
|
247 | 249 | }
|
248 | 250 |
|
| 251 | + @Nested |
| 252 | + @DisplayName( "AiCore" ) |
| 253 | + class AiCoreTest |
| 254 | + { |
| 255 | + final ServiceBinding binding = |
| 256 | + bindingWithCredentials( |
| 257 | + ServiceIdentifier.of("aicore"), |
| 258 | + entry("serviceurls.AI_API_URL", "https://api.ai.internalprod.eu-central-1.aws.ml.hana.ondemand.com"), |
| 259 | + entry("clientid", "client-id"), |
| 260 | + entry("clientsecret", "client-secret"), |
| 261 | + entry("url", "https://subaccount.authentication.sap.hana.ondemand.com")); |
| 262 | + |
| 263 | + @Test |
| 264 | + void testAiCore() |
| 265 | + { |
| 266 | + final ServiceBindingDestinationOptions options = |
| 267 | + ServiceBindingDestinationOptions.forService(binding).build(); |
| 268 | + |
| 269 | + final OAuth2PropertySupplier sut = AI_CORE.resolve(options); |
| 270 | + |
| 271 | + assertThat(sut.getServiceUri()) |
| 272 | + .isEqualTo(URI.create("https://api.ai.internalprod.eu-central-1.aws.ml.hana.ondemand.com")); |
| 273 | + assertThat(sut.getClientIdentity().getId()).isEqualTo("client-id"); |
| 274 | + assertThat(sut.getClientIdentity().getSecret()).isEqualTo("client-secret"); |
| 275 | + assertThat(sut.getTokenUri()) |
| 276 | + .isEqualTo(URI.create("https://subaccount.authentication.sap.hana.ondemand.com")); |
| 277 | + } |
| 278 | + } |
| 279 | + |
249 | 280 | @Nested
|
250 | 281 | @DisplayName( "Business Logging" )
|
251 | 282 | class BusinessLoggingTest
|
|
0 commit comments