I need to write a unit test for the method processNotification
. But this method internally calls JsonUtility.getNotificationDTOFromMessage
.
I need the return value to be null
when this is called. How can we achieve this by using Mockito?
I cannot make changes in the code as it is not owned by me.
@Override
public void processNotification(String message) throws IOException {
logger.info(" Processing the notifications");
NotificationDTO notification =
JsonUtility.getNotificationDTOFromMessage(message);
if (null == notification) {