|
@ -0,0 +1,48 @@ |
|
|
|
|
|
package de.fd.fh.server.access; |
|
|
|
|
|
|
|
|
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
|
|
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.*; |
|
|
|
|
|
|
|
|
|
|
|
class AccessTest |
|
|
|
|
|
{ |
|
|
|
|
|
@Test |
|
|
|
|
|
void removeTokenTest() |
|
|
|
|
|
{ |
|
|
|
|
|
final Access access = new Access(null, null, null, null, new AccessToken(), null); |
|
|
|
|
|
|
|
|
|
|
|
access.removeToken(); |
|
|
|
|
|
|
|
|
|
|
|
assertNull(access.getToken()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void setTokenTest() |
|
|
|
|
|
{ |
|
|
|
|
|
final Access access = new Access(); |
|
|
|
|
|
|
|
|
|
|
|
access.setToken(new AccessToken()); |
|
|
|
|
|
|
|
|
|
|
|
assertNotNull(access.getToken()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void updatePasswordTest() |
|
|
|
|
|
{ |
|
|
|
|
|
final Access access = new Access(null,null, "TestPassword", null, null, null); |
|
|
|
|
|
|
|
|
|
|
|
access.updatePassword("NewTestPassword"); |
|
|
|
|
|
|
|
|
|
|
|
assertEquals("NewTestPassword", access.getPassword(), "Should update password."); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void renameTest() |
|
|
|
|
|
{ |
|
|
|
|
|
final Access access = new Access(null, "TestName", null, null, null, null); |
|
|
|
|
|
|
|
|
|
|
|
access.rename("NewTestName"); |
|
|
|
|
|
|
|
|
|
|
|
assertEquals("NewTestName", access.getName(), "Should update name."); |
|
|
|
|
|
} |
|
|
|
|
|
} |