Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Issue 21392 (#21410)
* #21392 do not return a user * #21392 user id immutable * #21392 Fixing typo Co-authored-by: Will Ezell <will@dotcms.com> Co-authored-by: jdotcms <jonathan.sanchez@dotcms.com> Co-authored-by: nollymar <nollymarlonga@Nollymars-MacBook-Pro-2.local>
- Loading branch information
Showing
with
32 additions
and 5 deletions.
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
@@ -0,0 +1,24 @@ | ||
package com.liferay.portal.model; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class UserTest { | ||
|
||
/** | ||
* Method to test: {@link User#setUserId(String)} | ||
* Given Scenario: The user id can not be override | ||
* ExpectedResult: Try to set the user id twice, the second time won't work | ||
* | ||
*/ | ||
@Test() | ||
public void test_immutable_user_id() { | ||
|
||
final User user = new User(); | ||
user.setUserId("dotcms.1"); | ||
user.setUserId("dotcms.2"); | ||
|
||
Assert.assertTrue("dotcms.1".equals(user.getUserId())); | ||
Assert.assertFalse("dotcms.2".equals(user.getUserId())); | ||
} | ||
} |
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