March 2018
Intermediate to advanced
324 pages
8h 30m
English
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("john@example.com");
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.
Read now
Unlock full access