• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

uber / cadence-java-client / 2622

06 Nov 2024 10:24PM UTC coverage: 76.159% (-3.0%) from 79.182%
2622

Pull #948

buildkite

shijiesheng
fix format
Pull Request #948: fix bug in QueryWorkflowParameters.toString

2 of 2 new or added lines in 1 file covered. (100.0%)

617 existing lines in 8 files now uncovered.

14755 of 19374 relevant lines covered (76.16%)

0.76 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

30.43
/src/main/java/com/uber/cadence/internal/compatibility/thrift/ResponseMapper.java
1
/*
2
 *  Modifications Copyright (c) 2017-2021 Uber Technologies Inc.
3
 *  Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
 *
5
 *  Licensed under the Apache License, Version 2.0 (the "License"). You may not
6
 *  use this file except in compliance with the License. A copy of the License is
7
 *  located at
8
 *
9
 *  http://aws.amazon.com/apache2.0
10
 *
11
 *  or in the "license" file accompanying this file. This file is distributed on
12
 *  an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13
 *  express or implied. See the License for the specific language governing
14
 *  permissions and limitations under the License.
15
 */
16
package com.uber.cadence.internal.compatibility.thrift;
17

18
import static com.uber.cadence.internal.compatibility.thrift.EnumMapper.archivalStatus;
19
import static com.uber.cadence.internal.compatibility.thrift.EnumMapper.domainStatus;
20
import static com.uber.cadence.internal.compatibility.thrift.Helpers.byteStringToArray;
21
import static com.uber.cadence.internal.compatibility.thrift.Helpers.durationToDays;
22
import static com.uber.cadence.internal.compatibility.thrift.Helpers.durationToSeconds;
23
import static com.uber.cadence.internal.compatibility.thrift.Helpers.timeToUnixNano;
24
import static com.uber.cadence.internal.compatibility.thrift.Helpers.toInt64Value;
25
import static com.uber.cadence.internal.compatibility.thrift.HistoryMapper.history;
26
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.activityLocalDispatchInfoMap;
27
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.activityType;
28
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.badBinaries;
29
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.clusterReplicationConfigurationArray;
30
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.dataBlobArray;
31
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.describeDomainResponseArray;
32
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.header;
33
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.indexedValueTypeMap;
34
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.payload;
35
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.pendingActivityInfoArray;
36
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.pendingChildExecutionInfoArray;
37
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.pendingDecisionInfo;
38
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.pollerInfoArray;
39
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.queryRejected;
40
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.supportedClientVersions;
41
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.taskList;
42
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.taskListPartitionMetadataArray;
43
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.taskListStatus;
44
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.workflowExecution;
45
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.workflowExecutionConfiguration;
46
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.workflowExecutionInfo;
47
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.workflowExecutionInfoArray;
48
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.workflowQuery;
49
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.workflowQueryMap;
50
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.workflowType;
51

52
import com.uber.cadence.ClusterInfo;
53
import com.uber.cadence.CountWorkflowExecutionsResponse;
54
import com.uber.cadence.DescribeDomainResponse;
55
import com.uber.cadence.DescribeTaskListResponse;
56
import com.uber.cadence.DescribeWorkflowExecutionResponse;
57
import com.uber.cadence.DomainConfiguration;
58
import com.uber.cadence.DomainInfo;
59
import com.uber.cadence.DomainReplicationConfiguration;
60
import com.uber.cadence.GetSearchAttributesResponse;
61
import com.uber.cadence.GetWorkflowExecutionHistoryResponse;
62
import com.uber.cadence.ListArchivedWorkflowExecutionsResponse;
63
import com.uber.cadence.ListClosedWorkflowExecutionsResponse;
64
import com.uber.cadence.ListDomainsResponse;
65
import com.uber.cadence.ListOpenWorkflowExecutionsResponse;
66
import com.uber.cadence.ListTaskListPartitionsResponse;
67
import com.uber.cadence.ListWorkflowExecutionsResponse;
68
import com.uber.cadence.PollForActivityTaskResponse;
69
import com.uber.cadence.PollForDecisionTaskResponse;
70
import com.uber.cadence.QueryWorkflowResponse;
71
import com.uber.cadence.RecordActivityTaskHeartbeatResponse;
72
import com.uber.cadence.ResetWorkflowExecutionResponse;
73
import com.uber.cadence.RespondDecisionTaskCompletedResponse;
74
import com.uber.cadence.SignalWithStartWorkflowExecutionAsyncResponse;
75
import com.uber.cadence.StartWorkflowExecutionAsyncResponse;
76
import com.uber.cadence.StartWorkflowExecutionResponse;
77
import com.uber.cadence.UpdateDomainResponse;
78
import com.uber.cadence.api.v1.WorkflowQuery;
79

