@Test public void testMergeWith() throws Exception { final RestClient mockRestClient = PowerMockito.mock(RestClient.class); final JSONObject mockJSON = PowerMockito.mock(JSONObject.class); Version version = new Version(mockRestClient,mockJSON); version.mergeWith(new Version(mockRestClient,mockJSON)); verify(mockRestClient, times(1)).put(anyString(), any(JSONObject.class)); }
public void mergeWith(Version version) throws JiraException { JSONObject req = new JSONObject(); req.put("description", version.getDescription()); req.put("name", version.getName()); req.put("archived", version.isArchived()); req.put("released", version.isReleased()); req.put("releaseDate", version.getReleaseDate()); try { restclient.put(Resource.getBaseUri() + "version/" + id, req); } catch (Exception ex) { throw new JiraException("Failed to merge", ex); } }
Version extends Resource { public void mergeWith(Version version) throws JiraException { JSONObject req = new JSONObject(); req.put("description", version.getDescription()); req.put("name", version.getName()); req.put("archived", version.isArchived()); req.put("released", version.isReleased()); req.put("releaseDate", version.getReleaseDate()); try { restclient.put(Resource.getBaseUri() + "version/" + id, req); } catch (Exception ex) { throw new JiraException("Failed to merge", ex); } } }
Version extends Resource { public void mergeWith(Version version) throws JiraException { JSONObject req = new JSONObject(); req.put("description", version.getDescription()); req.put("name", version.getName()); req.put("archived", version.isArchived()); req.put("released", version.isReleased()); req.put("releaseDate", version.getReleaseDate()); try { restclient.put(Resource.getBaseUri() + "version/" + id, req); } catch (Exception ex) { throw new JiraException("Failed to merge", ex); } } protected  Version(RestClient restclient, JSONObject json); }
Version extends Resource { public void mergeWith(Version version) throws JiraException { JSONObject req = new JSONObject(); req.put("description", version.getDescription()); req.put("name", version.getName()); req.put("archived", version.isArchived()); req.put("released", version.isReleased()); req.put("releaseDate", version.getReleaseDate()); try { restclient.put(Resource.getBaseUri() + "version/" + id, req); } catch (Exception ex) { throw new JiraException("Failed to merge", ex); } } protected  Version(RestClient restclient, JSONObject json); void mergeWith(Version version); void copyTo(Project project); static Version get(RestClient restclient, String id); @Override String toString(); String getName(); boolean isArchived(); boolean isReleased(); String getReleaseDate(); String getDescription(); static FluentCreate create(RestClient restclient, String project); }
Version extends Resource { public void mergeWith(Version version) throws JiraException { JSONObject req = new JSONObject(); req.put("description", version.getDescription()); req.put("name", version.getName()); req.put("archived", version.isArchived()); req.put("released", version.isReleased()); req.put("releaseDate", version.getReleaseDate()); try { restclient.put(Resource.getBaseUri() + "version/" + id, req); } catch (Exception ex) { throw new JiraException("Failed to merge", ex); } } protected  Version(RestClient restclient, JSONObject json); void mergeWith(Version version); void copyTo(Project project); static Version get(RestClient restclient, String id); @Override String toString(); String getName(); boolean isArchived(); boolean isReleased(); String getReleaseDate(); String getDescription(); static FluentCreate create(RestClient restclient, String project);  }