@Test public void test_draft_repository_should_update_draft() { draftJpaRepository.save(getUpdateOrDeleteDraftEntity()); draftJpaRepository.findOne(1L); draftRepository.updateDraft(getDraftUpdateRequest()); verify(draftJpaRepository).save(getUpdateOrDeleteDraftEntity()); }
public void updateDraft(UpdateDraft draftUpdateRequest) { org.egov.pgrrest.read.persistence.entity.Draft draftFromDB = draftJpaRepository .findOne(draftUpdateRequest.getId()); if (draftFromDB != null) { String updateDraft = convertToString(draftUpdateRequest.getDraft()); draftFromDB.setDraft(updateDraft); draftJpaRepository.save(draftFromDB); } }
DraftRepository { public void updateDraft(UpdateDraft draftUpdateRequest) { org.egov.pgrrest.read.persistence.entity.Draft draftFromDB = draftJpaRepository .findOne(draftUpdateRequest.getId()); if (draftFromDB != null) { String updateDraft = convertToString(draftUpdateRequest.getDraft()); draftFromDB.setDraft(updateDraft); draftJpaRepository.save(draftFromDB); } } }
DraftRepository { public void updateDraft(UpdateDraft draftUpdateRequest) { org.egov.pgrrest.read.persistence.entity.Draft draftFromDB = draftJpaRepository .findOne(draftUpdateRequest.getId()); if (draftFromDB != null) { String updateDraft = convertToString(draftUpdateRequest.getDraft()); draftFromDB.setDraft(updateDraft); draftJpaRepository.save(draftFromDB); } } DraftRepository(DraftJpaRepository draftJpaRepository, ObjectMapper objectMapper); }
DraftRepository { public void updateDraft(UpdateDraft draftUpdateRequest) { org.egov.pgrrest.read.persistence.entity.Draft draftFromDB = draftJpaRepository .findOne(draftUpdateRequest.getId()); if (draftFromDB != null) { String updateDraft = convertToString(draftUpdateRequest.getDraft()); draftFromDB.setDraft(updateDraft); draftJpaRepository.save(draftFromDB); } } DraftRepository(DraftJpaRepository draftJpaRepository, ObjectMapper objectMapper); long saveDraft(NewDraft newDraft); DraftResult getDrafts(DraftSearchCriteria searchCriteria); void delete(List<Long> draftIdList); void delete(long draftId); void updateDraft(UpdateDraft draftUpdateRequest); }
DraftRepository { public void updateDraft(UpdateDraft draftUpdateRequest) { org.egov.pgrrest.read.persistence.entity.Draft draftFromDB = draftJpaRepository .findOne(draftUpdateRequest.getId()); if (draftFromDB != null) { String updateDraft = convertToString(draftUpdateRequest.getDraft()); draftFromDB.setDraft(updateDraft); draftJpaRepository.save(draftFromDB); } } DraftRepository(DraftJpaRepository draftJpaRepository, ObjectMapper objectMapper); long saveDraft(NewDraft newDraft); DraftResult getDrafts(DraftSearchCriteria searchCriteria); void delete(List<Long> draftIdList); void delete(long draftId); void updateDraft(UpdateDraft draftUpdateRequest);  }