Generally, the subquery junit tests should focus on operations that can not be accessed in a single query without a subquery, like joining after grouping, counting (or other grouping) after grouping, grouping after applying a limit, joining after applying a limit, (are there other cases?).

The best way to quickly write test cases around queries that can be expressed either with or without subqueries is to run the queries both ways. Then, you don't have to calculate the specific result expected. Just initialize an array of query pairs and run a loop that makes sure that both queries in each pair compile and run and produce an identical result.