Skip to content
This repository has been archived by the owner on Aug 18, 2022. It is now read-only.

junit cleanup to make useable with cucumber-junit-platform-engine #36

Closed
wants to merge 5 commits into from

Conversation

nicerloop
Copy link

@nicerloop nicerloop commented Sep 13, 2021

I try to use serenity with cucumber-junit-platform-engine. This applies equally to serenity-cucumber5 and serenity-cucumber6, as the assumption that cucumber scenarios are launched from junit4 still holds and creates exactly the same problems.

I have published a reproduction example: https://github.com/nicerloop/serenity-cucumber-starter/tree/use-cucumber-junit-platform-engine

#35

@nicerloop nicerloop changed the title Junit cleanup to make useable with cucumber-junit-platform-engine junit cleanup to make useable with cucumber-junit-platform-engine Sep 13, 2021
@@ -896,7 +895,7 @@ private boolean errorOrFailureRecordedForStep(String stepTitle, Throwable cause)
}

private boolean isAssumptionFailure(Throwable rootCause) {
return (AssumptionViolatedException.class.isAssignableFrom(rootCause.getClass()));
return ("org.junit.internal.AssumptionViolatedException".equals(rootCause.getClass().getCanonicalName()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These statements are not equivalent though - the class may also be derived from org.junit.internal.AssumptionViolatedException

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, better use Class.forName with a try-catch block.

@nicerloop
Copy link
Author

Obsoleted by serenity-bdd/serenity-core#2648

@nicerloop nicerloop closed this Dec 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants