55import io .jenkins .plugins .restlistparam .model .ValueItem ;
66import io .jenkins .plugins .restlistparam .model .ResultContainer ;
77import io .jenkins .plugins .restlistparam .model .ValueOrder ;
8- import org .junit .Assert ;
9- import org .junit .Test ;
8+ import org .junit .jupiter .api .Test ;
109
1110import java .util .List ;
1211
12+ import static org .junit .jupiter .api .Assertions .assertEquals ;
13+ import static org .junit .jupiter .api .Assertions .assertFalse ;
14+ import static org .junit .jupiter .api .Assertions .assertNotNull ;
15+ import static org .junit .jupiter .api .Assertions .assertTrue ;
16+
1317// Task for later: more unit tests here (preferably replace integration tests)
14- public class RestValueServiceTest {
18+ class RestValueServiceTest {
19+
1520 @ Test
16- public void successfulGetIntegrationTest () {
21+ void successfulGetIntegrationTest () {
1722 ResultContainer <List <ValueItem >> test = RestValueService
18- .get ("http ://api.github.com/repos/jellyfin/jellyfin/tags?per_page=3" ,
23+ .get ("https ://api.github.com/repos/jellyfin/jellyfin/tags?per_page=3" ,
1924 null ,
2025 MimeType .APPLICATION_JSON ,
2126 0 ,
2227 "$.*.name" ,
2328 "$" ,
2429 null ,
2530 ValueOrder .NONE );
26- Assert . assertFalse (test .getErrorMsg ().isPresent ());
27- Assert . assertEquals (3 , test .getValue ().size ());
31+ assertFalse (test .getErrorMsg ().isPresent ());
32+ assertEquals (3 , test .getValue ().size ());
2833 }
2934
3035 @ Test
31- public void unsuccessfulGetIntegrationTest () {
36+ void unsuccessfulGetIntegrationTest () {
3237 ResultContainer <List <ValueItem >> test = RestValueService
3338 .get ("https://gitlab.example.com/api/v4/projects/gitlab-org%2Fgitlab-runner/releases" ,
3439 null ,
@@ -38,8 +43,8 @@ public void unsuccessfulGetIntegrationTest() {
3843 "$" ,
3944 null ,
4045 ValueOrder .NONE );
41- Assert . assertNotNull (test );
42- Assert . assertTrue (test .getErrorMsg ().isPresent ());
43- Assert . assertEquals (0 , test .getValue ().size ());
46+ assertNotNull (test );
47+ assertTrue (test .getErrorMsg ().isPresent ());
48+ assertEquals (0 , test .getValue ().size ());
4449 }
4550}
0 commit comments