[ 
https://issues.apache.org/jira/browse/GOBBLIN-2057?focusedWorklogId=918671&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-918671
 ]

ASF GitHub Bot logged work on GOBBLIN-2057:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 10/May/24 03:50
            Start Date: 10/May/24 03:50
    Worklog Time Spent: 10m 
      Work Description: phet commented on code in PR #3938:
URL: https://github.com/apache/gobblin/pull/3938#discussion_r1596217894


##########
gobblin-service/src/test/java/org/apache/gobblin/service/modules/orchestration/proc/ResumeDagProcTest.java:
##########
@@ -101,24 +99,10 @@ public void resumeDag() throws IOException, 
URISyntaxException {
         null, mock(DagActionStore.class)));
     resumeDagProc.process(this.dagManagementStateStore);
 
-    List<SpecProducer<Spec>> specProducers = dag.getNodes().stream().map(n -> {
-      try {
-        return DagManagerUtils.getSpecProducer(n);
-      } catch (ExecutionException | InterruptedException e) {
-        throw new RuntimeException(e);
-      }
-    }).collect(Collectors.toList());
+    SpecProducer<Spec> specProducer = 
DagManagerUtils.getSpecProducer(dag.getNodes().get(1));
     int expectedNumOfResumedJobs = 1; // = number of resumed nodes
 
-    long resumedJobCount = specProducers.stream()
-        .mapToLong(p -> Mockito.mockingDetails(p)
-            .getInvocations()
-            .stream()
-            .filter(a -> a.getMethod().getName().equals("addSpec"))
-            .count())
-        .sum();
-
-    Assert.assertEquals(resumedJobCount, expectedNumOfResumedJobs);
+    Mockito.verify(specProducer, 
Mockito.times(expectedNumOfResumedJobs)).addSpec(any());

Review Comment:
   excellent!
   
   ...and for the other `SpecProducer`s, don't we want:
   ```
   Mockito.verifyZeroInteractions(anotherSP);
   ```





Issue Time Tracking
-------------------

    Worklog Id:     (was: 918671)
    Time Spent: 3h  (was: 2h 50m)

> create resume dag proc
> ----------------------
>
>                 Key: GOBBLIN-2057
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-2057
>             Project: Apache Gobblin
>          Issue Type: Improvement
>            Reporter: Arjun Singh Bora
>            Priority: Major
>          Time Spent: 3h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to