Fixing asynchronous unit-test