dave08
03/23/2021, 7:30 AMval s at the class level use the original classloader... is this really the only way, or can this be fixed? It seems it's linked to this issue: https://github.com/android/android-test/issues/409dave08
03/23/2021, 7:56 AMdave08
03/23/2021, 7:57 AM@RobolectricTest
@Config(manifest= Config.NONE)
class SyncAuthenticationTest : FreeSpec() {
private var syncApi: Lazy<WireMockServer> = lazy { WireMockServer(
WireMockConfiguration.options()
.port(30111)
.notifier(ConsoleNotifier(true))
) }
private lateinit var am: AccountManager
init {
beforeSpec {
am = AccountManager.get(getApplicationContext())
}
listener(LazyWireMockListener(syncApi, ListenerMode.PER_SPEC))
....dave08
03/23/2021, 7:57 AMdave08
03/23/2021, 7:59 AMLinkageError if I don't make it lazy...dave08
03/23/2021, 8:00 AMwasyl
03/23/2021, 8:10 AMwasyl
03/23/2021, 8:12 AMdave08
03/23/2021, 8:14 AMWireMock and AccountManager at the Spec/class scope for extracting test setup functions... having a classloader set at test time reverts to the state it was before that commit...dave08
03/23/2021, 8:15 AM@Config annotation is supported...wasyl
03/23/2021, 8:20 AM@Config was supported just once for the entire class, but we wanted to have tests like forall with different locale in config, and we couldn’t do it, we tried reimplementing the robolectric support too. That’s why I’m suggesting that any classloader-related stuff will be awkward and unlikely to support all convenient use casesdave08
03/23/2021, 8:22 AM