-1

I am not able to call this method in my test class:

WebServiceCallout.invoke(

          this,
          request_x,
          response_map_x,
          new String[]{endpoint_x,
          'https://www.imed.com.ar/Producto',
          'https://www.imed.com.ar/',
          'Producto',
          'https://www.imed.com.ar/',
          'ProductoResponse',
          'wwwImedComAr.ProductoResponse_element'}
0

1 Answer 1

1

You need to implement mock interface in you test class, something like:

@IsTest
global class Mocker implements WebServiceMock {
   global void doInvoke(
        Object stub, Object request, Map<String, Object> response,
        List<String> endpoint) {

          //you should set here your response **res**
          response.put('response_x', res);

          return;
    }
}

After that, set in your test method:

Test.setMock(WebServiceMock.class, new Mocker());

Not the answer you're looking for? Browse other questions tagged .