@Test
public void getCourses() {

    Resource<List<CourseEntity>> dummyCourses = Resource.success(DataDummy.generateDummyCourses());
    MutableLiveData<Resource<List<CourseEntity>>> courses = new MutableLiveData<>();
    courses.setValue(dummyCourses);
    when(academyRepository.getAllCourses()).thenReturn(courses);
    List<CourseEntity> courseEntities = viewModel.getCourses().getValue().data;
    verify(academyRepository).getAllCourses();
    assertNotNull(courseEntities);
    assertEquals(5, courseEntities.size());
    viewModel.getCourses().observeForever(observer);
    verify(observer).onChanged(dummyCourses);
}