Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* #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
1 parent
ccad093
commit 2c9b40b
Showing
3 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
dotCMS/src/integration-test/java/com/liferay/portal/model/UserTest.java
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 |
---|---|---|
@@ -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