1
0

add audit journal log for hs_office_contact

This commit is contained in:
Michael Hoennig
2022-10-13 07:57:19 +02:00
parent 0b60b9f0ff
commit a56af5af25
2 changed files with 27 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ import org.testcontainers.junit.jupiter.Container;
import javax.persistence.EntityManager;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.List;
import java.util.function.Supplier;
@@ -264,6 +265,24 @@ class HsOfficeContactRepositoryIntegrationTest extends ContextBasedTest {
}
}
@Test
public void auditJournalLogIsAvailable() {
// given
final var query = em.createNativeQuery("""
select c.currenttask, j.targettable, j.targetop
from tx_journal j
join tx_context c on j.txid = c.txid
where targettable = 'hs_office_contact';
""");
// when
@SuppressWarnings("unchecked") final List<Object[]> customerLogEntries = query.getResultList();
// then
assertThat(customerLogEntries).map(Arrays::toString)
.contains("[creating RBAC test contact first contact, hs_office_contact, INSERT]");
}
private HsOfficeContactEntity givenSomeTemporaryContact(
final String createdByUser,
Supplier<HsOfficeContactEntity> entitySupplier) {