1
2
3
4
5
6
7
8
9
10
11
12
13
14
| @isTest
| global class NFM402HttpCallMock implements HttpCalloutMock {
| // 实现这个接口方法
| global HTTPResponse respond(HTTPRequest request) {
| // 创建一个假的回应
| HttpResponse response = new HttpResponse();
| response.setHeader('Content-Type', 'application/json');
| // response.setBody('{"code":0,"data":[{"SYSTEM_SOURCE_REF_NO":"a0J1000000LmVQU","ETQ_UPLOAD_STATUS":"200","ETQ_COMPLAINT_NUMBER":"111111"},{"SYSTEM_SOURCE_REF_NO":"a0J1000000LmVQU","ETQ_UPLOAD_STATUS":"200","ETQ_COMPLAINT_NUMBER":"222222"}],"msg":"执行成功"}');
| response.setBody('{"code":0,"data":[{"SYSTEM_SOURCE_REF_NO":"'+System.Label.NFM402http+'","ETQ_UPLOAD_STATUS":"200","ETQ_COMPLAINT_NUMBER":"111111","INTERFACE_RECORD_ID":121},{"SYSTEM_SOURCE_REF_NO":"'+System.label.NFM402http+'","ETQ_UPLOAD_STATUS":"200","ETQ_COMPLAINT_NUMBER":"222222"}],"msg":"执行成功"}');
|
| response.setStatusCode(200);
| return response;
| }
| }
|
|