Class QueryGenerator .. String generateQuery() { final String jsonString = anotherClass1.method(); final Map<String, List<POJO> map = someMethod1(jsonString); final List<POJO> pojos = someMethod2(map); final POJO chosen_pojo = anotherClass2.method(); final String query = ... //do something to generate the query; } .. someMethod1() { //do something}; someMethod2() { //do something}; } This class has a json string and retrieves a query string from it. In between, there are a lot of steps, (deserializing, storing to POJO etc), and each step is handled by a different class. All of these classes are called from this method.
For unit test, is it enough to test only the final step to ensure the query generated is correct? (If that step is correct, all steps above it is also correct, right?).