JenkinsPipelineUnit question: does a jenkins/plugin command have to already be registered in BasePipelineTest to be mockable?

Hello! Hopefully this is an appropriate forum to be asking this question, but I am wondering if anybody can help clarify part of the JenkinsPipelineUnit ReadMe. Basically in the section on mocking jenkins commands (GitHub - jenkinsci/JenkinsPipelineUnit: Framework for unit testing Jenkins pipelines) there is a sentence " Please refer to the BasePipelineTest class for the list of currently supported mocks."

This sentence reads as if to say that if a jenkins command is not already registered in BasePipelineTest, then it cannot be mocked by JenkinsPipelineUnit.

This is ambiguous though, as a few sentences above, the documentation states " The test helper already includes mocks for all base pipeline steps as well as a steps from a few widely-used plugins. You need to register allowed methods if you want to override these mocks and add others."

Here I feel that I’m lead to believe that I can mock methods that aren’t already registered in BasePipelineTest simply by making a call to helper.registerAllowedMethod. Does anybody happen to know what the correct interpretation is? I attempted to open an issue to have this section of the documentation revised to be more clear but GitHub keeps displaying an error whenever I try to submit the issue. Figured I should at least try to ask in this forum to see if anyone might have an answer. :sweat_smile:

You may find inspiration in the test suite of the Pipeline library that is used for ci.jenkins.io. It uses PipelineUnit.