79797572

Date: 2025-10-23 08:38:12
Score: 1
Natty:
Report link

For me, i had to replace my when...statement with a doReturn,
i.e. instead of :-

when(service.getString()).thenReturn("something to return"));

use this:-

import org.mockito.Mockito;
.....

Mockito.doReturn("something to return").when(service).getString();
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Chris Magowan