m-trieu commented on code in PR #31317:
URL: https://github.com/apache/beam/pull/31317#discussion_r1619492946
##########
runners/google-cloud-dataflow-java/worker/src/test/java/org/apache/beam/runners/dataflow/worker/StreamingDataflowWorkerTest.java:
##########
@@ -307,15 +315,38 @@ public void cleanUp() {
.ifPresent(ComputationStateCache::closeAndInvalidateAll);
}
- static Work createMockWork(long workToken) {
- return createMockWork(workToken, work -> {});
+ private static ExecutableWork createMockWork(
+ ShardedKey shardedKey, long workToken, String computationId) {
+ return createMockWork(shardedKey, workToken, computationId, ignored -> {});
}
- static Work createMockWork(long workToken, Consumer<Work> processWorkFn) {
- return Work.create(
-
Windmill.WorkItem.newBuilder().setKey(ByteString.EMPTY).setWorkToken(workToken).build(),
- Instant::now,
- Collections.emptyList(),
+ private static ExecutableWork createMockWork(
+ ShardedKey shardedKey, long workToken, Consumer<Work> processWorkFn) {
+ return createMockWork(shardedKey, workToken, "computationId",
processWorkFn);
+ }
+
+ private static ExecutableWork createMockWork(
+ ShardedKey shardedKey, long workToken, String computationId,
Consumer<Work> processWorkFn) {
+ WorkCommitter workCommitter = mock(WorkCommitter.class);
+ doNothing().when(workCommitter).commit(any(Commit.class));
+ WindmillStream.GetDataStream getDataStream =
mock(WindmillStream.GetDataStream.class);
+ when(getDataStream.requestKeyedData(anyString(), any()))
+ .thenReturn(Windmill.KeyedGetDataResponse.getDefaultInstance());
+ SideInputStateFetcher sideInputStateFetcher =
mock(SideInputStateFetcher.class);
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]