String NAME = "Mailed";
ProcessType processType = new ProcessType(NAME);
currentUser.getProcessTypes().add(processType);
ProcessValue processValue = new ProcessValue();
sap.getProcess().put(processType, processValue);
schoolDAO.save(currentUser);
User savedUser = userDAO.getUserByUsername(currentUser
.getUsername());
assertEquals(1, savedUser.getSchoolRankings().size());
assertEquals(9, savedUser.getProcessTypes().size());
ProcessType savedPT = null;
// iterate to the last one
Iterator i = currentUser.getProcessTypes().iterator();
while (i.hasNext()) {
savedPT = (ProcessType) i.next();
}
assertEquals(NAME, savedPT.getName());
Application savedSAP = savedUser.getSchoolRankings().get(0);
ProcessValue savedPValue = savedSAP.getProcess().get(savedPT);
assertNotNull(savedPValue);
assertEquals(0.0, savedPValue.getPctComplete());
}