View Javadoc
1   /*
2    * SPDX-FileCopyrightText: Copyright (c) 2013-2025 Yegor Bugayenko
3    * SPDX-License-Identifier: MIT
4    */
5   package com.jcabi.github.mock;
6   
7   import com.jcabi.github.GitHub;
8   import com.jcabi.github.UserOrganizations;
9   import java.io.IOException;
10  import org.hamcrest.MatcherAssert;
11  import org.hamcrest.Matchers;
12  import org.junit.jupiter.api.Test;
13  
14  /**
15   * GitHub user organizations.
16   * @see <a href="https://developer.github.com/v3/orgs/">Organizations API</a>
17   * @since 0.24
18   * @checkstyle MultipleStringLiteralsCheck (500 lines)
19   */
20  final class MkUserOrganizationsTest {
21      @Test
22      void iteratesUserOrganizations() throws IOException {
23          final String login = "orgTestIterate";
24          final GitHub github = new MkGitHub(login);
25          final UserOrganizations orgs = github.users().get(login)
26              .organizations();
27          github.organizations().get(login);
28          MatcherAssert.assertThat(
29              "Collection size is incorrect",
30              orgs.iterate(),
31              Matchers.iterableWithSize(1)
32          );
33      }
34  }