use of com.jcabi.github.RepoCommit in project jcabi-github by jcabi.
the class MkContentsTest method canRemoveFile.
/**
* MkContents should be able to create new files.
*
* @throws Exception if some problem inside
*/
@Test
public void canRemoveFile() throws Exception {
final Repo repo = new MkGithub().randomRepo();
final String path = "removeme.txt";
this.createFile(repo, path);
final JsonObject json = MkContentsTest.content(path, "theDeleteMessage").add("committer", MkContentsTest.committer()).build();
final RepoCommit commit = repo.contents().remove(json);
MatcherAssert.assertThat(commit, Matchers.notNullValue());
MatcherAssert.assertThat(commit.json().getString("message"), Matchers.equalTo("theDeleteMessage"));
}
use of com.jcabi.github.RepoCommit in project jcabi-github by jcabi.
the class MkContentsTest method canRemoveFileFromBranch.
/**
* MkContents should be able to remove files from from non-default branches.
*
* @throws Exception if some problem inside
*/
@Test
public void canRemoveFileFromBranch() throws Exception {
final String branch = "branch-1";
final Repo repo = new MkGithub().randomRepo();
final String path = "removeme.txt";
this.createFile(repo, path);
final JsonObject json = MkContentsTest.content(path, "theDeleteMessage").add("ref", branch).add("committer", MkContentsTest.committer()).build();
final RepoCommit commit = repo.contents().remove(json);
MatcherAssert.assertThat(commit, Matchers.notNullValue());
MatcherAssert.assertThat(commit.json().getString("message"), Matchers.equalTo("theDeleteMessage"));
}
Aggregations