From 6150dc162cdf2c7ad8e504896955ddd7a3c773a6 Mon Sep 17 00:00:00 2001 From: Quinn Klassen Date: Mon, 23 Sep 2024 08:27:04 -0700 Subject: [PATCH] Fill in namespace capabilities in describe response (#2228) Fill in namespace capabilities in describe response --- .../testservice/TestWorkflowService.java | 5 +++++ .../functional/DescribeNamespaceTest.java | 22 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/temporal-test-server/src/main/java/io/temporal/internal/testservice/TestWorkflowService.java b/temporal-test-server/src/main/java/io/temporal/internal/testservice/TestWorkflowService.java index 0b310102d..cf21d4bb7 100644 --- a/temporal-test-server/src/main/java/io/temporal/internal/testservice/TestWorkflowService.java +++ b/temporal-test-server/src/main/java/io/temporal/internal/testservice/TestWorkflowService.java @@ -1362,6 +1362,11 @@ public void describeNamespace( .setName(request.getNamespace()) .setState(NamespaceState.NAMESPACE_STATE_REGISTERED) .setId(namespaceId) + .setCapabilities( + NamespaceInfo.Capabilities.newBuilder() + .setEagerWorkflowStart(true) + .setAsyncUpdate(true) + .setSyncUpdate(true)) .build()) .build(); responseObserver.onNext(result); diff --git a/temporal-test-server/src/test/java/io/temporal/testserver/functional/DescribeNamespaceTest.java b/temporal-test-server/src/test/java/io/temporal/testserver/functional/DescribeNamespaceTest.java index 54236d1dc..8ccc3f8f3 100644 --- a/temporal-test-server/src/test/java/io/temporal/testserver/functional/DescribeNamespaceTest.java +++ b/temporal-test-server/src/test/java/io/temporal/testserver/functional/DescribeNamespaceTest.java @@ -21,6 +21,7 @@ package io.temporal.testserver.functional; import static org.junit.Assert.*; +import static org.junit.Assume.assumeFalse; import io.grpc.Status; import io.grpc.StatusRuntimeException; @@ -53,6 +54,27 @@ public void testDescribeNamespace() { assertTrue(describeNamespaceResponse.getNamespaceInfo().getId().length() > 0); } + @Test + public void testDescribeNamespaceCapabilities() { + assumeFalse( + "Real Server doesn't support namespace capabilities yet", + SDKTestWorkflowRule.useExternalService); + + DescribeNamespaceResponse describeNamespaceResponse = + testWorkflowRule + .getWorkflowServiceStubs() + .blockingStub() + .describeNamespace( + DescribeNamespaceRequest.newBuilder() + .setNamespace(RegisterTestNamespace.NAMESPACE) + .build()); + + assertTrue( + describeNamespaceResponse.getNamespaceInfo().getCapabilities().getEagerWorkflowStart()); + assertTrue(describeNamespaceResponse.getNamespaceInfo().getCapabilities().getSyncUpdate()); + assertTrue(describeNamespaceResponse.getNamespaceInfo().getCapabilities().getAsyncUpdate()); + } + @Test public void noNamespaceSet() { StatusRuntimeException ex =