Move companion at the bottom of the class.

This commit is contained in:
Benoit Marty 2022-06-14 16:36:56 +02:00
parent 279b9b5d6a
commit 2174b1105f
2 changed files with 12 additions and 12 deletions

View File

@ -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"
}
}

View File

@ -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\"}"
}
}