11package io .qameta .allure ;
22
3+ import io .github .glytching .junit .extension .system .SystemProperty ;
4+ import io .github .glytching .junit .extension .system .SystemPropertyExtension ;
35import io .qameta .allure .util .ResultsUtils ;
46import org .junit .jupiter .api .Test ;
7+ import org .junit .jupiter .api .extension .ExtendWith ;
58import org .junit .jupiter .params .ParameterizedTest ;
69import org .junit .jupiter .params .provider .Arguments ;
710import org .junit .jupiter .params .provider .MethodSource ;
2124/**
2225 * @author charlie (Dmitry Baev).
2326 */
27+ @ ExtendWith (SystemPropertyExtension .class )
2428class ResultsUtilsTest {
2529
2630 @ Test
@@ -68,16 +72,18 @@ public String type() {
6872 .hasFieldOrPropertyWithValue ("type" , "d_from_annotation" );
6973 }
7074
75+ @ SystemProperty (name = "allure.link.issue.pattern" , value = "https://example.org/issue/{}" )
7176 @ Test
7277 void shouldCreateIssueLink () {
7378 io .qameta .allure .model .Link actual = createIssueLink ("issue_link" );
7479 assertThat (actual )
7580 .isNotNull ()
7681 .hasFieldOrPropertyWithValue ("name" , "issue_link" )
77- .hasFieldOrPropertyWithValue ("url" , null )
82+ .hasFieldOrPropertyWithValue ("url" , "https://example.org/issue/issue_link" )
7883 .hasFieldOrPropertyWithValue ("type" , ISSUE_LINK_TYPE );
7984 }
8085
86+ @ SystemProperty (name = "allure.link.issue.pattern" , value = "https://example.org/issue/{}" )
8187 @ Test
8288 void shouldCreateIssueLinkFromAnnotation () {
8389 io .qameta .allure .model .Link actual = createLink (new Issue () {
@@ -94,20 +100,22 @@ public String value() {
94100 assertThat (actual )
95101 .isNotNull ()
96102 .hasFieldOrPropertyWithValue ("name" , "issue_link_from_annotation" )
97- .hasFieldOrPropertyWithValue ("url" , null )
103+ .hasFieldOrPropertyWithValue ("url" , "https://example.org/issue/issue_link_from_annotation" )
98104 .hasFieldOrPropertyWithValue ("type" , ISSUE_LINK_TYPE );
99105 }
100106
107+ @ SystemProperty (name = "allure.link.tms.pattern" , value = "https://example.org/tms/{}" )
101108 @ Test
102109 void shouldCreateTmsLink () {
103110 io .qameta .allure .model .Link actual = createTmsLink ("tms_link" );
104111 assertThat (actual )
105112 .isNotNull ()
106113 .hasFieldOrPropertyWithValue ("name" , "tms_link" )
107- .hasFieldOrPropertyWithValue ("url" , null )
114+ .hasFieldOrPropertyWithValue ("url" , "https://example.org/tms/tms_link" )
108115 .hasFieldOrPropertyWithValue ("type" , TMS_LINK_TYPE );
109116 }
110117
118+ @ SystemProperty (name = "allure.link.tms.pattern" , value = "https://example.org/tms/{}" )
111119 @ Test
112120 void shouldCreateTmsLinkFromAnnotation () {
113121 io .qameta .allure .model .Link actual = createLink (new TmsLink () {
@@ -124,7 +132,7 @@ public String value() {
124132 assertThat (actual )
125133 .isNotNull ()
126134 .hasFieldOrPropertyWithValue ("name" , "tms_link_from_annotation" )
127- .hasFieldOrPropertyWithValue ("url" , null )
135+ .hasFieldOrPropertyWithValue ("url" , "https://example.org/tms/tms_link_from_annotation" )
128136 .hasFieldOrPropertyWithValue ("type" , TMS_LINK_TYPE );
129137 }
130138
0 commit comments