DaoModule { @Singleton @Provides DatabaseHealthCheck provideHealthCheck() { return usersDaoFactory.createHealthCheck(); } DaoModule(UsersDaoFactory usersDaoFactory);   }
@Test void testProvideDatabaseHealthCheck() { var factory = mock(UsersDaoFactory.class); var healthCheck = mock(DatabaseHealthCheck.class); when(factory.createHealthCheck()).thenReturn(healthCheck); DaoModule module = new DaoModule(factory); assertEquals(healthCheck, module.provideHealthCheck()); }