Refactored test message resolution and Spring context creation.