Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8355485 authored by Alex Salo's avatar Alex Salo
Browse files

Update TestableContext annotation from ClassRule to Rule

@Rule runs for every test method, while @ClassRule just once for the class. TestableContext needs to be cleared after each test, so @Rule should be used.

Test: Ran the test locally.
Bug: 414928899
Fix: 414928899
Flag: TEST_ONLY
Change-Id: Ie8b59f0ba537a91ada1322c49d45578e7b79bfb8
parent dcfb635e
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ import androidx.test.platform.app.InstrumentationRegistry;
import com.android.modules.utils.testing.TestableDeviceConfig;

import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.mockito.Mock;
@@ -51,7 +50,7 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

public class FaceDownDetectorTest {
    @ClassRule
    @Rule
    public static final TestableContext sContext = new TestableContext(
            InstrumentationRegistry.getInstrumentation().getTargetContext(), null);
    @Rule