use of io.jenkins.blueocean.blueocean_bitbucket_pipeline.server.BitbucketServerScmContentProvider in project blueocean-plugin by jenkinsci.
the class BitbucketCloudScmContentProviderTest method checkScmProperties.
@Test
public void checkScmProperties() throws Exception {
// ensure cloud provider works with cloud multibranch pipeline
String credentialId = createCredential(BitbucketCloudScm.ID, authenticatedUser);
MultiBranchProject mbp = mockMbp(credentialId);
ScmContentProvider provider = new BitbucketCloudScmContentProvider();
// unfortunately overriding the apiUrl for WireMock returns a "localhost" URL here, so we mock the call
when(((BitbucketSCMSource) mbp.getSCMSources().get(0)).getServerUrl()).thenReturn(BitbucketCloudScm.API_URL);
assertTrue(provider.support(mbp));
assertEquals(provider.getScmId(), BitbucketCloudScm.ID);
assertEquals(provider.getApiUrl(mbp), BitbucketCloudScm.API_URL);
// ensure server provider doesn't work with cloud multibranch pipeline
provider = new BitbucketServerScmContentProvider();
assertFalse(provider.support(mbp));
}
Aggregations