}
public void testModify(){
//add one issue
Target myTarget = new Target("Diagram","2");
IIssue newIssue = new Issue();
newIssue.setDescription("test");
newIssue.setPriority(Priority.HIGH);
newIssue.setResolution(Resolution.IN_PROGRESS);
newIssue.setTarget(myTarget);
List<IIssue> list = new LinkedList<IIssue>();
list.add(newIssue);
issueService.addIssues(list);
int id = 0;//temp to store the id of the issue
List<IIssue> newList = (List<IIssue>)issueService.getIssues(myTarget);
assertNotNull(newList);
IIssue savedIssue = newList.get(0);
assertNotNull(savedIssue);
id = savedIssue.getId();
savedIssue.setDescription("newDescription");
savedIssue.setResolution(Resolution.RESOLVED);
issueService.modifyIssue(savedIssue);
List<IIssue> newList2 = (List<IIssue>)issueService.getIssues(myTarget);
assertNotNull(newList2);
Iterator<IIssue> it2 = newList2.iterator();
IIssue savedIssue2 = null;
while(it2.hasNext()){
IIssue temp = it2.next();
if(temp.getId() == id){
savedIssue = temp;
}
}
assertNotNull(savedIssue);
assertEquals(savedIssue.getDescription(),"newDescription");