From 2174b1105f7db9723335c9d142442f04f062b566 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 14 Jun 2022 16:36:56 +0200 Subject: [PATCH] Move companion at the bottom of the class. --- .../im/vector/app/core/pushers/UnifiedPushStore.kt | 10 +++++----- .../im/vector/app/core/pushers/PushParserTest.kt | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/vector/src/main/java/im/vector/app/core/pushers/UnifiedPushStore.kt b/vector/src/main/java/im/vector/app/core/pushers/UnifiedPushStore.kt index 05e1131c0b..07d291a723 100644 --- a/vector/src/main/java/im/vector/app/core/pushers/UnifiedPushStore.kt +++ b/vector/src/main/java/im/vector/app/core/pushers/UnifiedPushStore.kt @@ -24,11 +24,6 @@ import javax.inject.Inject class UnifiedPushStore @Inject constructor( context: Context, ) { - companion object { - private const val PREFS_ENDPOINT_OR_TOKEN = "UP_ENDPOINT_OR_TOKEN" - private const val PREFS_PUSH_GATEWAY = "PUSH_GATEWAY" - } - private val defaultPrefs = DefaultSharedPreferences.getInstance(context) /** @@ -70,4 +65,9 @@ class UnifiedPushStore @Inject constructor( putString(PREFS_PUSH_GATEWAY, gateway) } } + + companion object { + private const val PREFS_ENDPOINT_OR_TOKEN = "UP_ENDPOINT_OR_TOKEN" + private const val PREFS_PUSH_GATEWAY = "PUSH_GATEWAY" + } } diff --git a/vector/src/test/java/im/vector/app/core/pushers/PushParserTest.kt b/vector/src/test/java/im/vector/app/core/pushers/PushParserTest.kt index 62875bb26d..b595203605 100644 --- a/vector/src/test/java/im/vector/app/core/pushers/PushParserTest.kt +++ b/vector/src/test/java/im/vector/app/core/pushers/PushParserTest.kt @@ -22,13 +22,6 @@ import org.amshove.kluent.shouldBeEqualTo import org.junit.Test class PushParserTest { - companion object { - private const val UNIFIED_PUSH_DATA = - "{\"notification\":{\"event_id\":\"\$anEventId\",\"room_id\":\"!aRoomId\",\"counts\":{\"unread\":1},\"prio\":\"high\"}}" - private const val FIREBASE_PUSH_DATA = - "{\"event_id\":\"\$anEventId\",\"room_id\":\"!aRoomId\",\"unread\":\"1\",\"prio\":\"high\"}" - } - private val validData = PushData( eventId = "\$anEventId", roomId = "!aRoomId", @@ -104,4 +97,11 @@ class PushParserTest { pushParser.parseData(FIREBASE_PUSH_DATA.replace("\$anEventId", "anEventId"), true) shouldBeEqualTo validData.copy(eventId = null) pushParser.parseData(UNIFIED_PUSH_DATA.replace("\$anEventId", "anEventId"), false) shouldBeEqualTo validData.copy(eventId = null) } + + companion object { + private const val UNIFIED_PUSH_DATA = + "{\"notification\":{\"event_id\":\"\$anEventId\",\"room_id\":\"!aRoomId\",\"counts\":{\"unread\":1},\"prio\":\"high\"}}" + private const val FIREBASE_PUSH_DATA = + "{\"event_id\":\"\$anEventId\",\"room_id\":\"!aRoomId\",\"unread\":\"1\",\"prio\":\"high\"}" + } }