Skip to content

Commit

Permalink
comment as per reviewer feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdulWahabMemon committed May 6, 2024
1 parent 4b03929 commit c615423
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.Observer
import dagger.hilt.android.testing.HiltTestApplication
import io.mockk.clearAllMocks
import java.io.File
import java.io.FileReader
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
import org.junit.AfterClass
import org.junit.BeforeClass
import org.junit.runner.RunWith
import org.robolectric.annotation.Config
import org.smartregister.fhircore.engine.app.fakes.FakeKeyStore
import java.io.File
import java.io.FileReader
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit

@RunWith(FhircoreTestRunner::class)
@Config(sdk = [Build.VERSION_CODES.O_MR1], application = HiltTestApplication::class)
Expand All @@ -40,13 +40,13 @@ abstract class RobolectricTest {
val data = arrayOfNulls<Any>(1)
val latch = CountDownLatch(1)
val observer: Observer<T> =
Observer<T>
// override fun onChanged(o: T?) {
// data[0] = o
// latch.countDown()
// liveData.removeObserver(this)
// }
{ TODO("Not yet implemented") }
object : Observer<T> {
override fun onChanged(o: T) {
data[0] = o
latch.countDown()
liveData.removeObserver(this)
}
}
liveData.observeForever(observer)
latch.await(3, TimeUnit.SECONDS)
@Suppress("UNCHECKED_CAST") return data[0] as T?
Expand Down

0 comments on commit c615423

Please sign in to comment.