Skip to content
Advertisement

Ignoring only embedded member in AssertJ

I have two classes to test with JUnit/Mockito:

JavaScript

Then in my test class, using AssertJ:

JavaScript

The problem is that the name sk is in both classes, and I need to ignore it only in ClassA, not in ClassB. Is this possible in AssertJ?

Advertisement

Answer

According to the ignoringFields javadoc:

Nested fields can be specified like this: home.address.street.

…so with your classes:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement