From f604b1d38454b397fc927ca6aaae16cdb6254a02 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 6 Sep 2022 15:00:55 +0200 Subject: [PATCH] Private val is better. --- .../androidTest/java/im/vector/app/ui/robot/ElementRobot.kt | 3 +-- .../androidTest/java/im/vector/app/ui/robot/NewRoomRobot.kt | 3 +-- .../androidTest/java/im/vector/app/ui/robot/OnboardingRobot.kt | 1 - .../androidTest/java/im/vector/app/ui/robot/RoomListRobot.kt | 3 +-- .../java/im/vector/app/ui/robot/space/SpaceRobot.kt | 3 +-- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/vector-app/src/androidTest/java/im/vector/app/ui/robot/ElementRobot.kt b/vector-app/src/androidTest/java/im/vector/app/ui/robot/ElementRobot.kt index 73e16f7796..e2f7ea3373 100644 --- a/vector-app/src/androidTest/java/im/vector/app/ui/robot/ElementRobot.kt +++ b/vector-app/src/androidTest/java/im/vector/app/ui/robot/ElementRobot.kt @@ -51,8 +51,7 @@ import im.vector.app.withIdlingResource import timber.log.Timber class ElementRobot { - - var features: VectorFeatures = DefaultVectorFeatures() + private val features: VectorFeatures = DefaultVectorFeatures() fun onboarding(block: OnboardingRobot.() -> Unit) { block(OnboardingRobot()) diff --git a/vector-app/src/androidTest/java/im/vector/app/ui/robot/NewRoomRobot.kt b/vector-app/src/androidTest/java/im/vector/app/ui/robot/NewRoomRobot.kt index 523f3a0d12..3d82fa4a65 100644 --- a/vector-app/src/androidTest/java/im/vector/app/ui/robot/NewRoomRobot.kt +++ b/vector-app/src/androidTest/java/im/vector/app/ui/robot/NewRoomRobot.kt @@ -27,8 +27,7 @@ import im.vector.app.features.VectorFeatures class NewRoomRobot( var createdRoom: Boolean = false ) { - - private var features: VectorFeatures = DefaultVectorFeatures() + private val features: VectorFeatures = DefaultVectorFeatures() fun createNewRoom(block: CreateNewRoomRobot.() -> Unit) { if (features.isNewAppLayoutEnabled()) { diff --git a/vector-app/src/androidTest/java/im/vector/app/ui/robot/OnboardingRobot.kt b/vector-app/src/androidTest/java/im/vector/app/ui/robot/OnboardingRobot.kt index e72535c116..1f1a799db3 100644 --- a/vector-app/src/androidTest/java/im/vector/app/ui/robot/OnboardingRobot.kt +++ b/vector-app/src/androidTest/java/im/vector/app/ui/robot/OnboardingRobot.kt @@ -33,7 +33,6 @@ import im.vector.app.features.DefaultVectorFeatures import im.vector.app.waitForView class OnboardingRobot { - private val defaultVectorFeatures = DefaultVectorFeatures() fun crawl() { diff --git a/vector-app/src/androidTest/java/im/vector/app/ui/robot/RoomListRobot.kt b/vector-app/src/androidTest/java/im/vector/app/ui/robot/RoomListRobot.kt index ee93edbffb..71ccad0870 100644 --- a/vector-app/src/androidTest/java/im/vector/app/ui/robot/RoomListRobot.kt +++ b/vector-app/src/androidTest/java/im/vector/app/ui/robot/RoomListRobot.kt @@ -33,8 +33,7 @@ import im.vector.app.features.VectorFeatures import im.vector.app.features.roomdirectory.RoomDirectoryActivity class RoomListRobot { - - private var features: VectorFeatures = DefaultVectorFeatures() + private val features: VectorFeatures = DefaultVectorFeatures() fun openRoom(roomName: String, block: RoomDetailRobot.() -> Unit) { clickOn(roomName) diff --git a/vector-app/src/androidTest/java/im/vector/app/ui/robot/space/SpaceRobot.kt b/vector-app/src/androidTest/java/im/vector/app/ui/robot/space/SpaceRobot.kt index aa6cf85c1f..8b69b43107 100644 --- a/vector-app/src/androidTest/java/im/vector/app/ui/robot/space/SpaceRobot.kt +++ b/vector-app/src/androidTest/java/im/vector/app/ui/robot/space/SpaceRobot.kt @@ -33,8 +33,7 @@ import im.vector.app.features.VectorFeatures import org.hamcrest.Matchers class SpaceRobot { - - private var features: VectorFeatures = DefaultVectorFeatures() + private val features: VectorFeatures = DefaultVectorFeatures() fun createSpace(isFirstSpace: Boolean, block: SpaceCreateRobot.() -> Unit) { if (features.isNewAppLayoutEnabled()) {