samedi 6 octobre 2018

Cannot get to the bottom of NoClassDefFoundError error in Groovy test

I am trying to run a very simple test in groovy and just when it starts to run the test I am getting the following exception:

java.lang.NoClassDefFoundError: org/spockframework/runtime/ErrorCollector

at com.imanage.runner.ExcelReportTests.Create simple client fetch report in excel(ExcelReportTests.groovy)
Caused by: java.lang.ClassNotFoundException: 
org.spockframework.runtime.ErrorCollector
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 1 more

I have tried to debug the test but I cant find where it is falling over, there is just no more information, can anyone explain why the test is failing? Running in intelliJ if that makes a difference.

class ExcelReportTests extends Specification {
    def setup() {
        println "This will work"
    }
    def "Just a test"() {
        when:
            println "This is not printed"
        then:
            assert 1 == 1
    }
}

I have checked all the imports and they look fine, we use gradle for dependancy management and I cleared its cache too.

Aucun commentaire:

Enregistrer un commentaire