refactored unit test for async and akka rest calls