However what we are doing here isn't 'unit testing' its a black box integration testing. When I write equivalent code in scala, i just test the logic via unit tests,
eg: logic to filter out some orders that don't qualify, I extract method in scala code and just test that logic as part of development lifecycle. There is no dependency on a database.
Analog here is using selenium or some ui testing framework to test if button turns blue if order exceeds limit. Thats not unit testing.