I am trying to mock the external call.
ResponseEntity<?> httpResponse = requestGateway.pushNotification(xtifyRequest);
requestGateway is an interface.
public interface RequestGateway
{
ResponseEntity<?> pushNotification(XtifyRequest xtifyRequest);
}
Below is the test method i am trying to do.
@Test
public void test()
{
ResponseEntity<?> r=new ResponseEntity<>(HttpStatus.ACCEPTED);
when(requestGateway.pushNotification(any(XtifyRequest.class))).thenReturn(r);
}
A compilation error is there in the above when statement,saying it as an invalid type.even thougg r is of type ResponseEntity.
Can anyone please help me to solve this issue ?