Made test case more resilient against test ordering

This test suite uses a Spring context, but some tests modify the state of beans. They have been annotated with @DirtiesContext