LuciferYang commented on a change in pull request #31142:
URL: https://github.com/apache/spark/pull/31142#discussion_r557009519
##########
File path: core/src/test/scala/org/apache/spark/deploy/worker/WorkerSuite.scala
##########
@@ -51,7 +51,7 @@ class WorkerSuite extends SparkFunSuite with Matchers with
BeforeAndAfter {
import org.apache.spark.deploy.DeployTestUtils._
- @Mock(answer = RETURNS_SMART_NULLS) private var shuffleService:
ExternalShuffleService = _
+ @Mock(answer = RETURNS_SMART_NULLS) private val shuffleService:
ExternalShuffleService = null
Review comment:
https://github.com/mockito/mockito/blob/019830665f97c8ba6159148e3b10086cfb894900/src/main/java/org/mockito/internal/util/reflection/FieldSetter.java#L13-L18

`mockito` use reflection api to change them, so they can be `val`, although
`var` seems easier to understand.
So for ease of understanding, we can also not change the case related to
`@Mock`
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]