You need a valid Jenkins context to use this class. Simply removing
@WithoutJenkins annotation from the test method should fix it.

Vincent


Le ven. 13 juin 2025 à 12:19, Radek Antoniuk <[email protected]> a
écrit :

> I'm updating the jira-plugin to the next LTS and one test suddenly started
> failing with:
>
> Found no instances of hudson.model.Job$BuildNumberAssigner registered
> java.lang.IllegalStateException
>  at hudson.ExtensionList.lookupFirst(ExtensionList.java:482)
>  at hudson.model.Job.assignBuildNumber(Job.java:345)
>  at hudson.model.Run.<init>(Run.java:324)
>  at
> org.jenkinsci.plugins.workflow.job.WorkflowRun.<init>(WorkflowRun.java:250)
>  at
> hudson.plugins.jira.UpdaterTest.getChangesUsingReflectionForWorkflowJob(UpdaterTest.java:313)
>  at java.base/java.lang.reflect.Method.invoke(Method.java:569)
>  at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
>  at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
>
> Test:
>
> https://github.com/jenkinsci/jira-plugin/blob/master/src/test/java/hudson/plugins/jira/UpdaterTest.java#L304
>
> I tried to find any changes around Reflection API but I don't see anything
> and just wanted to make sure this a test/mock problem or an issue somewhere
> else.
>
> Thanks,
> Radek
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/jenkinsci-dev/9420553c-aaa6-45b6-b493-54e473b9e3ffn%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/9420553c-aaa6-45b6-b493-54e473b9e3ffn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAH-zGCjVGaxashdGoU4GA2s1pAPU7jAgnExxEC%2BUYWx6eJwtog%40mail.gmail.com.

Reply via email to