I am using a WebService callout, returning a string, and testing it; I am quite new to it. The problem is in the Mock class. When I am debugging it, the response element is created, the string is associated and the response_element is inserted correctly in this way:
tO.AOResponse_element a_element = new tO.AOResponse_element(); a_element.AOResult = 'http://www.google.com/archive'; System.debug('MOCK Set response: '+ a_element.AOResult); response.put('response__x', a_element); System.debug('MOCK Set response: '+ a_element);
But after this, the flows goes to the original class (not the mock) and when it returns from it, it gives an error attempting to de-reference a line object, and that line references to the original string to be returned in the non-mock class.
How can I solve it?