fdcecf8368
Release package / release (push) Successful in 50m34s
Co-authored-by: TakahashiNg <83152264+TakahashiNguyen@users.noreply.github.com> Reviewed-on: #20
30 lines
740 B
Java
30 lines
740 B
Java
package com.drinkool.entities;
|
|
|
|
import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
import com.drinkool.*;
|
|
import io.quarkus.test.junit.QuarkusTest;
|
|
import jakarta.transaction.Transactional;
|
|
import org.junit.jupiter.api.*;
|
|
|
|
@QuarkusTest
|
|
public class CustomerEntityTest {
|
|
|
|
@Test
|
|
@Transactional
|
|
public void testSignupOneParamSuccess() {
|
|
CustomerEntity user = new CustomerEntity();
|
|
String phone = Utils.generateRandomPhone();
|
|
|
|
user.signup(phone);
|
|
|
|
assertNotNull(user.id, "ID not null after persist");
|
|
assertEquals(phone, user.name, "Tên mặc định phải là số điện thoại");
|
|
assertEquals(phone, user.phone);
|
|
assertNotNull(
|
|
user.hashedPassword,
|
|
"Password tự động phải được tạo và hash"
|
|
);
|
|
}
|
|
}
|