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