|
|
@ -0,0 +1,29 @@ |
|
|
|
import static org.junit.jupiter.api.Assertions.*; |
|
|
|
|
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
|
|
|
|
class CreateUsertTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testCreateUser() { |
|
|
|
String id = "1"; |
|
|
|
String userName = "testUser"; |
|
|
|
String password = "password123"; |
|
|
|
String birthday = "2000-01-01"; |
|
|
|
String firstName = "John"; |
|
|
|
String surname = "Doe"; |
|
|
|
|
|
|
|
CreateUser user = new CreateUser(id, userName, password, birthday, firstName, surname); |
|
|
|
|
|
|
|
assertEquals(id, user.getId()); |
|
|
|
assertEquals(userName, user.getUserName()); |
|
|
|
assertEquals(birthday, user.getBirthday()); |
|
|
|
assertEquals(firstName, user.getFirstName()); |
|
|
|
assertEquals(surname, user.surname()); |
|
|
|
|
|
|
|
// Password should be hashed |
|
|
|
assertNotEquals(password, user.getPassword()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |