forked from temporalio/sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add trivial describeNamespace test server implementation
Issue temporalio#1158
- Loading branch information
1 parent
3db50b6
commit 91945b2
Showing
4 changed files
with
131 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...al-test-server/src/test/java/io/temporal/testserver/functional/DescribeNamespaceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (C) 2020 Temporal Technologies, Inc. All Rights Reserved. | ||
* | ||
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Modifications copyright (C) 2017 Uber Technologies, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). You may not | ||
* use this file except in compliance with the License. A copy of the License is | ||
* located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
package io.temporal.testserver.functional; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
import io.temporal.api.enums.v1.NamespaceState; | ||
import io.temporal.api.workflowservice.v1.DescribeNamespaceRequest; | ||
import io.temporal.api.workflowservice.v1.DescribeNamespaceResponse; | ||
import io.temporal.internal.docker.RegisterTestNamespace; | ||
import io.temporal.testing.internal.SDKTestWorkflowRule; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
|
||
public class DescribeNamespaceTest { | ||
@Rule public SDKTestWorkflowRule testWorkflowRule = SDKTestWorkflowRule.newBuilder().build(); | ||
|
||
@Test | ||
public void testDescribeNamespace() { | ||
DescribeNamespaceResponse describeNamespaceResponse = | ||
testWorkflowRule | ||
.getWorkflowServiceStubs() | ||
.blockingStub() | ||
.describeNamespace( | ||
DescribeNamespaceRequest.newBuilder() | ||
.setNamespace(RegisterTestNamespace.NAMESPACE) | ||
.build()); | ||
assertEquals( | ||
NamespaceState.NAMESPACE_STATE_REGISTERED, | ||
describeNamespaceResponse.getNamespaceInfo().getState()); | ||
assertEquals( | ||
RegisterTestNamespace.NAMESPACE, describeNamespaceResponse.getNamespaceInfo().getName()); | ||
assertTrue(describeNamespaceResponse.getNamespaceInfo().getId().length() > 0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters