add audit journal log for hs_office_bankaccount

This commit is contained in:
Michael Hoennig 2022-10-13 08:03:48 +02:00
parent a56af5af25
commit df493e40d7
2 changed files with 28 additions and 0 deletions

View File

@ -11,3 +11,11 @@ create table hs_office_bankaccount
bic varchar(11) not null
);
--//
-- ============================================================================
--changeset hs-office-bankaccount-MAIN-TABLE-JOURNAL:1 endDelimiter:--//
-- ----------------------------------------------------------------------------
call create_journal('hs_office_bankaccount');
--//

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;
@ -292,6 +293,25 @@ class HsOfficeBankAccountRepositoryIntegrationTest extends ContextBasedTest {
}).assertSuccessful().returnedValue();
}
@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_bankaccount';
""");
// when
@SuppressWarnings("unchecked") final List<Object[]> customerLogEntries = query.getResultList();
// then
assertThat(customerLogEntries).map(Arrays::toString)
.contains("[creating RBAC test bankaccount First GmbH, hs_office_bankaccount, INSERT]");
}
@BeforeEach
@AfterEach
void cleanup() {