assertTrue("response not wrapped with ERROR marker",
response.startsWith(AuraBaseServlet.CSRF_PROTECT + "*/") && response.endsWith("/*ERROR*/"));
response = response.substring(AuraBaseServlet.CSRF_PROTECT.length() + 2,
response.length() - "/*ERROR*/".length());
@SuppressWarnings("unchecked")
Map<String, Object> json = (Map<String, Object>) new JsonReader().read(response);
assertEquals(true, json.get("exceptionEvent"));
@SuppressWarnings("unchecked")
Map<String, Object> eventJson = (Map<String, Object>) json.get("event");
assertEquals("markup://aura:clientOutOfSync", eventJson.get("descriptor"));
Object f = json.get("defaultHandler");