Skip to content

Commit

Permalink
BAVL-532 remove fake dev contacts, causes errors in our dev logs. (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-crowson-moj authored Dec 13, 2024
1 parent 9dd7c9f commit e962cf4
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
delete from court_contact where email in ('j@j.com', 'b@b.com', 'c@c.com');
delete from probation_team_contact where email in ('t@t.com', 'm@m.com', 's@s.com');
delete from prison_contact where email in ('p@p.com', 'g@g.com', 'z@z.com', 'a@a.com', 'r@r.com');
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import uk.gov.justice.digital.hmpps.hmppsbookavideolinkapi.service.User
)
@Sql(
"classpath:test_data/clean-all-data.sql",
"classpath:test_data/seed-contacts.sql",
)
abstract class IntegrationTestBase {

Expand Down
5 changes: 4 additions & 1 deletion src/test/resources/test_data/clean-all-data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ TRUNCATE TABLE notification RESTART IDENTITY CASCADE;
TRUNCATE TABLE booking_history_appointment RESTART IDENTITY CASCADE;
TRUNCATE TABLE booking_history RESTART IDENTITY CASCADE;
TRUNCATE TABLE prison_appointment RESTART IDENTITY CASCADE;
TRUNCATE TABLE video_booking RESTART IDENTITY CASCADE;
TRUNCATE TABLE video_booking RESTART IDENTITY CASCADE;
TRUNCATE TABLE court_contact RESTART IDENTITY CASCADE;
TRUNCATE TABLE probation_team_contact RESTART IDENTITY CASCADE;
TRUNCATE TABLE prison_contact RESTART IDENTITY CASCADE;
26 changes: 26 additions & 0 deletions src/test/resources/test_data/seed-contacts.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
insert into court_contact (court_contact_id, court_id, name, email, telephone, position, enabled, notes, primary_contact, created_by, created_time)
values (1, 1, 'John Hipkins', 'j@j.com', '0117 282442', 'Court Clerk', true, '', true, 'TIM', current_timestamp),
(2, 1, 'Bob Hipkins', 'b@b.com', '0117 282443', 'Court Clerk', true, '', false, 'TIM', current_timestamp),
(3, 1, 'Carlos Hipkins', 'c@c.com', '0117 282444', 'Court Clerk', false, '', false, 'TIM', current_timestamp);

alter sequence if exists court_contact_court_contact_id_seq restart with 4;

---

insert into probation_team_contact (probation_team_contact_id, probation_team_id, name, email, telephone, position, enabled, notes, primary_contact, created_by, created_time)
values (1, 1, 'Tim Hipkins', 't@t.com', '0117 282442', 'Probation officer', true, '', true, 'TIM', current_timestamp),
(2, 1, 'Matt Hipkins', 'm@m.com', '0117 282443', 'Probation officer', true, '', false, 'TIM', current_timestamp),
(3, 1, 'Steve Hipkins', 's@s.com', '0117 282444', 'Probation officer', false, '', false, 'TIM', current_timestamp);

alter sequence if exists probation_team_contact_probation_team_contact_id_seq restart with 4;

---

insert into prison_contact (prison_contact_id, prison_id, name, email, telephone, position, enabled, notes, primary_contact, created_by, created_time)
values (1, 17, 'Paul Hopkins', 'p@p.com', '0117 282442', 'Video Admin', true, '', true, 'TIM', current_timestamp),
(2, 17, 'Gary Hopkins', 'g@g.com', '0117 282443', 'Video Admin', true, '', false, 'TIM', current_timestamp),
(3, 17, 'Zak Hopkins', 'z@z.com', '0117 282444', 'Video Admin', false, '', false, 'TIM', current_timestamp),
(4, 33, 'Anna Hopkins', 'a@a.com', '0117 282445', 'Video Admin', true, '', true, 'TIM', current_timestamp),
(5, 16, 'Robbie Hopkins', 'r@r.com', '0117 282446', 'Video Admin', true, '', true, 'TIM', current_timestamp);

alter sequence if exists prison_contact_prison_contact_id_seq restart with 6;

0 comments on commit e962cf4

Please sign in to comment.