Edit: Just checked again for some reason the classpath gets screwed for this specific project :S...
Importing should still work you will probably get a compilation error (although it might simply work due to all libraries are included on the classpath).
Edit2: Fixing/cleaning the build file for another issue introduced this. The springframework-test should be a compile not testCompile dependency (to much cleanup) and it works in STS flawlessly because everything is merged into a single classpath. It only fails on the command line. (This is what you get without a CI server ).
Download the build.gradle for chapter2-samples from github and replace your current one with it or add the code snippet below to the build.gradle for chapter2-samples.