@Test fun `This test is the best`() = runBlocking { given { getProfileUseCase.run(Unit) }.willReturn { flowOf(expectedUser.right()) } viewModel.getProfile() delay(200)//This makes test pass!! val state = LiveDataTestUtil.getValue(viewModel.state) Assert.assertNotNull(state) Assert.assertTrue(state is ViewState.SUCCESS) verify(getProfileUseCase, atLeastOnce()).run(Unit) }