How to run a Junit5 test with Android dependencies and robolectric
问题 I am trying to run a unit test like that: @org.junit.jupiter.api.Test void junit5codeCoverage() { final int result = new Foo().junit5(); Assert.assertEquals(Looper.getMainLooper().getThread(), Thread.currentThread()); assertEquals(-1, result); } That is a Junit5 test with Android dependencies (i.e Looper.getMainLooper() ) with Robolectric. I am using the junit5 android plugin from mannodermaus that allows running junit5 within Android setups. But this does not work out of the box because it