I am currently working on a project which transforms input data from a rest service for another service. The data we receive has probably around 50 properties. In our tests we load a JSON file and map it to the model object. That works, until we do some changes to the model and have to re-new the test data. If we generate one with the frontend and it differs from before, tests may break because they relied on specific permutations. That's bad.
Usually I try to set all data in the "when" part of my unit tests, but having such a huge model makes it hard to do so. But since we have a lot of smaller methods inside the mapping classes which are private, I cannot test them seperately. For example:
So, my question here is: would it be a bad idea to change the modifiers to access the private methods directly? If so, why? I mean, I don't want to make them public, but at least make them package private. Of course there needs to be a test for the map method as well, which has to contain a complete data set for the InputData, but for all other methods as well?
Thanks in advance.