Skip to content

Commit

Permalink
chore: Fix broken unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kadraman committed Sep 27, 2024
1 parent b180fa2 commit 197c528
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/test/java/com/microfocus/example/DataSeeder.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class DataSeeder {
public static final String TEST_USER2_USERNAME = "test2";
public static final String TEST_USER2_FIRST_NAME = "Test";
public static final String TEST_USER2_LAST_NAME = "User 2";
public static final String TEST_USER2_GENDER = "Male";
public static final String TEST_USER2_PASSWORD = "0n3L0ngPa55w0rd";
public static final String TEST_USER2_EMAIL = "test2@localhost";
public static final String TEST_USER2_PHONE = "0123456789";
Expand Down Expand Up @@ -90,6 +91,7 @@ public static User generateUser() {
user.setPassword(EncryptedPasswordUtils.encryptPassword(TEST_USER2_PASSWORD));
user.setFirstName(TEST_USER2_FIRST_NAME);
user.setLastName(TEST_USER2_LAST_NAME);
user.setGender(TEST_USER2_GENDER);
user.setEmail(TEST_USER2_EMAIL);
user.setPhone(TEST_USER2_PHONE);
// no roles
Expand Down
2 changes: 2 additions & 0 deletions src/test/resources/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ VALUES ('c97f4c8b-4c14-4d0c-9354-69fd7ee324da', 'bd5b9e2f-ac55-4e34-a76d-599b7e5
INSERT INTO reviews (id, product_id, user_id, review_date, comment, rating, visible)
VALUES ('8ab3eb7c-42f6-11ec-81d3-0242ac130003', '38400000-8cf0-11bd-b23e-10b96e4ef00d', 'bd5b9e2f-ac55-4e34-a76d-599b7e5b3308',
CURDATE()-5, 'This is an example review of Test Product 1. It is very good', 5, 1);
INSERT INTO refresh_tokens (id, user_id, expiry_date)
VALUES ('08b43d0d-2d86-4252-9782-10e73266d5c5', 'bd5b9e2f-ac55-4e34-a76d-599b7e5b3308', CURDATE() + 1);

2 changes: 2 additions & 0 deletions src/test/resources/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ create table orders
cart clob default null,
shipped bit(1) not null,
shipped_date datetime default null,
order_notes clob default null,
credit_card clob default null,
primary key (id)
);
create table reviews
Expand Down

0 comments on commit 197c528

Please sign in to comment.