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.Issue;
8   import com.jcabi.github.Pull;
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 MkPulls}.
18   * @since 1.0
19   * @checkstyle MultipleStringLiteralsCheck (100 lines)
20   */
21  final class MkPullsTest {
22  
23      /**
24       * MkPulls can create a pull.
25       * It should create an issue first, and then pull with the same number
26       */
27      @Test
28      void canCreateAPull() throws IOException {
29          final Repo repo = new MkGitHub().randomRepo();
30          final Pull pull = repo.pulls().create(
31              "hello",
32              "head-branch",
33              "base-branch"
34          );
35          final Issue.Smart issue = new Issue.Smart(
36              repo.issues().get(pull.number())
37          );
38          MatcherAssert.assertThat(
39              "Values are not equal",
40              issue.title(),
41              Matchers.is("hello")
42          );
43      }
44  
45      @Test
46      @Disabled
47      void canFetchEmptyListOfPulls() {
48          // to be implemented
49      }
50  
51      @Test
52      @Disabled
53      void canFetchSinglePull() {
54          // to be implemented
55      }
56  }