Status extends Resource { public static Status get(RestClient restclient, String id) throws JiraException { JSON result = null; try { result = restclient.get(getBaseUri() + "status/" + id); } catch (Exception ex) { throw new JiraException("Failed to retrieve status " + id, ex); } if (!(result instanceof JSONObject)) throw new JiraException("JSON payload is malformed"); return new Status(restclient, (JSONObject)result); } protected  Status(RestClient restclient, JSONObject json); static Status get(RestClient restclient, String id); @Override String toString(); String getDescription(); String getName(); String getIconUrl();  }
@Test(expected = JiraException.class) public void testJiraExceptionFromRestException() throws Exception { final RestClient mockRestClient = PowerMockito.mock(RestClient.class); when(mockRestClient.get(anyString())).thenThrow(RestException.class); Status.get(mockRestClient, "issueNumber"); }
@Test(expected = JiraException.class) public void testJiraExceptionFromNonJSON() throws Exception { final RestClient mockRestClient = PowerMockito.mock(RestClient.class); Status.get(mockRestClient,"issueNumber"); }