I'm not sure if this is the expected behaviour while testing Domain Objects
through the JUnit viewer.
While doing tests over factory actions, one assert would be to verify the
object has been persisted through the
DomainObjectContainer.isPersistent(domainObject) method.
If the evaluation is done over a wrapped object, it returns false.
If it's done over the original object, it returns true.
As an example:
// Test if the Domain Object has been persisted.
assertTrue(domainObjectContainer
.isPersistent(communicationPathAssociatedWithNode));
// Node must be wrapped for the Apache Isis validators to be
executed.
communicationPathAssociatedWithNode =
wrapped(communicationPathAssociatedWithNode);
assertTrue(domainObjectContainer
.isPersistent(communicationPathAssociatedWithNode));
The last assertion fails. The only difference I expected was the validation of
the programming model. Is it correct? I'm sure there's anything I'm missing.
Thanks in advance!