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.Coordinates;
8   import com.jcabi.github.Fork;
9   import com.jcabi.github.Repo;
10  import java.io.IOException;
11  import org.hamcrest.MatcherAssert;
12  import org.hamcrest.Matchers;
13  import org.junit.jupiter.api.Disabled;
14  import org.junit.jupiter.api.Test;
15  
16  /**
17   * Test case for {@link MkForks}.
18   * @since 0.8
19   */
20  final class MkForksTest {
21  
22      @Test
23      @Disabled
24      void createsFork() throws IOException {
25          final MkForks forks = new MkForks(
26              new MkStorage.InFile(),
27              "Test", new Coordinates.Simple("tests", "forks")
28          );
29          MatcherAssert.assertThat(
30              "Value is null",
31              forks.create("blah"),
32              Matchers.notNullValue()
33          );
34      }
35  
36      @Test
37      void iteratesForks() throws IOException {
38          final Repo repo = new MkGitHub().randomRepo();
39          final Fork fork = repo.forks().create("Organization");
40          final Iterable<Fork> iterate = repo.forks().iterate("Order");
41          MatcherAssert.assertThat(
42              "Collection size is incorrect",
43              iterate,
44              Matchers.iterableWithSize(1)
45          );
46          MatcherAssert.assertThat(
47              "Collection does not contain expected item",
48              iterate,
49              Matchers.hasItem(fork)
50          );
51      }
52  }