You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running the test, it ends with :
java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object java.util.List.get(int)' on a null object reference
as if the foodList from LiveData<List> foodListLive is null.
foodListLive is null as well if I comment all what is after : Observer<List> observer = res -> assertEquals(1,res.size());
The pb happens both if I use this for creating db :
foodDatabase = ((SingletonProvider) SingletonProvider.Companion.getsContext()).getDatabase();
or this :
foodDatabase = Room.inMemoryDatabaseBuilder(
InstrumentationRegistry.getInstrumentation().getContext(),
FoodDatabase.class)
//.addMigrations(FoodDatabase.Companion.MIGRATION_1_2)
.build();
with only differences that in the first data are inserted in the physical db on device, so they are in, but no list is recovered.
Maybe depending of not using androidx ?
The text was updated successfully, but these errors were encountered:
Running the test, it ends with :
java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object java.util.List.get(int)' on a null object reference
as if the foodList from LiveData<List> foodListLive is null.
foodListLive is null as well if I comment all what is after : Observer<List> observer = res -> assertEquals(1,res.size());
The pb happens both if I use this for creating db :
foodDatabase = ((SingletonProvider) SingletonProvider.Companion.getsContext()).getDatabase();
or this :
foodDatabase = Room.inMemoryDatabaseBuilder(
InstrumentationRegistry.getInstrumentation().getContext(),
FoodDatabase.class)
//.addMigrations(FoodDatabase.Companion.MIGRATION_1_2)
.build();
with only differences that in the first data are inserted in the physical db on device, so they are in, but no list is recovered.
Maybe depending of not using androidx ?
The text was updated successfully, but these errors were encountered: