I have a problem with one test.
Let's say, there was a method like this:
public Item doSomething(Some parameters) {
Item item = someMethodDoingSomethingWithParameters(parameters)
return item;
}
but then I have introduced new functionality, sending notifications.
public Item doSomething(List<Some> parameters) {
Item item = someMethodDoingSomethingWithParameters(parameters)
sendNotificationToItemOwners(parameters);
return item;
}
this sendNotificationToItemOwners(List<Some> parameters)
method looks like this:
private void sendNotificationToOwners(parameters) {
parameters.stream().forEach(parameter -> notificationService.sendNotification(paremeter.getOwnerEmail());
}
I don't want to test a lambda, and I don't want to test the NotificationService
cause it is allready well tested.
The code I wrote is a very simplified version of my original code. The addition of this new sendNotificationToOwners()
method gives me headaches, the test is failing, I am trying to mock some objects required, but it doesn't seem to solve my problem.
Can I completely omit this method in a test? It would be wonderful if it would be possible..