You need to sign in to do that
Don't have an account?
sakthidharan Ambayiram
Error details:
Error MessageSystem.JSONException: Unexpected character ('"' (code 34)): was expecting comma to separate OBJECT entries at [line:1, column:31]
Stack TraceClass.System.JSON.deserializeUntyped: line 11, column 1
System.JSONException: Unexpected character ('"' (code 34)): was expecting comma to separate OBJECT entries at [line:1, column:31]
@isTest global class CQP_ClsTriggerOpportunityHttpResGen implements HttpCalloutMock{ // Implement this interface method global HTTPResponse respond(HTTPRequest req) { HttpResponse res = new HttpResponse(); res.setHeader('Content-Type', 'application/json'); res.setBody('{"TYPE":"type","SAPID":"1234"","NUMBER":"100","MESSAGE":"message","LOG_NO":"log_no","LOG_MSG_NO":"100","MESSAGE_V1":"msg1","MESSAGE_V2":"msg2","MESSAGE_V3":"msg3","MESSAGE_V4":"msg4","PARAMETER":"param","ROW":"row","FIELD":"field","SYSTEM":"system"}'); res.setStatusCode(200); res.setStatus('OK'); return res; } } ***************main class **************** List<Object> results = (List<Object>) JSON.deserializeUntyped(res.getBody()); for (Object mp: results) { System.debug('>>'+(Map<String, Object>)mp); Map<String, object> jsonRespMap = (Map<String, Object>)mp; Boolean result = Boolean.valueof(jsonRespMap.get('success')); if(result == true){ afterUpdateSuccess(opty1); }
Error details:
Error MessageSystem.JSONException: Unexpected character ('"' (code 34)): was expecting comma to separate OBJECT entries at [line:1, column:31]
Stack TraceClass.System.JSON.deserializeUntyped: line 11, column 1
Looks like an Invalid JSON
Can you please take a look at this post
http://https://developer.salesforce.com/forums/?id=906F0000000B3IEIA0 (http://https://developer.salesforce.com/forums/?id=906F0000000B3IEIA0) and see if it helps?
Anudeep