Ich bin ein Grails Plugin zu entwickeln, aber wenn ich versuche, einen Integrationstest für einen Dienst erstellen Ich erhalte diesen FehlerEntwicklung Grails Plugin „No Bean mit dem Namen‚transaction‘definiert“ in Integrationstest
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aService': Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:232)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:61)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:223)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:29)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.junit.runners.Suite.runChild(Suite.java:129)
at org.junit.runners.Suite.runChild(Suite.java:24)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:232)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:61)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:223)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at _GrailsTest_groovy$_run_closure4.doCall(_GrailsTest_groovy:290)
at _GrailsTest_groovy$_run_closure2.doCall(_GrailsTest_groovy:249)
at _GrailsTest_groovy$_run_closure1_closure21.doCall(_GrailsTest_groovy:195)
at _GrailsTest_groovy$_run_closure1.doCall(_GrailsTest_groovy:184)
at TestApp$_run_closure1.doCall(TestApp.groovy:82)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined
... 24 more
Wie kann ich es lösen?
Was testen Sie? Einheit? Integration? Regler? In welchem Ordner befinden sich Ihre Tests in Grals? Ich hatte nicht viel Erfolg mit Tests in Grails ... – marko
Ich habe versucht, einen Integrationstest für einen Service zu erstellen ... der Service bleibt im Standardordner von Grails, der Integrationstest bleibt im Standardordner von Grails ... der Fehler ist, nachdem ich 'Grails test-app: integration' gestartet habe, habe ich auch die Klasse mit @TestMixin (GrailsUnitTestMixin) kommentiert – rascio
Wenn Sie einen Integrationstest erstellen, müssen Sie es in ein Ordner namens Integration, unter Test/Integration denke ich. – marko