Skip to content

Commit

Permalink
OPHYK-373 Other tests remove queuedemailstatus data, make sure it exi…
Browse files Browse the repository at this point in the history
…sts before running tests
  • Loading branch information
tsu committed Dec 23, 2024
1 parent 39aba71 commit d39a607
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public void before() {
response.setLahetysTunniste(lahetysTunniste);
Mockito.when(viestinvalitysClient.luoLahetys(Mockito.any(Lahetys.class))).thenReturn(response);

ensureQueuedEmailStatusDataExists();
deleteKutsut();
deleteQueuedEmails();
}
Expand Down Expand Up @@ -171,4 +172,14 @@ select count(*)
return jdbcTemplate.queryForObject(sql, Integer.class);
}

private void ensureQueuedEmailStatusDataExists() {
var sql = """
INSERT INTO queuedemailstatus (id, description) VALUES
('QUEUED', 'Sähköposti odottaa lähettämistä'),
('SENT', 'Sähköposti on lähetetty viestinvälityspalveluun'),
('ERROR', 'Sähköposti on virheellinen')
ON CONFLICT DO NOTHING
""";
jdbcTemplate.execute(sql);
}
}

0 comments on commit d39a607

Please sign in to comment.