Migrating from Spring 3.2.x to Spring 4 and using ‘spring-mock 2.0.8’ gives “java.lang.NoSuchMethodError: org.springframework.core.CollectionFactory.createLinkedMapIfPossible”

So this is a very short post, with a ‘gotcha’. I wasn’t able to find anything about this, thats why I write it down here right now: If you are migrating from Spring 3 to 4 and you have in your pom.xml the following dependency: <properties> <spring.version>3.2.4.RELEASE</spring.version> <junit.version>4.9</junit.version> </properties> … <dependency> <groupId>org.springframework</groupId> <artifactId>spring-mock</artifactId> <version>2.0.8</version> <scope>test</scope> […]