'buildAndAssertStatus throwing missingMethodError exception

I am getting this exception in buildAndAssertStatus groovy.lang.MissingMethodException: No signature of method: org.jvnet.hudson.test.JenkinsRule.buildAndAssertStatus() is applicable for argument types: (hudson.model.Result, org.jenkinsci.plugins.workflow.job.WorkflowJob) values: [UNSTABLE, org.jenkinsci.plugins.workflow.job.WorkflowJob@2170e76b[test0]]

Here is the code I used, WorkflowRun result = rule.buildAndAssertStatus(Result.UNSTABLE, workflowJob)

The method signature looks correct to me https://github.com/jenkinsci/jenkins-test-harness/blob/81747d595863b1232febe1ac4a6e38c02d80e9a3/src/main/java/org/jvnet/hudson/test/JenkinsRule.java#L1413, what I am doing wrong here?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source