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 jakarta.json.Json;
8   import jakarta.json.JsonObject;
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   * Testcase for MkTags.
16   * @since 0.6
17   * @checkstyle MultipleStringLiterals (500 lines)
18   */
19  final class MkTagsTest {
20  
21      @Test
22      void createsMkTag() throws IOException {
23          final JsonObject tagger = Json.createObjectBuilder()
24              .add("name", "Scott").add("email", "Scott@gmail.com").build();
25          MatcherAssert.assertThat(
26              "Value is null",
27              new MkGitHub().randomRepo().git().tags().create(
28                  Json.createObjectBuilder().add("name", "v.0.1")
29                      .add("message", "test tag").add("sha", "abcsha12")
30                      .add("tagger", tagger).build()
31              ),
32              Matchers.notNullValue()
33          );
34      }
35  }