use of com.jcabi.github.Repo in project jcabi-github by jcabi.
the class MkPullRefTest method fetchesRepo.
/**
* MkPullRef can fetch its repo.
* @throws IOException If there is an I/O problem
*/
@Test
public void fetchesRepo() throws IOException {
final MkStorage storage = new MkStorage.InFile();
final Repo repo = new MkGithub(storage, MkPullRefTest.USERNAME).randomRepo();
MatcherAssert.assertThat(MkPullRefTest.pullRef(storage, repo).repo().coordinates(), Matchers.equalTo(repo.coordinates()));
}
use of com.jcabi.github.Repo in project jcabi-github by jcabi.
the class MkPullsTest method canCreateAPull.
/**
* MkPulls can create a pull.
* It should create an issue first, and then pull with the same number
* @throws Exception if some problem inside
*/
@Test
public void canCreateAPull() throws Exception {
final Repo repo = new MkGithub().randomRepo();
final Pull pull = repo.pulls().create("hello", "head-branch", "base-branch");
final Issue.Smart issue = new Issue.Smart(repo.issues().get(pull.number()));
MatcherAssert.assertThat(issue.title(), Matchers.is("hello"));
}
use of com.jcabi.github.Repo in project jcabi-github by jcabi.
the class MkReferencesTest method iteratesReferencesInSubNamespace.
/**
* MkReferences can iterate over references in sub-namespace.
* @throws Exception - If something goes wrong.
*/
@Test
public void iteratesReferencesInSubNamespace() throws Exception {
final Repo owner = new MkGithub().randomRepo();
final References refs = owner.git().references();
refs.create("refs/heads/br", "qweqwe");
refs.create("refs/tags/t1", "111t222");
MatcherAssert.assertThat(refs.iterate("heads"), Matchers.<Reference>iterableWithSize(1));
MatcherAssert.assertThat(refs.iterate("tags"), Matchers.<Reference>iterableWithSize(1));
}
use of com.jcabi.github.Repo in project jcabi-github by jcabi.
the class MkReferencesTest method iteratesHeads.
/**
* MkReferences can iterate over references in Tagsub-namespace.
* @throws Exception - If something goes wrong.
*/
@Test
public void iteratesHeads() throws Exception {
final Repo owner = new MkGithub().randomRepo();
final References refs = owner.git().references();
refs.create("refs/heads/branch2", "blahblah");
MatcherAssert.assertThat(refs.heads(), Matchers.<Reference>iterableWithSize(1));
}
use of com.jcabi.github.Repo in project jcabi-github by jcabi.
the class MkSearchTest method canSearchForIssues.
/**
* MkSearch can search for issues.
*
* @throws Exception if a problem occurs
*/
@Test
public void canSearchForIssues() throws Exception {
final MkGithub github = new MkGithub();
final Repo repo = github.repos().create(new Repos.RepoCreate("TestIssues", false));
repo.issues().create("test issue", "TheTest");
MatcherAssert.assertThat(github.search().issues("TheTest", "updated", Search.Order.DESC, new EnumMap<Search.Qualifier, String>(Search.Qualifier.class)), Matchers.not(Matchers.emptyIterable()));
}
Aggregations