Details
-
Bug
-
Status: Closed
-
Could
-
Resolution: Fixed
-
None
-
None
Description
PersonServiceImpl.voidRelationship currently looks like
if (relationship.getVoided()) { return relationship; } relationship.setVoided(true); if (relationship.getVoidedBy() == null) { relationship.setVoidedBy(Context.getAuthenticatedUser()); } if (voidReason != null) { relationship.setVoidReason(voidReason); } relationship.setDateVoided(new Date()); return Context.getPersonService().saveRelationship(relationship);
due to the BaseVoidHandler which is being called via AOP the Relationship is already voided, therefore the guard clause at the top of the voidRelationship method exits.
This also explains why the coverage of the method is low despite 3 tests aimed at testing the different branches in this method.
I suggest we remove all the code except the return Context.getPersonService().saveRelationship(relationship). This would make the implementation equal to voidPersonAddress, voidPersonName. Remaining question, what if given null? voidPerson then returns null, the other two methods dont.
Gliffy Diagrams
Attachments
Issue Links
- discovered while testing
-
TRUNK-5064 Add tests to PersonServiceImpl
-
- Closed
-
- mentioned in
-
Page Loading...