-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JAVACLIENT-143: Fix IllegalArgumentException base64 of login:password…
… is longer than 75
- Loading branch information
1 parent
bae86de
commit 4f78225
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,12 +20,14 @@ | |
package org.nuxeo.client; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertNotNull; | ||
import static org.junit.Assert.assertTrue; | ||
import static org.junit.Assert.fail; | ||
|
||
import org.junit.Test; | ||
import org.nuxeo.client.objects.user.User; | ||
import org.nuxeo.client.objects.user.UserManager; | ||
import org.nuxeo.client.spi.NuxeoClientRemoteException; | ||
|
||
/** | ||
|
@@ -72,4 +74,24 @@ public void itCanChangeAuthMethod() { | |
assertEquals("Administrator", currentUser.getUserName()); | ||
} | ||
|
||
@Test | ||
public void itCanLoginWithLongCredentials() { | ||
UserManager userManager = ITBase.createClientBuilder().connect().userManager(); | ||
|
||
String email = "[email protected]"; | ||
String password = "verylongpassword0123456789"; | ||
// first create user | ||
User user = new User(); | ||
user.setUserName(email); | ||
user.setEmail(email); | ||
user.setPassword(password); | ||
userManager.createUser(user); | ||
// now test | ||
User currentUser = ITBase.createClient(email, password).getCurrentUser(); | ||
assertEquals(email, currentUser.getUserName()); | ||
assertFalse(currentUser.isAdministrator()); | ||
// delete it | ||
userManager.deleteUser(email); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters