Skip to content

Conversation

basil
Copy link
Member

@basil basil commented Feb 14, 2023

Serializing mock triggers is no longer supported in Java 17, so instead switch to a pure mock-based approach that does not require serialization. Tested by successfully running mvn clean verify -Dtest=org.jenkinsci.plugins.github.webhook.subscriber.DefaultPushGHEventListenerTest on both Java 11 and 17.

CC @KostyaSha

@basil
Copy link
Member Author

basil commented Feb 14, 2023

Used my admin powers to replay the build with the Jenkinsfile changes here: https://ci.jenkins.io/job/Plugins/job/github-plugin/job/PR-328/4/

@KostyaSha
Copy link
Member

Serializing mock triggers is no longer supported in Java 17,

why so?

@basil
Copy link
Member Author

basil commented Feb 15, 2023

See JENKINS-69353. Mockito-generated classes contain fields from the java.util.concurrent package, which is not open in https://github.com/jenkinsci/jenkins/blob/62c2fbcc7af34a2bc4edd67e46939fbe90f3b899/war/pom.xml#L228 (and therefore unavailable to XStream when running on Java 17). These tests were trying to serialize a job with a mock-based trigger with XStream. This PR solves the problem by avoiding XStream and using mocks consistently.

@KostyaSha KostyaSha merged commit d421694 into jenkinsci:master Feb 15, 2023
@basil basil deleted the JENKINS-69353 branch February 15, 2023 15:54
@basil
Copy link
Member Author

basil commented Feb 16, 2023

Thanks! A release of this would allow us to get rid of this hack in jenkinsci/bom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants