Steffen Nitschke
4 years ago
3 changed files with 76 additions and 12 deletions
-
31fh.fd.ci.server/src/main/java/de/fd/fh/server/access/AccessContextEventListener.java
-
27fh.fd.ci.server/src/test/java/de/fd/fh/server/access/AccessContextEventListenerTest.java
-
28fh.fd.ci.server/src/test/java/de/fd/fh/server/user/UserTest.java
@ -0,0 +1,28 @@ |
|||
package de.fd.fh.server.user; |
|||
|
|||
import org.junit.jupiter.api.Test; |
|||
|
|||
import static org.junit.jupiter.api.Assertions.*; |
|||
|
|||
class UserTest |
|||
{ |
|||
@Test |
|||
void testRename() |
|||
{ |
|||
final User user = new User(UserId.random(), "TestName"); |
|||
|
|||
user.rename("NewTestName"); |
|||
|
|||
assertEquals("NewTestName", user.getName(), "Should rename user."); |
|||
} |
|||
|
|||
@Test |
|||
void failedRenameTest() |
|||
{ |
|||
final User user = new User(UserId.random(), "TestName"); |
|||
|
|||
user.rename(null); |
|||
|
|||
assertEquals("TestName", user.getName(), "Should rename user."); |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue