You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can identify the target fields of the Object, which states should be tested.
Then we can add assertions only for them.
That allows to avoid reflection for creating expected Objects.
Suggested behavior
For example:
There is a method call that transforms initial Object(s) - and changes only particular fields:
we can add assertNotEquals(expectedValue, actualObject.fieldName) only for the changed fields.
Currently
Currently we get a test with assertEquals(expectedObject, actualObject), that compares actual and expected Objects totally. expectedObject is often created using Reflection, setting fields that we do not need to test.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Description
We can identify the target fields of the Object, which states should be tested.
Then we can add assertions only for them.
That allows to avoid reflection for creating expected Objects.
Suggested behavior
For example:
There is a method call that transforms initial Object(s) - and changes only particular fields:
assertNotEquals(expectedValue, actualObject.fieldName)only for the changed fields.Currently
Currently we get a test with
assertEquals(expectedObject, actualObject), that compares actual and expected Objects totally.expectedObjectis often created using Reflection, setting fields that we do not need to test.All reactions