refactored test with a proper setup
debug logging should use println() instead of print() or else all logging shows up on one line which is a bit useless.