refactoring spring life circle test case