arjun4084346 commented on code in PR #3937:
URL: https://github.com/apache/gobblin/pull/3937#discussion_r1586706509
##########
gobblin-service/src/test/java/org/apache/gobblin/service/modules/orchestration/OrchestratorTest.java:
##########
@@ -114,6 +119,8 @@ public void setup() throws Exception {
FlowLaunchHandler mockFlowTriggerHandler = mock(FlowLaunchHandler.class);
DagManager mockDagManager = mock(DagManager.class);
doNothing().when(mockDagManager).setTopologySpecMap(anyMap());
+ TopologySpecFactory mockedTopologySpecFactory =
mock(TopologySpecFactory.class);
+
doReturn(Collections.singleton(this.topologySpec)).when(mockedTopologySpecFactory).getTopologies();
Review Comment:
I prefer this way, because in `when(obj.method()).thenReturn(obj)` it
actually calls `obj.method()` which is rarely useful (and often generate
exceptions) because obj is a mocked dummy object.
--
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]