|
| 1 | +/** |
| 2 | + * Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 3 | + * |
| 4 | + * <p>Modifications copyright (C) 2017 Uber Technologies, Inc. |
| 5 | + * |
| 6 | + * <p>Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file |
| 7 | + * except in compliance with the License. A copy of the License is located at |
| 8 | + * |
| 9 | + * <p>http://aws.amazon.com/apache2.0 |
| 10 | + * |
| 11 | + * <p>or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
| 13 | + * specific language governing permissions and limitations under the License. |
| 14 | + */ |
| 15 | +package com.uber.cadence.testing; |
| 16 | + |
| 17 | +import static org.junit.Assert.assertThrows; |
| 18 | + |
| 19 | +import com.uber.cadence.*; |
| 20 | +import com.uber.cadence.serviceclient.IWorkflowService; |
| 21 | +import junit.framework.TestCase; |
| 22 | + |
| 23 | +public class TestWorkflowEnvironmentTest extends TestCase { |
| 24 | + TestWorkflowEnvironment testEnvironment; |
| 25 | + |
| 26 | + public void setUp() throws Exception { |
| 27 | + testEnvironment = TestWorkflowEnvironment.newInstance(); |
| 28 | + } |
| 29 | + |
| 30 | + public void testWorkflowService() { |
| 31 | + IWorkflowService service = testEnvironment.getWorkflowService(); |
| 32 | + // unimplemented |
| 33 | + assertThrows( |
| 34 | + UnsupportedOperationException.class, |
| 35 | + () -> service.RegisterDomain(new RegisterDomainRequest())); |
| 36 | + assertThrows( |
| 37 | + UnsupportedOperationException.class, |
| 38 | + () -> service.DescribeDomain(new DescribeDomainRequest())); |
| 39 | + assertThrows( |
| 40 | + UnsupportedOperationException.class, () -> service.ListDomains(new ListDomainsRequest())); |
| 41 | + assertThrows( |
| 42 | + UnsupportedOperationException.class, () -> service.UpdateDomain(new UpdateDomainRequest())); |
| 43 | + assertThrows( |
| 44 | + UnsupportedOperationException.class, |
| 45 | + () -> service.DeprecateDomain(new DeprecateDomainRequest())); |
| 46 | + assertThrows( |
| 47 | + UnsupportedOperationException.class, |
| 48 | + () -> service.RestartWorkflowExecution(new RestartWorkflowExecutionRequest())); |
| 49 | + assertThrows( |
| 50 | + UnsupportedOperationException.class, |
| 51 | + () -> service.GetTaskListsByDomain(new GetTaskListsByDomainRequest())); |
| 52 | + assertThrows( |
| 53 | + UnsupportedOperationException.class, |
| 54 | + () -> service.TerminateWorkflowExecution(new TerminateWorkflowExecutionRequest())); |
| 55 | + assertThrows( |
| 56 | + UnsupportedOperationException.class, |
| 57 | + () -> service.ListWorkflowExecutions(new ListWorkflowExecutionsRequest())); |
| 58 | + assertThrows( |
| 59 | + UnsupportedOperationException.class, |
| 60 | + () -> service.ListArchivedWorkflowExecutions(new ListArchivedWorkflowExecutionsRequest())); |
| 61 | + assertThrows( |
| 62 | + UnsupportedOperationException.class, |
| 63 | + () -> service.ScanWorkflowExecutions(new ListWorkflowExecutionsRequest())); |
| 64 | + assertThrows( |
| 65 | + UnsupportedOperationException.class, |
| 66 | + () -> service.CountWorkflowExecutions(new CountWorkflowExecutionsRequest())); |
| 67 | + assertThrows(UnsupportedOperationException.class, () -> service.GetSearchAttributes()); |
| 68 | + assertThrows( |
| 69 | + UnsupportedOperationException.class, |
| 70 | + () -> service.ResetStickyTaskList(new ResetStickyTaskListRequest())); |
| 71 | + assertThrows( |
| 72 | + UnsupportedOperationException.class, |
| 73 | + () -> service.DescribeWorkflowExecution(new DescribeWorkflowExecutionRequest())); |
| 74 | + assertThrows( |
| 75 | + UnsupportedOperationException.class, |
| 76 | + () -> service.DescribeTaskList(new DescribeTaskListRequest())); |
| 77 | + assertThrows(UnsupportedOperationException.class, () -> service.GetClusterInfo()); |
| 78 | + assertThrows( |
| 79 | + UnsupportedOperationException.class, |
| 80 | + () -> service.ResetStickyTaskList(new ResetStickyTaskListRequest())); |
| 81 | + assertThrows( |
| 82 | + UnsupportedOperationException.class, |
| 83 | + () -> service.ListTaskListPartitions(new ListTaskListPartitionsRequest())); |
| 84 | + assertThrows( |
| 85 | + UnsupportedOperationException.class, |
| 86 | + () -> service.RefreshWorkflowTasks(new RefreshWorkflowTasksRequest())); |
| 87 | + |
| 88 | + assertThrows( |
| 89 | + UnsupportedOperationException.class, |
| 90 | + () -> service.RegisterDomain(new RegisterDomainRequest(), null)); |
| 91 | + assertThrows( |
| 92 | + UnsupportedOperationException.class, |
| 93 | + () -> service.DescribeDomain(new DescribeDomainRequest(), null)); |
| 94 | + assertThrows( |
| 95 | + UnsupportedOperationException.class, |
| 96 | + () -> service.ListDomains(new ListDomainsRequest(), null)); |
| 97 | + assertThrows( |
| 98 | + UnsupportedOperationException.class, |
| 99 | + () -> service.UpdateDomain(new UpdateDomainRequest(), null)); |
| 100 | + assertThrows( |
| 101 | + UnsupportedOperationException.class, |
| 102 | + () -> service.DeprecateDomain(new DeprecateDomainRequest(), null)); |
| 103 | + assertThrows( |
| 104 | + UnsupportedOperationException.class, |
| 105 | + () -> service.RestartWorkflowExecution(new RestartWorkflowExecutionRequest(), null)); |
| 106 | + assertThrows( |
| 107 | + UnsupportedOperationException.class, |
| 108 | + () -> service.GetTaskListsByDomain(new GetTaskListsByDomainRequest(), null)); |
| 109 | + assertThrows( |
| 110 | + UnsupportedOperationException.class, |
| 111 | + () -> service.TerminateWorkflowExecution(new TerminateWorkflowExecutionRequest(), null)); |
| 112 | + assertThrows( |
| 113 | + UnsupportedOperationException.class, |
| 114 | + () -> service.ListWorkflowExecutions(new ListWorkflowExecutionsRequest(), null)); |
| 115 | + assertThrows( |
| 116 | + UnsupportedOperationException.class, |
| 117 | + () -> |
| 118 | + service.ListArchivedWorkflowExecutions( |
| 119 | + new ListArchivedWorkflowExecutionsRequest(), null)); |
| 120 | + assertThrows( |
| 121 | + UnsupportedOperationException.class, |
| 122 | + () -> service.ScanWorkflowExecutions(new ListWorkflowExecutionsRequest(), null)); |
| 123 | + assertThrows( |
| 124 | + UnsupportedOperationException.class, |
| 125 | + () -> service.CountWorkflowExecutions(new CountWorkflowExecutionsRequest(), null)); |
| 126 | + assertThrows(UnsupportedOperationException.class, () -> service.GetSearchAttributes(null)); |
| 127 | + assertThrows( |
| 128 | + UnsupportedOperationException.class, |
| 129 | + () -> service.ResetStickyTaskList(new ResetStickyTaskListRequest(), null)); |
| 130 | + assertThrows( |
| 131 | + UnsupportedOperationException.class, |
| 132 | + () -> service.DescribeWorkflowExecution(new DescribeWorkflowExecutionRequest(), null)); |
| 133 | + assertThrows( |
| 134 | + UnsupportedOperationException.class, |
| 135 | + () -> service.DescribeTaskList(new DescribeTaskListRequest(), null)); |
| 136 | + assertThrows(UnsupportedOperationException.class, () -> service.GetClusterInfo(null)); |
| 137 | + assertThrows( |
| 138 | + UnsupportedOperationException.class, |
| 139 | + () -> service.ResetStickyTaskList(new ResetStickyTaskListRequest(), null)); |
| 140 | + assertThrows( |
| 141 | + UnsupportedOperationException.class, |
| 142 | + () -> service.ListTaskListPartitions(new ListTaskListPartitionsRequest(), null)); |
| 143 | + assertThrows( |
| 144 | + UnsupportedOperationException.class, |
| 145 | + () -> service.RefreshWorkflowTasks(new RefreshWorkflowTasksRequest(), null)); |
| 146 | + } |
| 147 | +} |
0 commit comments