xxxxxxxxxx
public class HeroTester {
// injects the created Mock
@InjectMocks
HeroApp heroApp = new HeroApp();
// Creates the mock
@Mock
HeroService heroService;
@Test
public void getHeroHouseTest(){
when(heroService.getHouse())).thenReturn(
"San Francisco ");
assertThat(heroApp.getHouse()).isEqualTo(
"San Francisco");
}
}