File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/test/java/org/gitlab4j/api Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 5
5
import static org .junit .Assume .assumeTrue ;
6
6
7
7
import org .gitlab4j .api .GitLabApi .ApiVersion ;
8
+ import org .gitlab4j .api .models .Version ;
8
9
import org .junit .Before ;
9
10
import org .junit .BeforeClass ;
10
11
import org .junit .Test ;
@@ -60,6 +61,27 @@ public static void setup() {
60
61
problems += "TEST_PRIVATE_TOKEN cannot be empty\n " ;
61
62
}
62
63
64
+ if (problems .isEmpty ()) {
65
+ String savedVersion = null ;
66
+ try {
67
+ GitLabApi gitLabApi = new GitLabApi (ApiVersion .V4 , TEST_HOST_URL , TEST_PRIVATE_TOKEN );
68
+ Version version = gitLabApi .getVersion ();
69
+ savedVersion = version .getVersion ();
70
+ String [] parts = version .getVersion ().split ("." , -1 );
71
+ if (parts .length == 3 ) {
72
+ if (Integer .parseInt (parts [0 ]) < 10 ||
73
+ (Integer .parseInt (parts [0 ]) == 10 && Integer .parseInt (parts [1 ]) < 2 )) {
74
+ savedVersion = null ;
75
+ }
76
+ }
77
+ } catch (Exception e ) {
78
+ }
79
+
80
+ if (savedVersion != null ) {
81
+ problems += "GitLab version " + savedVersion + " does not support sessions\n " ;
82
+ }
83
+ }
84
+
63
85
if (!problems .isEmpty ()) {
64
86
System .err .print (problems );
65
87
}
You can’t perform that action at this time.
0 commit comments