Refactored assertion of mapper is created in context