View Javadoc
1   /*
2    * SPDX-FileCopyrightText: Copyright (c) 2013-2025 Yegor Bugayenko
3    * SPDX-License-Identifier: MIT
4    */
5   package com.jcabi.github;
6   
7   import jakarta.json.Json;
8   import java.io.IOException;
9   import org.hamcrest.MatcherAssert;
10  import org.hamcrest.Matchers;
11  import org.junit.jupiter.api.Test;
12  
13  /**
14   * Integration case for {@link RtMarkdown}.
15   * @since 0.8
16   */
17  @OAuthScope(OAuthScope.Scope.REPO)
18  final class RtMarkdownITCase {
19  
20      @Test
21      void rendersMarkdown() throws IOException {
22          final GitHub github = GitHubIT.connect();
23          MatcherAssert.assertThat(
24              "Values are not equal",
25              github.markdown().render(
26                  Json.createObjectBuilder()
27                      .add("text", "Hello, **world**!")
28                      .build()
29              ),
30              Matchers.equalTo("<p>Hello, <strong>world</strong>!</p>\n")
31          );
32      }
33  
34      @Test
35      void rendersRawMarkdown() throws IOException {
36          final GitHub github = GitHubIT.connect();
37          MatcherAssert.assertThat(
38              "Values are not equal",
39              github.markdown().raw(
40                  "Hey, **world**!"
41              ),
42              Matchers.equalTo("<p>Hey, <strong>world</strong>!</p>\n")
43          );
44      }
45  
46  }