diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql index 6cb765ce..72b4efeb 100644 --- a/src/main/resources/data.sql +++ b/src/main/resources/data.sql @@ -18,7 +18,12 @@ VALUES INSERT INTO users (id, email, username, password, first_name, last_name, birth_date, balance, role) VALUES - ('b2d13c5a-3df0-4673-b3e6-49244f395ac7', 'admin@example.com', 'admin', '$2a$10$oUmo9dGdjnbdWeYlq7tsNuZo/r.pwI6T8JbEu2bp26Y5Zg7uzrKMy', 'Ademir', 'Ademilson', '2002-01-01', 777.7, 'ADMIN') + ('b2d13c5a-3df0-4673-b3e6-49244f395ac7', 'admin@example.com', 'admin', '$2a$10$7J3quz9UhM0TvHuHYaffMOeNnux87b4qi1RsbZX/F3CmbSFpjph5W', 'Ademir', 'Ademilson', '2002-01-01', 777.7, 'ADMIN') + ON CONFLICT (id) DO NOTHING; + +INSERT INTO users (id, email, username, password, first_name, last_name, birth_date, balance, role) +VALUES + ('b2d13c5a-3df0-4673-b3e6-49244f395ac8', 'ricardovilela@example.com', 'ricardovilela', '$2a$10$ie7t8c9SAdzLaBwoJN.zm.J68w3z3F3EHsdqulPSPoLrgwIPa7hQa', 'Ricardo', 'Vilela', '2002-01-01', 100000000.22, 'ADMIN') ON CONFLICT (id) DO NOTHING; INSERT INTO stock_ownership (id, stock_id, user_id, shares) diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties index e789f817..6d3714cb 100644 --- a/src/test/resources/application.properties +++ b/src/test/resources/application.properties @@ -4,3 +4,4 @@ spring.datasource.password=${MANDACARU_TEST_POSTGRES_PASSWORD} spring.sql.init.mode=always spring.datasource.driver-class-name=org.postgresql.Driver spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect +spring.sql.init.data-locations=classpath:data.sql diff --git a/src/test/resources/data.sql b/src/test/resources/data.sql index cea8ce25..8176f2bf 100644 --- a/src/test/resources/data.sql +++ b/src/test/resources/data.sql @@ -15,3 +15,8 @@ VALUES ('b2d13c5a-7df0-4673-b3e6-49244f395ac1', 'ana.silva@gmail.com', 'AnaSilva', 'xyz789', 'Ana', 'Silva', '1995-03-21', 300.50), ('b2d13c5a-9df0-4673-b3e6-49244f395ac6', 'patricia.santos@hotmail.com', 'PatriciaS', 'pass123', 'Patricia', 'Santos', '1998-08-30', 250.75) ON CONFLICT (id) DO NOTHING; + +INSERT INTO users (id, email, username, password, first_name, last_name, birth_date, balance, role) +VALUES + ('b2d13c5a-3df0-4673-b3e6-49244f395ac7', 'admin@example.com', 'admin', '$2a$10$oUmo9dGdjnbdWeYlq7tsNuZo/r.pwI6T8JbEu2bp26Y5Zg7uzrKMy', 'Ademir', 'Ademilson', '2002-01-01', 777.7, 'ADMIN') + ON CONFLICT (id) DO NOTHING; \ No newline at end of file