Search in sources :

Example 1 with UserOrganizations

use of com.jcabi.github.UserOrganizations in project jcabi-github by jcabi.

the class MkUserTest method testGetOrganizations.

/**
 * Tests that MkUser.organizations() returns a value.
 *
 * @throws IOException when there is an error creating the MkUser begin tested
 */
@Test
public void testGetOrganizations() throws IOException {
    final MkUser user = new MkUser(new MkStorage.InFile(), "orgTestIterate");
    final UserOrganizations orgs = user.organizations();
    MatcherAssert.assertThat(orgs, Matchers.notNullValue());
}
Also used : UserOrganizations(com.jcabi.github.UserOrganizations) Test(org.junit.Test)

Example 2 with UserOrganizations

use of com.jcabi.github.UserOrganizations in project jcabi-github by jcabi.

the class MkUserOrganizationsTest method iteratesUserOrganizations.

/**
 * MkUserOrganizations can list user organizations.
 * @throws Exception If some problem inside
 */
@Test
public void iteratesUserOrganizations() throws Exception {
    final String login = "orgTestIterate";
    final Github github = new MkGithub(login);
    final UserOrganizations userOrgs = github.users().get(login).organizations();
    github.organizations().get(login);
    MatcherAssert.assertThat(userOrgs.iterate(), Matchers.<Organization>iterableWithSize(1));
}
Also used : Github(com.jcabi.github.Github) UserOrganizations(com.jcabi.github.UserOrganizations) Test(org.junit.Test)

Aggregations

UserOrganizations (com.jcabi.github.UserOrganizations)2 Test (org.junit.Test)2 Github (com.jcabi.github.Github)1