Ensure offline manager @Before is completed before tests are run (#1251)

This commit is contained in:
fynngodau
2023-06-16 15:01:48 +02:00
committed by GitHub
parent 5bfe4de97d
commit 84b58d499b
2 changed files with 4 additions and 0 deletions

View File

@@ -37,14 +37,17 @@ class OfflineManagerTest : AppCenter() {
@Before
@After
fun resetDatabase() {
val latch = CountDownLatch(1)
OfflineManager.getInstance(context).resetDatabase(object : OfflineManager.FileSourceCallback {
override fun onSuccess() {
latch.countDown()
}
override fun onError(message: String) {
throw IOException("Unable to reset database before / after tests.")
}
})
latch.await()
}
@Test(timeout = 30_000)

View File

@@ -128,6 +128,7 @@ public class RuntimeStyleTests extends EspressoTest {
});
}
@Test
public void testAddLayerAt() {
validateTestSetup();
onView(withId(R.id.mapView)).perform(new BaseViewAction() {