attilapiros commented on a change in pull request #24241: 
[SPARK-27323][CORE][SQL][STREAMING] Use Single-Abstract-Method support in Scala 
2.12 to simplify code
URL: https://github.com/apache/spark/pull/24241#discussion_r270983348
 
 

 ##########
 File path: 
core/src/test/scala/org/apache/spark/deploy/worker/DriverRunnerTest.scala
 ##########
 @@ -57,11 +56,9 @@ class DriverRunnerTest extends SparkFunSuite {
       superviseRetry: Boolean) = {
     val runner = createDriverRunner()
     runner.setSleeper(mock(classOf[Sleeper]))
-    doAnswer(new Answer[Int] {
-      def answer(invocation: InvocationOnMock): Int = {
-        runner.runCommandWithRetry(processBuilder, p => (), supervise = 
superviseRetry)
-      }
-    }).when(runner).prepareAndRunDriver()
+    doAnswer((_: InvocationOnMock) =>
 
 Review comment:
   Nit: In this case would not we prefer to have `{`, like:
   
   ```
   doAnswer { (_: InvocationOnMock) =>
   }
   ``` 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to