github-actions[bot] commented on code in PR #40866:
URL: https://github.com/apache/beam/pull/40866#discussion_r4397881286


##########
sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/datastore/DatastoreV1Test.java:
##########
@@ -1388,6 +1360,41 @@ private static List<Query> splitQuery(Query query, int 
numSplits) {
    * A WriteBatcher for unit tests, which does no timing-based adjustments (so 
unit tests have
    * consistent results).
    */
+  /**
+   * Runs {@code fn} over {@code inputs} in a single bundle, in-process. The 
fns under test hold
+   * Mockito mocks, which can't be serialized, so they can't go through a 
{@code TestPipeline}.
+   */
+  static <InputT, OutputT> List<OutputT> processBundle(
+      DoFn<InputT, OutputT> fn, Iterable<InputT> inputs) {
+    List<OutputT> outputs = new ArrayList<>();
+    DoFnRunner<InputT, OutputT> runner =
+        DoFnRunners.simpleRunner(
+            PipelineOptionsFactory.create(),
+            fn,
+            NullSideInputReader.empty(),
+            new WindowedValueMultiReceiver() {
+              @Override
+              @SuppressWarnings("unchecked")
+              public <T> void output(TupleTag<T> tag, WindowedValue<T> output) 
{
+                outputs.add((OutputT) output.getValue());
+              }
+            },
+            new TupleTag<>(),
+            Collections.emptyList(),
+            null,
+            null,
+            Collections.emptyMap(),
+            WindowingStrategy.globalDefault(),
+            DoFnSchemaInformation.create(),
+            Collections.emptyMap());
+    runner.startBundle();
+    for (InputT input : inputs) {
+      runner.processElement(WindowedValues.valueInGlobalWindow(input));
+    }
+    runner.finishBundle();
+    return outputs;
+  }
+

Review Comment:
   **🟢 Low**: `processBundle` was inserted between `FakeWriteBatcher` and its 
Javadoc comment (lines 1359–1362), leaving a duplicate/dangling Javadoc block 
above `processBundle`. Please move the `WriteBatcher` Javadoc back down to 
`FakeWriteBatcher`.



-- 
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]

Reply via email to