Home Grails 3: IllegalStateException after running integration test
Reply: 0

Grails 3: IllegalStateException after running integration test

user1832 Published in March 20, 2018, 5:19 pm

I keep getting an exception when I run my integration test:

import grails.testing.mixin.integration.Integration
import grails.transaction.Rollback
import org.springframework.beans.factory.annotation.Autowired
import spock.lang.Specification

class EmailSpec extends Specification {

    EmailService service

//    def setup() {
//    }
//    def cleanup() {
//    }

    def 'test send email'() {
        when: 'email gets sent'
        def sendMailCalled = false
        service.metaClass.sendTestEMail = {
            sendMailCalled = true

        sendMailCalled == true


"C:\Program Files\Java\jdk1.8.0_112\bin\java" -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2017.2.4\lib\idea_rt.jar=49498:C:\Program Files\JetBrains\IntelliJ IDEA 2017.2.4\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\user\AppData\Local\Temp\classpath.jar com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 "de.mypackeage.EmailSpec,test send email"

java.lang.IllegalStateException: No GORM implementations configured. Ensure GORM has been initialized correctly

    at org.grails.datastore.gorm.GormEnhancer.findSingleDatastore(GormEnhancer.groovy:380)
    at org.grails.datastore.gorm.GormEnhancer.findSingleTransactionManager(GormEnhancer.groovy:399)
    at de.mypackeage.EmailSpec.test send email(EmailSpec.groovy)

Process finished with exit code -1

The test already ran without problems but I don't really know why it would'nt run anymore. Any kind of help is appreciated.

The project is set up with Grails 3.3.1

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.344455 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO