@Test public void testX() throws Exception { JSONObject serverResponse = new JSONObject(errorClassificationJSON); JSONArray jsonArray = serverResponse.getJSONArray("android_sdk_error_categories"); FacebookRequestErrorClassification errorClassification = FacebookRequestErrorClassification.createFromJSON(jsonArray); assertNotNull(errorClassification); assertNull(errorClassification.getRecoveryMessage(FacebookRequestError.Category.OTHER)); assertNull(errorClassification.getRecoveryMessage(FacebookRequestError.Category.TRANSIENT)); assertNotNull( errorClassification.getRecoveryMessage(FacebookRequestError.Category.LOGIN_RECOVERABLE)); assertEquals(2, errorClassification.getOtherErrors().size()); assertEquals(2, errorClassification.getLoginRecoverableErrors().size()); assertEquals(6, errorClassification.getTransientErrors().size()); // test subcodes assertEquals(2, errorClassification.getOtherErrors().get(102).size()); assertNull(errorClassification.getLoginRecoverableErrors().get(102)); }