5
5
import io .jenkins .plugins .restlistparam .model .ValueItem ;
6
6
import io .jenkins .plugins .restlistparam .model .ResultContainer ;
7
7
import io .jenkins .plugins .restlistparam .model .ValueOrder ;
8
- import org .junit .Assert ;
9
- import org .junit .Test ;
8
+ import org .junit .jupiter .api .Test ;
10
9
11
10
import java .util .List ;
12
11
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
+
13
17
// Task for later: more unit tests here (preferably replace integration tests)
14
- public class RestValueServiceTest {
18
+ class RestValueServiceTest {
19
+
15
20
@ Test
16
- public void successfulGetIntegrationTest () {
21
+ void successfulGetIntegrationTest () {
17
22
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" ,
19
24
null ,
20
25
MimeType .APPLICATION_JSON ,
21
26
0 ,
22
27
"$.*.name" ,
23
28
"$" ,
24
29
null ,
25
30
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 ());
28
33
}
29
34
30
35
@ Test
31
- public void unsuccessfulGetIntegrationTest () {
36
+ void unsuccessfulGetIntegrationTest () {
32
37
ResultContainer <List <ValueItem >> test = RestValueService
33
38
.get ("https://gitlab.example.com/api/v4/projects/gitlab-org%2Fgitlab-runner/releases" ,
34
39
null ,
@@ -38,8 +43,8 @@ public void unsuccessfulGetIntegrationTest() {
38
43
"$" ,
39
44
null ,
40
45
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 ());
44
49
}
45
50
}
0 commit comments