Skip to content

Commit ca5360f

Browse files
committed
Add unimplemented DiagnoseWorkflowExecution methods
1 parent d1a2f43 commit ca5360f

File tree

11 files changed

+215
-1
lines changed

11 files changed

+215
-1
lines changed

src/main/java/com/uber/cadence/internal/compatibility/Thrift2ProtoAdapter.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
import com.uber.cadence.DescribeTaskListResponse;
3232
import com.uber.cadence.DescribeWorkflowExecutionRequest;
3333
import com.uber.cadence.DescribeWorkflowExecutionResponse;
34+
import com.uber.cadence.DiagnoseWorkflowExecutionRequest;
35+
import com.uber.cadence.DiagnoseWorkflowExecutionResponse;
3436
import com.uber.cadence.DomainAlreadyExistsError;
3537
import com.uber.cadence.DomainNotActiveError;
3638
import com.uber.cadence.EntityNotExistsError;
@@ -156,6 +158,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque
156158
}
157159
}
158160

161+
@Override
162+
public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution(
163+
DiagnoseWorkflowExecutionRequest diagnoseRequest)
164+
throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError,
165+
ClientVersionNotSupportedError, TException {
166+
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
167+
}
168+
159169
@Override
160170
public ListDomainsResponse ListDomains(ListDomainsRequest listRequest)
161171
throws BadRequestError, EntityNotExistsError, ServiceBusyError,
@@ -829,6 +839,13 @@ public void DescribeDomain(
829839
throw new UnsupportedOperationException("not implemented");
830840
}
831841

842+
@Override
843+
public void DiagnoseWorkflowExecution(
844+
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
845+
throws TException {
846+
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
847+
}
848+
832849
@Override
833850
public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler)
834851
throws TException {

src/main/java/com/uber/cadence/internal/sync/TestActivityEnvironmentInternal.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,13 @@ public void DescribeDomain(
593593
impl.DescribeDomain(describeRequest, resultHandler);
594594
}
595595

596+
@Override
597+
public void DiagnoseWorkflowExecution(
598+
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
599+
throws TException {
600+
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
601+
}
602+
596603
@Override
597604
public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler)
598605
throws TException {
@@ -921,6 +928,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque
921928
return impl.DescribeDomain(describeRequest);
922929
}
923930

931+
@Override
932+
public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution(
933+
DiagnoseWorkflowExecutionRequest diagnoseRequest)
934+
throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError,
935+
ClientVersionNotSupportedError, TException {
936+
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
937+
}
938+
924939
@Override
925940
public ListDomainsResponse ListDomains(ListDomainsRequest listRequest)
926941
throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError,

src/main/java/com/uber/cadence/internal/sync/TestWorkflowEnvironmentInternal.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
import com.uber.cadence.DescribeTaskListResponse;
3030
import com.uber.cadence.DescribeWorkflowExecutionRequest;
3131
import com.uber.cadence.DescribeWorkflowExecutionResponse;
32+
import com.uber.cadence.DiagnoseWorkflowExecutionRequest;
33+
import com.uber.cadence.DiagnoseWorkflowExecutionResponse;
3234
import com.uber.cadence.DomainAlreadyExistsError;
3335
import com.uber.cadence.DomainNotActiveError;
3436
import com.uber.cadence.EntityNotExistsError;
@@ -475,6 +477,13 @@ public void DescribeDomain(
475477
impl.DescribeDomain(describeRequest, resultHandler);
476478
}
477479

480+
@Override
481+
public void DiagnoseWorkflowExecution(
482+
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
483+
throws TException {
484+
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
485+
}
486+
478487
@Override
479488
public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler)
480489
throws TException {
@@ -809,6 +818,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque
809818
return impl.DescribeDomain(describeRequest);
810819
}
811820

821+
@Override
822+
public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution(
823+
DiagnoseWorkflowExecutionRequest diagnoseRequest)
824+
throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError,
825+
ClientVersionNotSupportedError, TException {
826+
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
827+
}
828+
812829
@Override
813830
public ListDomainsResponse ListDomains(ListDomainsRequest listRequest)
814831
throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError,

src/main/java/com/uber/cadence/internal/testservice/TestWorkflowService.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
import com.uber.cadence.DescribeTaskListResponse;
3030
import com.uber.cadence.DescribeWorkflowExecutionRequest;
3131
import com.uber.cadence.DescribeWorkflowExecutionResponse;
32+
import com.uber.cadence.DiagnoseWorkflowExecutionRequest;
33+
import com.uber.cadence.DiagnoseWorkflowExecutionResponse;
3234
import com.uber.cadence.DomainAlreadyExistsError;
3335
import com.uber.cadence.DomainNotActiveError;
3436
import com.uber.cadence.EntityNotExistsError;
@@ -206,6 +208,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque
206208
throw new UnsupportedOperationException("not implemented");
207209
}
208210

211+
@Override
212+
public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution(
213+
DiagnoseWorkflowExecutionRequest diagnoseRequest)
214+
throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError,
215+
ClientVersionNotSupportedError, TException {
216+
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
217+
}
218+
209219
@Override
210220
public ListDomainsResponse ListDomains(ListDomainsRequest listRequest)
211221
throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError,
@@ -834,6 +844,13 @@ public void DescribeDomain(
834844
throw new UnsupportedOperationException("not implemented");
835845
}
836846

