use of org.jenkinsci.plugins.github_branch_source.PullRequestSCMHead in project blueocean-plugin by jenkinsci.
the class PipelineJobFiltersTest method testIsPullRequest.
@Test
public void testIsPullRequest() {
BlueOrganization organization = mockOrganization();
OrganizationFolder organizationFolder = mockOrgFolder(organization);
PullRequestSCMHead changeRequestSCMHead = mock(PullRequestSCMHead.class);
mockStatic(SCMHead.HeadByItem.class);
when(SCMHead.HeadByItem.findHead(organizationFolder)).thenReturn(changeRequestSCMHead);
assertTrue(PipelineJobFilters.isPullRequest(organizationFolder));
assertFalse(new PipelineJobFilters.OriginFilter().getFilter().apply(organizationFolder));
assertTrue(new PipelineJobFilters.PullRequestFilter().getFilter().apply(organizationFolder));
}
Aggregations