80
public class ResponseMapper {
×
81

82
  public static StartWorkflowExecutionResponse startWorkflowExecutionResponse(
83
      com.uber.cadence.api.v1.StartWorkflowExecutionResponse t) {
84
    if (t == null) {
1✔
UNCOV
85
      return null;
×
86
    }
87
    StartWorkflowExecutionResponse startWorkflowExecutionResponse =
1✔
88
        new StartWorkflowExecutionResponse();
89
    startWorkflowExecutionResponse.setRunId(t.getRunId());
1✔
90
    return startWorkflowExecutionResponse;
1✔
91
  }
92

93
  public static StartWorkflowExecutionAsyncResponse startWorkflowExecutionAsyncResponse(
94
      com.uber.cadence.api.v1.StartWorkflowExecutionAsyncResponse t) {
95
    return t == null ? null : new StartWorkflowExecutionAsyncResponse();
1✔
96
  }
97

98
  public static DescribeTaskListResponse describeTaskListResponse(
99
      com.uber.cadence.api.v1.DescribeTaskListResponse t) {
UNCOV
100
    if (t == null) {
×
UNCOV
101
      return null;
×
102
    }
UNCOV
103
    DescribeTaskListResponse describeTaskListResponse = new DescribeTaskListResponse();
×
UNCOV
104
    describeTaskListResponse.setPollers(pollerInfoArray(t.getPollersList()));
×
UNCOV
105
    describeTaskListResponse.setTaskListStatus(taskListStatus(t.getTaskListStatus()));
×
UNCOV
106
    return describeTaskListResponse;
×
107
  }
108

109
  public static DescribeWorkflowExecutionResponse describeWorkflowExecutionResponse(
110
      com.uber.cadence.api.v1.DescribeWorkflowExecutionResponse t) {
UNCOV
111
    if (t == null) {
×
UNCOV
112
      return null;
×
113
    }
UNCOV
114
    DescribeWorkflowExecutionResponse describeWorkflowExecutionResponse =
×
115
        new DescribeWorkflowExecutionResponse();
UNCOV
116
    describeWorkflowExecutionResponse.setExecutionConfiguration(
×
UNCOV
117
        workflowExecutionConfiguration(t.getExecutionConfiguration()));
×
UNCOV
118
    describeWorkflowExecutionResponse.setWorkflowExecutionInfo(
×
UNCOV
119
        workflowExecutionInfo(t.getWorkflowExecutionInfo()));
×
UNCOV
120
    describeWorkflowExecutionResponse.setPendingActivities(
×
UNCOV
121
        pendingActivityInfoArray(t.getPendingActivitiesList()));
×
UNCOV
122
    describeWorkflowExecutionResponse.setPendingChildren(
×
UNCOV
123
        pendingChildExecutionInfoArray(t.getPendingChildrenList()));
×
UNCOV
124
    describeWorkflowExecutionResponse.setPendingDecision(
×
UNCOV
125
        pendingDecisionInfo(t.getPendingDecision()));
×
UNCOV
126
    return describeWorkflowExecutionResponse;
×
127
  }
128

129
  public static ClusterInfo getClusterInfoResponse(
130
      com.uber.cadence.api.v1.GetClusterInfoResponse t) {
UNCOV
131
    if (t == null) {
×
UNCOV
132
      return null;
×
133
    }
UNCOV
134
    ClusterInfo clusterInfo = new ClusterInfo();
×
UNCOV
135
    clusterInfo.setSupportedClientVersions(supportedClientVersions(t.getSupportedClientVersions()));
×
UNCOV
136
    return clusterInfo;
×
137
  }
138

139
  public static GetSearchAttributesResponse getSearchAttributesResponse(
140
      com.uber.cadence.api.v1.GetSearchAttributesResponse t) {
UNCOV
141
    if (t == null) {
×
UNCOV
142
      return null;
×
143
    }
UNCOV
144
    GetSearchAttributesResponse getSearchAttributesResponse = new GetSearchAttributesResponse();
×
UNCOV
145
    getSearchAttributesResponse.setKeys(indexedValueTypeMap(t.getKeysMap()));
×
UNCOV
146
    return getSearchAttributesResponse;
×
147
  }
148

149
  public static GetWorkflowExecutionHistoryResponse getWorkflowExecutionHistoryResponse(
150
      com.uber.cadence.api.v1.GetWorkflowExecutionHistoryResponse t) {
UNCOV
151
    if (t == null) {
×
UNCOV
152
      return null;
×
153
    }
UNCOV
154
    GetWorkflowExecutionHistoryResponse getWorkflowExecutionHistoryResponse =
×
155
        new GetWorkflowExecutionHistoryResponse();
UNCOV
156
    getWorkflowExecutionHistoryResponse.setHistory(history(t.getHistory()));
×
UNCOV
157
    getWorkflowExecutionHistoryResponse.setRawHistory(dataBlobArray(t.getRawHistoryList()));
×
UNCOV
158
    getWorkflowExecutionHistoryResponse.setNextPageToken(byteStringToArray(t.getNextPageToken()));
×
UNCOV
159
    getWorkflowExecutionHistoryResponse.setArchived(t.getArchived());
×
UNCOV
160
    return getWorkflowExecutionHistoryResponse;
×
161
  }
162

163
  public static ListArchivedWorkflowExecutionsResponse listArchivedWorkflowExecutionsResponse(
164
      com.uber.cadence.api.v1.ListArchivedWorkflowExecutionsResponse t) {
UNCOV
165
    if (t == null) {
×
UNCOV
166
      return null;
×
167
    }
UNCOV
168
    ListArchivedWorkflowExecutionsResponse res = new ListArchivedWorkflowExecutionsResponse();
×
UNCOV
169
    res.setExecutions(workflowExecutionInfoArray(t.getExecutionsList()));
×
UNCOV
170
    res.setNextPageToken(byteStringToArray(t.getNextPageToken()));
×
UNCOV
171
    return res;
×
172
  }
173

174
  public static ListClosedWorkflowExecutionsResponse listClosedWorkflowExecutionsResponse(
175
      com.uber.cadence.api.v1.ListClosedWorkflowExecutionsResponse t) {
UNCOV
176
    if (t == null) {
×
UNCOV
177
      return null;
×
178
    }
UNCOV
179
    ListClosedWorkflowExecutionsResponse res = new ListClosedWorkflowExecutionsResponse();
×
UNCOV
180
    res.setExecutions(workflowExecutionInfoArray(t.getExecutionsList()));
×
UNCOV
181
    res.setNextPageToken(byteStringToArray(t.getNextPageToken()));
×
UNCOV
182
    return res;
×
183
  }
184

185
  public static ListOpenWorkflowExecutionsResponse listOpenWorkflowExecutionsResponse(
186
      com.uber.cadence.api.v1.ListOpenWorkflowExecutionsResponse t) {
UNCOV
187
    if (t == null) {
×
UNCOV
188
      return null;
×
189
    }
UNCOV
190
    ListOpenWorkflowExecutionsResponse res = new ListOpenWorkflowExecutionsResponse();
×
UNCOV
191
    res.setExecutions(workflowExecutionInfoArray(t.getExecutionsList()));
×
UNCOV
192
    res.setNextPageToken(byteStringToArray(t.getNextPageToken()));
×
UNCOV
193
    return res;
×
194
  }
195

196
  public static ListTaskListPartitionsResponse listTaskListPartitionsResponse(
197
      com.uber.cadence.api.v1.ListTaskListPartitionsResponse t) {
UNCOV
198
    if (t == null) {
×
UNCOV
199
      return null;
×
200
    }
UNCOV
201
    ListTaskListPartitionsResponse res = new ListTaskListPartitionsResponse();
×
UNCOV
202
    res.setActivityTaskListPartitions(
×
UNCOV
203
        taskListPartitionMetadataArray(t.getActivityTaskListPartitionsList()));
×
UNCOV
204
    res.setDecisionTaskListPartitions(
×
UNCOV
205
        taskListPartitionMetadataArray(t.getDecisionTaskListPartitionsList()));
×
UNCOV
206
    return res;
×
207
  }
208

209
  public static ListWorkflowExecutionsResponse listWorkflowExecutionsResponse(
210
      com.uber.cadence.api.v1.ListWorkflowExecutionsResponse t) {
UNCOV
211
    if (t == null) {
×
UNCOV
212
      return null;
×
213
    }
UNCOV
214
    ListWorkflowExecutionsResponse res = new ListWorkflowExecutionsResponse();
×
UNCOV
215
    res.setExecutions(workflowExecutionInfoArray(t.getExecutionsList()));
×
UNCOV
216
    res.setNextPageToken(byteStringToArray(t.getNextPageToken()));
×
UNCOV
217
    return res;
×
218
  }
219

220
  public static PollForActivityTaskResponse pollForActivityTaskResponse(
221
      com.uber.cadence.api.v1.PollForActivityTaskResponse t) {
UNCOV
222
    if (t == null) {
×
UNCOV
223
      return null;
×
224
    }
UNCOV
225
    PollForActivityTaskResponse res = new PollForActivityTaskResponse();
×
UNCOV
226
    res.setTaskToken(byteStringToArray(t.getTaskToken()));
×
UNCOV
227
    res.setWorkflowExecution(workflowExecution(t.getWorkflowExecution()));
×
UNCOV
228
    res.setActivityId(t.getActivityId());
×
UNCOV
229
    res.setActivityType(activityType(t.getActivityType()));
×
UNCOV
230
    res.setInput(payload(t.getInput()));
×
UNCOV
231
    res.setScheduledTimestamp(timeToUnixNano(t.getScheduledTime()));
×
UNCOV
232
    res.setStartedTimestamp(timeToUnixNano(t.getStartedTime()));
×
UNCOV
233
    res.setScheduleToCloseTimeoutSeconds(durationToSeconds(t.getScheduleToCloseTimeout()));
×
UNCOV
234
    res.setStartToCloseTimeoutSeconds(durationToSeconds(t.getStartToCloseTimeout()));
×
UNCOV
235
    res.setHeartbeatTimeoutSeconds(durationToSeconds(t.getHeartbeatTimeout()));
×
UNCOV
236
    res.setAttempt(t.getAttempt());
×
UNCOV
237
    res.setScheduledTimestampOfThisAttempt(timeToUnixNano(t.getScheduledTimeOfThisAttempt()));
×
UNCOV
238
    res.setHeartbeatDetails(payload(t.getHeartbeatDetails()));
×
UNCOV
239
    res.setWorkflowType(workflowType(t.getWorkflowType()));
×
UNCOV
240
    res.setWorkflowDomain(t.getWorkflowDomain());
×
UNCOV
241
    res.setHeader(header(t.getHeader()));
×
UNCOV
242
    return res;
×
243
  }
244

245
  public static PollForDecisionTaskResponse pollForDecisionTaskResponse(
246
      com.uber.cadence.api.v1.PollForDecisionTaskResponse t) {
UNCOV
247
    if (t == null) {
×
UNCOV
248
      return null;
×
249
    }
UNCOV
250
    PollForDecisionTaskResponse res = new PollForDecisionTaskResponse();
×
UNCOV
251
    res.setTaskToken(byteStringToArray(t.getTaskToken()));
×
UNCOV
252
    res.setWorkflowExecution(workflowExecution(t.getWorkflowExecution()));
×
UNCOV
253
    res.setWorkflowType(workflowType(t.getWorkflowType()));
×
UNCOV
254
    res.setPreviousStartedEventId(toInt64Value(t.getPreviousStartedEventId()));
×
UNCOV
255
    res.setStartedEventId(t.getStartedEventId());
×
UNCOV
256
    res.setAttempt(t.getAttempt());
×
UNCOV
257
    res.setBacklogCountHint(t.getBacklogCountHint());
×
UNCOV
258
    res.setHistory(history(t.getHistory()));
×
UNCOV
259
    res.setNextPageToken(byteStringToArray(t.getNextPageToken()));
×
UNCOV
260
    if (t.getQuery() != WorkflowQuery.getDefaultInstance()) {
×
UNCOV
261
      res.setQuery(workflowQuery(t.getQuery()));
×
262
    }
UNCOV
263
    res.setWorkflowExecutionTaskList(taskList(t.getWorkflowExecutionTaskList()));
×
UNCOV
264
    res.setScheduledTimestamp(timeToUnixNano(t.getScheduledTime()));
×
UNCOV
265
    res.setStartedTimestamp(timeToUnixNano(t.getStartedTime()));
×
UNCOV
266
    res.setQueries(workflowQueryMap(t.getQueriesMap()));
×
UNCOV
267
    res.setNextEventId(t.getNextEventId());
×
UNCOV
268
    return res;
×
269
  }
270

271
  public static QueryWorkflowResponse queryWorkflowResponse(
272
      com.uber.cadence.api.v1.QueryWorkflowResponse t) {
UNCOV
273
    if (t == null) {
×
UNCOV
274
      return null;
×
275
    }
UNCOV
276
    QueryWorkflowResponse res = new QueryWorkflowResponse();
×
UNCOV
277
    res.setQueryResult(payload(t.getQueryResult()));
×
UNCOV
278
    res.setQueryRejected(queryRejected(t.getQueryRejected()));
×
UNCOV
279
    return res;
×
280
  }
281

282
  public static RecordActivityTaskHeartbeatResponse recordActivityTaskHeartbeatByIdResponse(
283
      com.uber.cadence.api.v1.RecordActivityTaskHeartbeatByIDResponse t) {
UNCOV
284
    if (t == null) {
×
UNCOV
285
      return null;
×
286
    }
UNCOV
287
    RecordActivityTaskHeartbeatResponse res = new RecordActivityTaskHeartbeatResponse();
×
UNCOV
288
    res.setCancelRequested(t.getCancelRequested());
×
UNCOV
289
    return res;
×
290
  }
291

292
  public static RecordActivityTaskHeartbeatResponse recordActivityTaskHeartbeatResponse(
293
      com.uber.cadence.api.v1.RecordActivityTaskHeartbeatResponse t) {
UNCOV
294
    if (t == null) {
×
UNCOV
295
      return null;
×
296
    }
UNCOV
297
    RecordActivityTaskHeartbeatResponse res = new RecordActivityTaskHeartbeatResponse();
×
UNCOV
298
    res.setCancelRequested(t.getCancelRequested());
×
UNCOV
299
    return res;
×
300
  }
301

302
  public static ResetWorkflowExecutionResponse resetWorkflowExecutionResponse(
303
      com.uber.cadence.api.v1.ResetWorkflowExecutionResponse t) {
UNCOV
304
    if (t == null) {
×
UNCOV
305
      return null;
×
306
    }
UNCOV
307
    ResetWorkflowExecutionResponse res = new ResetWorkflowExecutionResponse();
×
UNCOV
308
    res.setRunId(t.getRunId());
×
UNCOV
309
    return res;
×
310
  }
311

312
  public static RespondDecisionTaskCompletedResponse respondDecisionTaskCompletedResponse(
313
      com.uber.cadence.api.v1.RespondDecisionTaskCompletedResponse t) {
UNCOV
314
    if (t == null) {
×
UNCOV
315
      return null;
×
316
    }
UNCOV
317
    RespondDecisionTaskCompletedResponse res = new RespondDecisionTaskCompletedResponse();
×
UNCOV
318
    res.setDecisionTask(pollForDecisionTaskResponse(t.getDecisionTask()));
×
UNCOV
319
    res.setActivitiesToDispatchLocally(
×
UNCOV
320
        activityLocalDispatchInfoMap(t.getActivitiesToDispatchLocallyMap()));
×
UNCOV
321
    return res;
×
322
  }
323

324
  public static ListWorkflowExecutionsResponse scanWorkflowExecutionsResponse(
325
      com.uber.cadence.api.v1.ScanWorkflowExecutionsResponse t) {
UNCOV
326
    if (t == null) {
×
UNCOV
327
      return null;
×
328
    }
UNCOV
329
    ListWorkflowExecutionsResponse res = new ListWorkflowExecutionsResponse();
×
UNCOV
330
    res.setExecutions(workflowExecutionInfoArray(t.getExecutionsList()));
×
UNCOV
331
    res.setNextPageToken(byteStringToArray(t.getNextPageToken()));
×
UNCOV
332
    return res;
×
333
  }
334

335
  public static CountWorkflowExecutionsResponse countWorkflowExecutionsResponse(
336
      com.uber.cadence.api.v1.CountWorkflowExecutionsResponse t) {
UNCOV
337
    if (t == null) {
×
UNCOV
338
      return null;
×
339
    }
UNCOV
340
    CountWorkflowExecutionsResponse res = new CountWorkflowExecutionsResponse();
×
UNCOV
341
    res.setCount(t.getCount());
×
UNCOV
342
    return res;
×
343
  }
344

345
  public static DescribeDomainResponse describeDomainResponse(
346
      com.uber.cadence.api.v1.DescribeDomainResponse t) {
347
    if (t == null) {
1✔
UNCOV
348
      return null;
×
349
    }
350
    DescribeDomainResponse response = new DescribeDomainResponse();
1✔
351
    DomainInfo domainInfo = new DomainInfo();
1✔
352
    response.setDomainInfo(domainInfo);
1✔
353

354
    domainInfo.setName(t.getDomain().getName());
1✔
355
    domainInfo.setStatus(domainStatus(t.getDomain().getStatus()));
1✔
356
    domainInfo.setDescription(t.getDomain().getDescription());
1✔
357
    domainInfo.setOwnerEmail(t.getDomain().getOwnerEmail());
1✔
358
    domainInfo.setData(t.getDomain().getDataMap());
1✔
359
    domainInfo.setUuid(t.getDomain().getId());
1✔
360

361
    DomainConfiguration domainConfiguration = new DomainConfiguration();
1✔
362
    response.setConfiguration(domainConfiguration);
1✔
363

364
    domainConfiguration.setWorkflowExecutionRetentionPeriodInDays(
1✔
365
        durationToDays(t.getDomain().getWorkflowExecutionRetentionPeriod()));
1✔
366
    domainConfiguration.setEmitMetric(true);
1✔
367
    domainConfiguration.setBadBinaries(badBinaries(t.getDomain().getBadBinaries()));
1✔
368
    domainConfiguration.setHistoryArchivalStatus(
1✔
369
        archivalStatus(t.getDomain().getHistoryArchivalStatus()));
1✔
370
    domainConfiguration.setHistoryArchivalURI(t.getDomain().getHistoryArchivalUri());
1✔
371
    domainConfiguration.setVisibilityArchivalStatus(
1✔
372
        archivalStatus(t.getDomain().getVisibilityArchivalStatus()));
1✔
373
    domainConfiguration.setVisibilityArchivalURI(t.getDomain().getVisibilityArchivalUri());
1✔
374

375
    DomainReplicationConfiguration replicationConfiguration = new DomainReplicationConfiguration();
1✔
376
    response.setReplicationConfiguration(replicationConfiguration);
1✔
377

378
    replicationConfiguration.setActiveClusterName(t.getDomain().getActiveClusterName());
1✔
379
    replicationConfiguration.setClusters(
1✔
380
        clusterReplicationConfigurationArray(t.getDomain().getClustersList()));
1✔
381

382
    response.setFailoverVersion(t.getDomain().getFailoverVersion());
1✔
383
    response.setIsGlobalDomain(t.getDomain().getIsGlobalDomain());
1✔
384
    return response;
1✔
385
  }
386

387
  public static ListDomainsResponse listDomainsResponse(
388
      com.uber.cadence.api.v1.ListDomainsResponse t) {
UNCOV
389
    if (t == null) {
×
UNCOV
390
      return null;
×
391
    }
UNCOV
392
    ListDomainsResponse res = new ListDomainsResponse();
×
UNCOV
393
    res.setDomains(describeDomainResponseArray(t.getDomainsList()));
×
UNCOV
394
    res.setNextPageToken(byteStringToArray(t.getNextPageToken()));
×
UNCOV
395
    return res;
×
396
  }
397

398
  public static StartWorkflowExecutionResponse signalWithStartWorkflowExecutionResponse(
399
      com.uber.cadence.api.v1.SignalWithStartWorkflowExecutionResponse t) {
400
    if (t == null) {
1✔
UNCOV
401
      return null;
×
402
    }
403
    StartWorkflowExecutionResponse startWorkflowExecutionResponse =
1✔
404
        new StartWorkflowExecutionResponse();
405
    startWorkflowExecutionResponse.setRunId(t.getRunId());
1✔
406
    return startWorkflowExecutionResponse;
1✔
407
  }
408

409
  public static SignalWithStartWorkflowExecutionAsyncResponse
410
      signalWithStartWorkflowExecutionAsyncResponse(
411
          com.uber.cadence.api.v1.SignalWithStartWorkflowExecutionAsyncResponse t) {
412
    return t == null ? null : new SignalWithStartWorkflowExecutionAsyncResponse();
1✔
413
  }
414

415
  public static UpdateDomainResponse updateDomainResponse(
416
      com.uber.cadence.api.v1.UpdateDomainResponse t) {
417
    if (t == null) {
1✔
UNCOV
418
      return null;
×
419
    }
420
    UpdateDomainResponse updateDomainResponse = new UpdateDomainResponse();
1✔
421
    DomainInfo domainInfo = new DomainInfo();
1✔
422
    updateDomainResponse.setDomainInfo(domainInfo);
1✔
423

424
    domainInfo.setName(t.getDomain().getName());
1✔
425
    domainInfo.setStatus(domainStatus(t.getDomain().getStatus()));
1✔
426
    domainInfo.setDescription(t.getDomain().getDescription());
1✔
427
    domainInfo.setOwnerEmail(t.getDomain().getOwnerEmail());
1✔
428
    domainInfo.setData(t.getDomain().getDataMap());
1✔
429
    domainInfo.setUuid(t.getDomain().getId());
1✔
430

431
    DomainConfiguration domainConfiguration = new DomainConfiguration();
1✔
432
    updateDomainResponse.setConfiguration(domainConfiguration);
1✔
433

434
    domainConfiguration.setWorkflowExecutionRetentionPeriodInDays(
1✔
435
        durationToDays(t.getDomain().getWorkflowExecutionRetentionPeriod()));
1✔
436
    domainConfiguration.setEmitMetric(true);
1✔
437
    domainConfiguration.setBadBinaries(badBinaries(t.getDomain().getBadBinaries()));
1✔
438
    domainConfiguration.setHistoryArchivalStatus(
1✔
439
        archivalStatus(t.getDomain().getHistoryArchivalStatus()));
1✔
440
    domainConfiguration.setHistoryArchivalURI(t.getDomain().getHistoryArchivalUri());
1✔
441
    domainConfiguration.setVisibilityArchivalStatus(
1✔
442
        archivalStatus(t.getDomain().getVisibilityArchivalStatus()));
1✔
443
    domainConfiguration.setVisibilityArchivalURI(t.getDomain().getVisibilityArchivalUri());
1✔
444

445
    DomainReplicationConfiguration domainReplicationConfiguration =
1✔
446
        new DomainReplicationConfiguration();
447
    updateDomainResponse.setReplicationConfiguration(domainReplicationConfiguration);
1✔
448

449
    domainReplicationConfiguration.setActiveClusterName(t.getDomain().getActiveClusterName());
1✔
450
    domainReplicationConfiguration.setClusters(
1✔
451
        clusterReplicationConfigurationArray(t.getDomain().getClustersList()));
1✔
452
    updateDomainResponse.setFailoverVersion(t.getDomain().getFailoverVersion());
1✔
453
    updateDomainResponse.setIsGlobalDomain(t.getDomain().getIsGlobalDomain());
1✔
454
    return updateDomainResponse;
1✔
455
  }
456
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc