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 55import static org .junit .Assume .assumeTrue ;
66
77import org .gitlab4j .api .GitLabApi .ApiVersion ;
8+ import org .gitlab4j .api .models .Version ;
89import org .junit .Before ;
910import org .junit .BeforeClass ;
1011import org .junit .Test ;
@@ -60,6 +61,27 @@ public static void setup() {
6061 problems += "TEST_PRIVATE_TOKEN cannot be empty\n " ;
6162 }
6263
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+
6385 if (!problems .isEmpty ()) {
6486 System .err .print (problems );
6587 }
You can’t perform that action at this time.
0 commit comments