I have a class that is only for json serialization with field access using Jackson , now I have a method that takes some inputs and create an instance of that class with properties populated using setters. To unit test this method, I need to compare every property of that class. Without public getters, it can only be done via reflection which I am trying to avoid. Also I don't want to override equals method on that class using all properties.
If I add getters, then I am changing the api of that class just for unit testing. What is the best solution in this case and why? Any thought on this will be appreciated. Thanks.