Adapt unit tests to refactoring