From 815053ebf5a8625616025fa7f08fd5ae60fc4ff1 Mon Sep 17 00:00:00 2001 From: Dylan Date: Tue, 5 Mar 2024 16:10:16 -0600 Subject: [PATCH] update examples and integration tests for new endpoint --- .../v1/ContextBasedRestrictionsIT.java | 4 ++-- .../v1/ContextBasedRestrictionsExamples.java | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/context-based-restrictions/src/test/java/com/ibm/cloud/platform_services/context_based_restrictions/v1/ContextBasedRestrictionsIT.java b/modules/context-based-restrictions/src/test/java/com/ibm/cloud/platform_services/context_based_restrictions/v1/ContextBasedRestrictionsIT.java index 344f784242..e681dfafc8 100644 --- a/modules/context-based-restrictions/src/test/java/com/ibm/cloud/platform_services/context_based_restrictions/v1/ContextBasedRestrictionsIT.java +++ b/modules/context-based-restrictions/src/test/java/com/ibm/cloud/platform_services/context_based_restrictions/v1/ContextBasedRestrictionsIT.java @@ -425,11 +425,11 @@ public void testListAvailableServicerefTargetsInvalidType() throws Exception { } } - @Test(groups = "serviceRef", dependsOnMethods = "replaceZone") + @Test(groups = "serviceRef", dependsOnGroups = "replaceZone") public void testGetServicerefTarget() throws Exception { try { GetServicerefTargetOptions getServicerefTargetOptions = new GetServicerefTargetOptions.Builder() - .serviceName(testServiceName) + .serviceName("containers-kubernetes") .xCorrelationId("testString") .transactionId("testString") .build(); diff --git a/modules/examples/src/main/java/com/ibm/cloud/platform_services/context_based_restrictions/v1/ContextBasedRestrictionsExamples.java b/modules/examples/src/main/java/com/ibm/cloud/platform_services/context_based_restrictions/v1/ContextBasedRestrictionsExamples.java index d076d72242..85f3ba13f3 100644 --- a/modules/examples/src/main/java/com/ibm/cloud/platform_services/context_based_restrictions/v1/ContextBasedRestrictionsExamples.java +++ b/modules/examples/src/main/java/com/ibm/cloud/platform_services/context_based_restrictions/v1/ContextBasedRestrictionsExamples.java @@ -234,16 +234,19 @@ public static void main(String[] args) throws Exception { try { System.out.println("getServicerefTarget() result:"); + String tempServiceName = serviceName; + serviceName = "containers-kubernetes"; // begin-get_serviceref_target GetServicerefTargetOptions getServicerefTargetOptions = new GetServicerefTargetOptions.Builder() - .serviceName("testString") + .serviceName(serviceName) .build(); - + Response response = contextBasedRestrictionsService.getServicerefTarget(getServicerefTargetOptions).execute(); ServiceRefTarget serviceRefTarget = response.getResult(); - + System.out.println(serviceRefTarget); // end-get_serviceref_target + serviceName = tempServiceName; } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e);