Refactor integration tests using DRY principle