CircleCI tries to cache artifacts. For that, it also caches the
.gradle directory (see https://circleci.com/docs/how-cache-works). The issue with the current setup is that the cache is saved before gradle test runs. Thus, any dependencies fetched by gradle are not cached. Why is the caching not run after the build? In other words: Why comes the “database” phase before the “test” phase?
I know that there is a workaround (http://stackoverflow.com/questions/21814652/how-to-download-dependencies-in-gradle/27455099#27455099), but that does not work for all build dependencies fetched by gradle.