use of com.google.firebase.firestore.FirebaseFirestore in project House-Organizer by House-Organizer.
the class FirebaseTestsHelper method createTestTaskList.
/**
* Need to create fake user before
* @throws ExecutionException
* @throws InterruptedException
*/
public static void createTestTaskList() throws ExecutionException, InterruptedException {
// Get DB ref
FirebaseFirestore db = FirebaseFirestore.getInstance();
// Create task list instance
User owner = new DummyUser("Test User", "0");
com.github.houseorganizer.houseorganizer.Task taskToAdd = new com.github.houseorganizer.houseorganizer.Task(owner, "TestTask", "Testing");
TaskList taskList = new TaskList(owner, "MyList", new ArrayList<>(Collections.singletonList(taskToAdd)));
// Store instance on the database using a helper function
// returns only after storing is done
FirestoreTask.storeTaskList(taskList, db.collection("task lists"), "85IW3cYzxOo1YTWnNOQl");
}
Aggregations