serenity-bdd / serenity-junit-starter

Apache License 2.0
53 stars 86 forks source link

Unable to generate serenity-reports #33

Open u-sandeep opened 1 year ago

u-sandeep commented 1 year ago

I see the below stack trace on standard output

java.lang.NoSuchMethodError: 'java.lang.Class org.junit.platform.engine.support.descriptor.MethodSource.getJavaClass()' at net.serenitybdd.junit5.SerenityTestExecutionListener.testingThisTest(SerenityTestExecutionListener.java:425) ~[serenity-junit5-3.1.15.jar:na] at net.serenitybdd.junit5.SerenityTestExecutionListener.testStarted(SerenityTestExecutionListener.java:396) ~[serenity-junit5-3.1.15.jar:na] at net.serenitybdd.junit5.SerenityTestExecutionListener.executionStarted(SerenityTestExecutionListener.java:236) ~[serenity-junit5-3.1.15.jar:na] at org.junit.platform.launcher.core.TestExecutionListenerRegistry$CompositeTestExecutionListener.lambda$executionStarted$6(TestExecutionListenerRegistry.java:99) ~[junit-platform-launcher-1.6.3.jar:1.6.3] at org.junit.platform.launcher.core.TestExecutionListenerRegistry.lambda$notifyEach$1(TestExecutionListenerRegistry.java:67) ~[junit-platform-launcher-1.6.3.jar:1.6.3] at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) ~[na:na]

java.lang.NoSuchMethodError: 'java.lang.reflect.Method org.junit.platform.engine.support.descriptor.MethodSource.getJavaMethod()' at net.serenitybdd.junit5.SerenityTestExecutionListener.updateResultsUsingTestAnnotations(SerenityTestExecutionListener.java:356) ~[serenity-junit5-3.1.15.jar:na] at net.serenitybdd.junit5.SerenityTestExecutionListener.testFinished(SerenityTestExecutionListener.java:334) ~[serenity-junit5-3.1.15.jar:na] at net.serenitybdd.junit5.SerenityTestExecutionListener.executionFinished(SerenityTestExecutionListener.java:277) ~[serenity-junit5-3.1.15.jar:na] at org.junit.platform.launcher.core.TestExecutionListenerRegistry$CompositeTestExecutionListener.lambda$executionFinished$10(TestExecutionListenerRegistry.java:109) ~[junit-platform-launcher-1.6.3.jar:1.6.3] at org.junit.platform.launcher.core.TestExecutionListenerRegistry.lambda$notifyEach$1(TestExecutionListenerRegistry.java:67) ~[junit-platform-launcher-1.6.3.jar:1.6.3] at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) ~[na:na]

u-sandeep commented 1 year ago

Dependencies used:

implementation('org.codehaus.groovy:groovy-all:3.0.13') { exclude group: 'org.codehaus.groovy', module: 'groovy-test-junit5' }

implementation 'org.springframework.cloud:spring-cloud-starter-config' implementation 'org.springframework.boot:spring-boot-starter-actuator:2.7.4' implementation 'org.springframework.cloud:spring-cloud-context' implementation 'org.springframework.security:spring-security-rsa'

testImplementation 'net.serenity-bdd:serenity-core:3.1.15' testImplementation "net.serenity-bdd:serenity-junit5:3.1.15" testImplementation "org.junit.jupiter:junit-jupiter-api:5.9.0" testImplementation "org.junit.jupiter:junit-jupiter-engine:5.9.0" testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.0' testImplementation 'org.junit.vintage:junit-vintage-engine:5.9.0' testImplementation 'net.serenity-bdd:serenity-rest-assured:3.1.15' testImplementation 'net.serenity-bdd:serenity-spring:3.1.15'

u-sandeep commented 1 year ago
Screenshot 2022-11-01 at 9 36 23 AM

This screenshot is from serenity-junit-starter project report

u-sandeep commented 1 year ago
Screenshot 2022-11-01 at 9 37 14 AM

This is from my project. I added spring integration also to the project by using @SpringBootTest annotation and running with @ExtendsWith(SerenityJunit5Extension.class)

Previously, we were using serenity, junit4 & springboot and running tests with @RunWith(SpringIntegrationSerenityRunner)...This works fine and reports are generated.