Refactor test application context.