IssueLinkJsonParser implements JsonParser<IssueLink> { @Override public IssueLink parse(JSONObject json) throws JSONException { final String key = json.getString("issueKey"); final URI targetIssueUri = JsonParseUtil.parseURI(json.getString("issue")); final IssueLinkType issueLinkType = issueLinkTypeJsonParser.parse(json.getJSONObject("type")); return new IssueLink(key, targetIssueUri, issueLinkType); }  @Override IssueLink parse(JSONObject json);  }
@Test public void testParseIssueLink() throws Exception { IssueLinkJsonParser parser = new IssueLinkJsonParser(); final IssueLink issueLink = parser.parse(ResourceUtil.getJsonObjectFromResource("/json/issueLink/valid.json")); assertEquals(new IssueLinkType("Duplicate", "duplicates", IssueLinkType.Direction.OUTBOUND), issueLink.getIssueLinkType()); assertEquals("TST-2", issueLink.getTargetIssueKey()); assertEquals(TestUtil.toUri("http: }