use of io.jenkins.blueocean.blueocean_bitbucket_pipeline.model.BbBranch in project blueocean-plugin by jenkinsci.
the class BitbucketApiTest method testDefaultBranchPre5_6_0.
@Test
public void testDefaultBranchPre5_6_0() {
BbBranch branch = api.getDefaultBranch("TESTP", "empty-repo-test");
assertNull(branch);
}
use of io.jenkins.blueocean.blueocean_bitbucket_pipeline.model.BbBranch in project blueocean-plugin by jenkinsci.
the class BitbucketApiTest method testDefaultBranch5_6_0.
@Test
public void testDefaultBranch5_6_0() {
BbBranch branch = api.getDefaultBranch("TESTP", "empty1");
assertNull(branch);
}
use of io.jenkins.blueocean.blueocean_bitbucket_pipeline.model.BbBranch in project blueocean-plugin by jenkinsci.
the class BitbucketApiTest method getRepoContent.
@Test
public void getRepoContent() throws JsonProcessingException, UnsupportedEncodingException {
BbBranch branch = api.getDefaultBranch("TESTP", "pipeline-demo-test");
assertNotNull(branch);
String content = api.getContent("TESTP", "pipeline-demo-test", "Jenkinsfile", branch.getLatestCommit());
assertEquals("node{\n" + " echo 'hello world'\n" + "}", content);
}
use of io.jenkins.blueocean.blueocean_bitbucket_pipeline.model.BbBranch in project blueocean-plugin by jenkinsci.
the class BitbucketApiTest method testEmptyRepo204.
@Test
public void testEmptyRepo204() {
BbBranch branch = api.getDefaultBranch("TESTP", "empty1");
assertNull(branch);
}
use of io.jenkins.blueocean.blueocean_bitbucket_pipeline.model.BbBranch in project blueocean-plugin by jenkinsci.
the class BitbucketApiTest method updateRepoContent.
@Test
public void updateRepoContent() throws JsonProcessingException, UnsupportedEncodingException {
BbBranch branch = api.getBranch("TESTP", "pipeline-demo-test", "master");
assertEquals("master", branch.getDisplayId());
assertTrue(branch instanceof BbServerBranch);
assertEquals("refs/heads/master", ((BbServerBranch) branch).getId());
assertNotNull(branch.getLatestCommit());
String content = api.getContent("TESTP", "pipeline-demo-test", "Jenkinsfile", branch.getLatestCommit());
assertEquals("node{\n" + " echo 'hello world'\n" + "}", content);
// update content
api.saveContent("TESTP", "pipeline-demo-test", "Jenkinsfile", "node{\n" + " echo 'hello world!'\n" + "}", "another commit", "master", null, branch.getLatestCommit());
}
Aggregations