1
2
3
4
5 package com.jcabi.github.mock;
6
7 import com.jcabi.github.Tag;
8 import jakarta.json.Json;
9 import jakarta.json.JsonObject;
10 import java.io.IOException;
11 import org.hamcrest.MatcherAssert;
12 import org.hamcrest.Matchers;
13 import org.junit.jupiter.api.Test;
14
15
16
17
18
19
20 final class MkTagTest {
21
22
23
24
25
26 @Test
27 void fetchesContent() throws Exception {
28 MatcherAssert.assertThat(
29 "Values are not equal",
30 MkTagTest.tag().json().getString("message"),
31 Matchers.is("\"test tag\"")
32 );
33 }
34
35
36
37
38
39 private static Tag tag() throws IOException {
40 final JsonObject json = Json.createObjectBuilder()
41 .add("sha", "abcsha12").add("message", "test tag")
42 .add("name", "v.0.1").build();
43 return new MkGitHub().randomRepo().git().tags().create(json);
44 }
45
46 }