chore(test): update
This commit is contained in:
@@ -2,12 +2,16 @@ package com.drinkool.models;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import com.drinkool.entities.CustomerEntity;
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.transaction.Transactional;
|
||||
import java.util.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@Entity
|
||||
@Table
|
||||
class TestUserEntity extends UserModel {}
|
||||
|
||||
@QuarkusTest
|
||||
public class UserModelTest {
|
||||
|
||||
@@ -15,7 +19,7 @@ public class UserModelTest {
|
||||
@Transactional
|
||||
public void testSignupSuccess() {
|
||||
//dang nhap thanh cong
|
||||
CustomerEntity user = new CustomerEntity();
|
||||
TestUserEntity user = new TestUserEntity();
|
||||
String phone =
|
||||
"+8477" + String.format("%07d", (new Random()).nextInt(10000000));
|
||||
String password = "02092006Danh";
|
||||
@@ -26,7 +30,7 @@ public class UserModelTest {
|
||||
assertEquals(phone, user.phone);
|
||||
assertNotNull(user.hashedPassword, "password phai hash");
|
||||
|
||||
CustomerEntity savedUser = CustomerEntity.find(
|
||||
TestUserEntity savedUser = TestUserEntity.find(
|
||||
"phone",
|
||||
phone
|
||||
).firstResult();
|
||||
|
||||
Reference in New Issue
Block a user