Package de.cuioss.test.valueobjects.util
Class DeepCopyTestHelper
java.lang.Object
de.cuioss.test.valueobjects.util.DeepCopyTestHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
verifyDeepCopy
(Object source, Object copy) To test the result of a deep copy function.static void
verifyDeepCopy
(Object source, Object copy, Collection<String> ignoreProperties) To test the result of a deep copy function.
-
Constructor Details
-
DeepCopyTestHelper
public DeepCopyTestHelper()
-
-
Method Details
-
verifyDeepCopy
To test the result of a deep copy function.The main focus is to check if the copy is independent from the source and does not have any reference to the source.
To check the equality of the objects the equals method should be implemented correctly.
- Parameters:
source
- the source objectcopy
- the result of the copy function
-
verifyDeepCopy
To test the result of a deep copy function.The main focus is to check if the copy is independent from the source and does not have any reference to the source. -> Deep Copy, instead of shallow copy
To check the equality of the objects the equals method should be implemented correctly.
- Parameters:
source
- the source objectcopy
- the result of the copy functionignoreProperties
- The top-level attribute names to be ignored
-