Error: Execution failed for task ':compileTestJava'

I’m trying to build a project with Java and I’m getting this error. I tried searching online to no avail.
Let’s hope someone can help me here.
This is the full stacktrace log:

Do you have JUnit as a dependency?