@Test public void testGiveWine() throws Exception { final Royalty royalty = mock(Royalty.class); final Servant servant = new Servant("test"); servant.giveWine(royalty); verify(royalty).getDrink(); verifyNoMoreInteractions(royalty); }
public void giveWine(Royalty r) { r.getDrink(); }
Servant { public void giveWine(Royalty r) { r.getDrink(); } }
Servant { public void giveWine(Royalty r) { r.getDrink(); } Servant(String name); }
Servant { public void giveWine(Royalty r) { r.getDrink(); } Servant(String name); void feed(Royalty r); void giveWine(Royalty r); void giveCompliments(Royalty r); boolean checkIfYouWillBeHanged(List<Royalty> tableGuests); }
Servant { public void giveWine(Royalty r) { r.getDrink(); } Servant(String name); void feed(Royalty r); void giveWine(Royalty r); void giveCompliments(Royalty r); boolean checkIfYouWillBeHanged(List<Royalty> tableGuests); public String name; }