Cleaned up integration test to reduce duplicate code.