Writing tests

While keeping the old end-to-end test, create an interaction to verify the integration of BirthdayGreetingService and MessageSender:

  @Test 
  public void the_service_should_ask_the_messageSender() { 
    final Email address = 
      new Email("[email protected]"); 
    final Employee john = new Employee(address); 
    final MessageSender messageSender = 
      mock(MessageSender.class); 
 
    new BirthdayGreetingService(messageSender) 
      .greet(john); 
 
    verify(messageSender).send(address, 
"Greetings on your birthday"); }

At this point, a new TweetMessageSender can be written, completing the last step of the algorithm.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.34.80