847+
@Override
848+
public void DiagnoseWorkflowExecution(
849+
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
850+
throws TException {
851+
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
852+
}
853+
837854
@Override
838855
public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler)
839856
throws TException {

src/main/java/com/uber/cadence/serviceclient/IWorkflowServiceBase.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque
4343
throw new UnsupportedOperationException("unimplemented");
4444
}
4545

46+
@Override
47+
public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution(
48+
DiagnoseWorkflowExecutionRequest diagnoseRequest)
49+
throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError,
50+
ClientVersionNotSupportedError, TException {
51+
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
52+
}
53+
4654
@Override
4755
public ListDomainsResponse ListDomains(ListDomainsRequest listRequest)
4856
throws BadRequestError, EntityNotExistsError, ServiceBusyError,
@@ -377,6 +385,13 @@ public void DescribeDomain(
377385
throw new UnsupportedOperationException("unimplemented");
378386
}
379387

388+
@Override
389+
public void DiagnoseWorkflowExecution(
390+
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
391+
throws TException {
392+
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
393+
}
394+
380395
@Override
381396
public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler)
382397
throws TException {

src/main/java/com/uber/cadence/serviceclient/WorkflowServiceTChannel.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,14 @@ private DescribeDomainResponse describeDomain(DescribeDomainRequest describeRequ
443443
}
444444
}
445445

446+
@Override
447+
public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution(
448+
DiagnoseWorkflowExecutionRequest diagnoseRequest)
449+
throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError,
450+
ClientVersionNotSupportedError, TException {
451+
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
452+
}
453+
446454
@Override
447455
public ListDomainsResponse ListDomains(ListDomainsRequest listRequest)
448456
throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError,
@@ -2937,6 +2945,13 @@ public void DescribeDomain(
29372945
throw new UnsupportedOperationException("not implemented");
29382946
}
29392947

2948+
@Override
2949+
public void DiagnoseWorkflowExecution(
2950+
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
2951+
throws TException {
2952+
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
2953+
}
2954+
29402955
@Override
29412956
public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler)
29422957
throws TException {

src/test/java/com/uber/cadence/internal/compatibility/Thrift2ProtoAdapterTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,9 +786,11 @@ public void testIsHealthy() throws Exception {
786786
@Test
787787
public void testAsyncUnsupported() {
788788
assertUnsupported(WorkflowService.Iface::RestartWorkflowExecution);
789+
assertUnsupported(WorkflowService.Iface::DiagnoseWorkflowExecution);
789790
assertUnsupported(WorkflowService.Iface::GetTaskListsByDomain);
790791
assertAsyncUnsupported(WorkflowService.AsyncIface::RegisterDomain);
791792
assertAsyncUnsupported(WorkflowService.AsyncIface::DescribeDomain);
793+
assertAsyncUnsupported(WorkflowService.AsyncIface::DiagnoseWorkflowExecution);
792794
assertAsyncUnsupported(WorkflowService.AsyncIface::ListDomains);
793795
assertAsyncUnsupported(WorkflowService.AsyncIface::UpdateDomain);
794796
assertAsyncUnsupported(WorkflowService.AsyncIface::DeprecateDomain);
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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.internal.testservice;
16+
17+
import static org.junit.Assert.assertThrows;
18+
19+
import com.uber.cadence.DiagnoseWorkflowExecutionRequest;
20+
import org.apache.thrift.async.AsyncMethodCallback;
21+
import org.junit.Test;
22+
23+
public class TestWorkflowServiceDiagnoseTest {
24+
25+
private final TestWorkflowService service = new TestWorkflowService();
26+
27+
@Test
28+
public void testDiagnoseWorkflowExecutionThrowsUnsupportedOperation() {
29+
DiagnoseWorkflowExecutionRequest request = new DiagnoseWorkflowExecutionRequest();
30+
assertThrows(
31+
UnsupportedOperationException.class, () -> service.DiagnoseWorkflowExecution(request));
32+
}
33+
34+
@Test
35+
public void testDiagnoseWorkflowExecutionAsyncThrowsUnsupportedOperation() {
36+
DiagnoseWorkflowExecutionRequest request = new DiagnoseWorkflowExecutionRequest();
37+
AsyncMethodCallback callback =
38+
new AsyncMethodCallback() {
39+
@Override
40+
public void onComplete(Object response) {}
41+
42+
@Override
43+
public void onError(Exception exception) {}
44+
};
45+
46+
assertThrows(
47+
UnsupportedOperationException.class,
48+
() -> service.DiagnoseWorkflowExecution(request, callback));
49+
}
50+
}

src/test/java/com/uber/cadence/serviceclient/IWorkflowServiceBaseTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ public void testDescribeDomain() {
3636
assertThrows(UnsupportedOperationException.class, () -> service.DescribeDomain(null, null));
3737
}
3838

39+
public void testDiagnoseWorkflowExecution() {
40+
assertThrows(
41+
UnsupportedOperationException.class, () -> service.DiagnoseWorkflowExecution(null));
42+
assertThrows(
43+
UnsupportedOperationException.class, () -> service.DiagnoseWorkflowExecution(null, null));
44+
}
45+
3946
public void testListDomains() {
4047
assertThrows(UnsupportedOperationException.class, () -> service.ListDomains(null));
4148
assertThrows(UnsupportedOperationException.class, () -> service.ListDomains(null, null));

0 commit comments

Comments
 (0)