Gradle multi-project build with test dependencies

Hi all,
I have a Gradle multi-project build with this folder structure:

Root
|- Commons
|  \- TestUtils
|- Services
   |- ProjectA
   \- ProjectB

In ProjectA and ProjectB i want to import as test dependency the module TestUtils. This module have an api dependency on spring-boot-starter-test to include JUnit, Mockito etc. and some common classes in src/main/groovy.

When I launch the integrationTest task that derive from ‘test-sets’ plugin seems that my classes are not in the classpath. The specific error message is: unable to resolve class …

This is a similar git repo to reproduce the error: https://github.com/fmonorchio/gradle_test_dependencies

Other info:
Gradle version: 5.2.1
IntelliJ inspections show no errors

I don’t know how to resolve this… Thanks!