fix(audio): 오디오 알림 route extra를 전달한다
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
@file:Suppress("ktlint:package-name", "ktlint:standard:package-name")
|
||||
|
||||
package kr.co.vividnext.sodalive.audio_content
|
||||
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import java.io.File
|
||||
|
||||
class AudioContentPlayServiceNotificationRouteSourceTest {
|
||||
|
||||
private val source = projectFile(
|
||||
"app/src/main/java/kr/co/vividnext/sodalive/audio_content/AudioContentPlayService.kt"
|
||||
).readText()
|
||||
|
||||
@Test
|
||||
fun `기존 오디오 알림은 상세 route와 content id를 전달한다`() {
|
||||
assertTrue(source.contains("MainV2Activity.EXTRA_AUDIO_NOTIFICATION_ROUTE"))
|
||||
assertTrue(source.contains("MainV2Activity.ROUTE_AUDIO_DETAIL"))
|
||||
assertTrue(source.contains("Constants.EXTRA_AUDIO_CONTENT_ID"))
|
||||
assertTrue(source.contains("PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_CANCEL_CURRENT"))
|
||||
}
|
||||
|
||||
private fun projectFile(relativePath: String): File {
|
||||
val candidates = listOf(File(relativePath), File("../$relativePath"))
|
||||
return candidates.firstOrNull { it.exists() }
|
||||
?: error("Project file not found: $relativePath")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
@file:Suppress("ktlint:package-name", "ktlint:standard:package-name")
|
||||
|
||||
package kr.co.vividnext.sodalive.audio_content.player
|
||||
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import java.io.File
|
||||
|
||||
class AudioContentPlayerServiceNotificationRouteSourceTest {
|
||||
|
||||
private val source = projectFile(
|
||||
"app/src/main/java/kr/co/vividnext/sodalive/audio_content/player/AudioContentPlayerService.kt"
|
||||
).readText()
|
||||
|
||||
@Test
|
||||
fun `MediaSession session activity는 플레이어 route를 전달한다`() {
|
||||
assertTrue(source.contains("MainV2Activity.EXTRA_AUDIO_NOTIFICATION_ROUTE"))
|
||||
assertTrue(source.contains("MainV2Activity.ROUTE_AUDIO_PLAYER"))
|
||||
assertTrue(source.contains("PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE"))
|
||||
}
|
||||
|
||||
private fun projectFile(relativePath: String): File {
|
||||
val candidates = listOf(File(relativePath), File("../$relativePath"))
|
||||
return candidates.firstOrNull { it.exists() }
|
||||
?: error("Project file not found: $relativePath")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user