@Test public void testGoToBattle() { final DragonSlayingStrategy strategy = mock(DragonSlayingStrategy.class); final DragonSlayer dragonSlayer = new DragonSlayer(strategy); dragonSlayer.goToBattle(); verify(strategy).execute(); verifyNoMoreInteractions(strategy); }
public void goToBattle() { strategy.execute(); }
DragonSlayer { public void goToBattle() { strategy.execute(); } }
DragonSlayer { public void goToBattle() { strategy.execute(); } DragonSlayer(DragonSlayingStrategy strategy); }
DragonSlayer { public void goToBattle() { strategy.execute(); } DragonSlayer(DragonSlayingStrategy strategy); void changeStrategy(DragonSlayingStrategy strategy); void goToBattle(); }
DragonSlayer { public void goToBattle() { strategy.execute(); } DragonSlayer(DragonSlayingStrategy strategy); void changeStrategy(DragonSlayingStrategy strategy); void goToBattle();  }