attilapiros commented on code in PR #37990:
URL: https://github.com/apache/spark/pull/37990#discussion_r979437063


##########
resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/submit/K8sSubmitOpSuite.scala:
##########
@@ -101,18 +114,19 @@ class K8sSubmitOpSuite extends SparkFunSuite with 
BeforeAndAfter {
     implicit val kubeClient: KubernetesClient = kubernetesClient
     val killApp = new KillApplication
     val conf = new SparkConf().set(KUBERNETES_SUBMIT_GRACE_PERIOD, 1L)
-    
when(driverPodOperations1.withGracePeriod(1L)).thenReturn(driverPodOperations1)
+    doReturn(deletable).when(driverPodOperations1).withGracePeriod(1L)

Review Comment:
   This is a bit tricky. Because of some generic args the `when()..doReturn()` 
is not working but this `doReturn()..when()` does:
   
   
https://stackoverflow.com/questions/15942880/mocking-a-method-that-return-generics-with-wildcard-using-mockito



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to