1515 * In order for these tests to run you must set the following properties in test-gitlab4j.properties
1616 *
1717 * TEST_HOST_URL
18- * TEST_USERNAME
19- * TEST_PASSWORD
18+ * TEST_LOGIN_USERNAME
19+ * TEST_LOGIN_PASSWORD
2020 * TEST_PRIVATE_TOKEN
2121 *
2222 * If any of the above are NULL, all tests in this class will be skipped.
2323 */
2424public class TestGitLabLogin {
2525
2626 // The following needs to be set to your test repository
27- private static final String TEST_USERNAME ;
28- private static final String TEST_PASSWORD ;
27+ private static final String TEST_LOGIN_USERNAME ;
28+ private static final String TEST_LOGIN_PASSWORD ;
2929 private static final String TEST_HOST_URL ;
3030 private static final String TEST_PRIVATE_TOKEN ;
3131 static {
32- TEST_USERNAME = TestUtils .getProperty ("TEST_USERNAME " );
33- TEST_PASSWORD = TestUtils .getProperty ("TEST_PASSWORD " );
32+ TEST_LOGIN_USERNAME = TestUtils .getProperty ("TEST_LOGIN_USERNAME " );
33+ TEST_LOGIN_PASSWORD = TestUtils .getProperty ("TEST_LOGIN_PASSWORD " );
3434 TEST_HOST_URL = TestUtils .getProperty ("TEST_HOST_URL" );
3535 TEST_PRIVATE_TOKEN = TestUtils .getProperty ("TEST_PRIVATE_TOKEN" );
3636 }
@@ -47,12 +47,12 @@ public static void setup() {
4747
4848 problems = "" ;
4949
50- if (TEST_USERNAME == null || TEST_USERNAME .trim ().length () == 0 ) {
51- problems += "TEST_USERNAME cannot be empty\n " ;
50+ if (TEST_LOGIN_USERNAME == null || TEST_LOGIN_USERNAME .trim ().length () == 0 ) {
51+ problems += "TEST_LOGIN_USERNAME cannot be empty\n " ;
5252 }
5353
54- if (TEST_PASSWORD == null || TEST_PASSWORD .trim ().length () == 0 ) {
55- problems += "TEST_PASSWORD cannot be empty\n " ;
54+ if (TEST_LOGIN_PASSWORD == null || TEST_LOGIN_PASSWORD .trim ().length () == 0 ) {
55+ problems += "TEST_LOGIN_PASSWORD cannot be empty\n " ;
5656 }
5757
5858 if (TEST_HOST_URL == null || TEST_HOST_URL .trim ().length () == 0 ) {
@@ -93,7 +93,7 @@ public void beforeMethod() {
9393 public void testSession () throws GitLabApiException {
9494
9595 assumeTrue (hasSession );
96- GitLabApi gitLabApi = GitLabApi .login (ApiVersion .V4 , TEST_HOST_URL , TEST_USERNAME , TEST_PASSWORD );
96+ GitLabApi gitLabApi = GitLabApi .login (ApiVersion .V4 , TEST_HOST_URL , TEST_LOGIN_USERNAME , TEST_LOGIN_PASSWORD );
9797 assertNotNull (gitLabApi );
9898 assertNotNull (gitLabApi .getSession ());
9999 assertEquals (TEST_PRIVATE_TOKEN , gitLabApi .getSession ().getPrivateToken ());
@@ -104,7 +104,7 @@ public void testSession() throws GitLabApiException {
104104 public void testSessionV3 () throws GitLabApiException {
105105
106106 assumeTrue (hasSession );
107- GitLabApi gitLabApi = GitLabApi .login (ApiVersion .V3 , TEST_HOST_URL , TEST_USERNAME , TEST_PASSWORD );
107+ GitLabApi gitLabApi = GitLabApi .login (ApiVersion .V3 , TEST_HOST_URL , TEST_LOGIN_USERNAME , TEST_LOGIN_PASSWORD );
108108 assertNotNull (gitLabApi );
109109 assertNotNull (gitLabApi .getSession ());
110110 assertEquals (TEST_PRIVATE_TOKEN , gitLabApi .getSession ().getPrivateToken ());
@@ -114,7 +114,7 @@ public void testSessionV3() throws GitLabApiException {
114114 public void testSessionFallover () throws GitLabApiException {
115115
116116 assumeFalse (hasSession );
117- GitLabApi gitLabApi = GitLabApi .login (ApiVersion .V4 , TEST_HOST_URL , TEST_USERNAME , TEST_PASSWORD );
117+ GitLabApi gitLabApi = GitLabApi .login (ApiVersion .V4 , TEST_HOST_URL , TEST_LOGIN_USERNAME , TEST_LOGIN_PASSWORD );
118118 assertNotNull (gitLabApi );
119119 Version version = gitLabApi .getVersion ();
120120 assertNotNull (version );
@@ -123,7 +123,7 @@ public void testSessionFallover() throws GitLabApiException {
123123 @ Test
124124 public void testOauth2Login () throws GitLabApiException {
125125
126- GitLabApi gitLabApi = GitLabApi .oauth2Login (TEST_HOST_URL , TEST_USERNAME , TEST_PASSWORD , null , null , true );
126+ GitLabApi gitLabApi = GitLabApi .oauth2Login (TEST_HOST_URL , TEST_LOGIN_USERNAME , TEST_LOGIN_PASSWORD , null , null , true );
127127 assertNotNull (gitLabApi );
128128 Version version = gitLabApi .getVersion ();
129129 assertNotNull (version );
0 commit comments