@@ -66,17 +66,16 @@ class UserDecisionRegistryTest {
6666 }
6767
6868 @Test
69- fun testCheck_FirstDecision_Positive () {
69+ fun testCheck_FirstDecision_Positive () = runTest {
7070 every { registry.requestDecision(testCert, any(), any()) } answers {
7171 registry.onUserDecision(testCert, true )
7272 }
73- assertTrue(runBlocking {
74- registry.check(testCert, true )
75- })
73+ assertTrue(registry.check(testCert, true ))
7674 }
7775
7876 @Test
7977 fun testCheck_MultipleDecisionsForSameCert_Negative () {
78+ // Keep runBlocking for complex concurrency test with Semaphore and threads
8079 val canSendFeedback = Semaphore (0 )
8180 every { registry.requestDecision(testCert, any(), any()) } answers {
8281 thread {
@@ -103,6 +102,7 @@ class UserDecisionRegistryTest {
103102
104103 @Test
105104 fun testCheck_MultipleDecisionsForSameCert_Positive () {
105+ // Keep runBlocking for complex concurrency test with Semaphore and threads
106106 val canSendFeedback = Semaphore (0 )
107107 every { registry.requestDecision(testCert, any(), any()) } answers {
108108 thread {
@@ -129,6 +129,7 @@ class UserDecisionRegistryTest {
129129
130130 @Test
131131 fun testCheck_MultipleDecisionsForSameCert_cancel () {
132+ // Keep runBlocking for complex concurrency test with Semaphore, threads, and job cancellation
132133 val canSendFeedback = Semaphore (0 )
133134 val nm = mockk<NotificationManagerCompat >()
134135 every { nm.cancel(any(), any()) } just runs
@@ -159,12 +160,10 @@ class UserDecisionRegistryTest {
159160 }
160161
161162 @Test
162- fun testCheck_UserDecisionImpossible () {
163+ fun testCheck_UserDecisionImpossible () = runTest {
163164 every { NotificationUtils .notificationsPermitted(any()) } returns false
164- assertFalse(runBlocking {
165- // should return instantly
166- registry.check(testCert, false )
167- })
165+ // should return instantly
166+ assertFalse(registry.check(testCert, false ))
168167 verify(inverse = true ) {
169168 registry.requestDecision(any(), any(), any())
170169 }
0 commit comments