Extraced some duplicated code in integration tests to a helper class