db-migration #10

Merged
hsh-michaelhoennig merged 74 commits from db-migration into master 2024-01-23 15:11:24 +01:00
4 changed files with 2 additions and 20 deletions
Showing only changes of commit 2a1e933c00 - Show all commits

View File

@ -9,8 +9,6 @@ import net.hostsharing.hsadminng.rbac.rbacgrant.RawRbacGrantRepository;
import net.hostsharing.hsadminng.rbac.rbacrole.RawRbacRoleRepository;
import net.hostsharing.test.Array;
import net.hostsharing.test.JpaAttempt;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;

View File

@ -143,7 +143,7 @@ class HsOfficeMembershipControllerAcceptanceTest {
.contentType(ContentType.JSON)
.body("uuid", isUuidValid())
.body("mainDebitor.debitorNumber", is(givenDebitor.getDebitorNumber()))
// .body("mainDebitor.debitorNumber", is(givenDebitor.getDebitorNumberSuffix()))
.body("mainDebitor.debitorNumberSuffix", is((int) givenDebitor.getDebitorNumberSuffix()))
.body("partner.person.tradeName", is("Third OHG"))
.body("memberNumber", is(20001))
.body("validFrom", is("2022-10-13"))
@ -278,7 +278,7 @@ class HsOfficeMembershipControllerAcceptanceTest {
.body("uuid", isUuidValid())
.body("partner.person.tradeName", is(givenMembership.getPartner().getPerson().getTradeName()))
.body("mainDebitor.debitorNumber", is(givenMembership.getMainDebitor().getDebitorNumber()))
// .body("mainDebitor.debitorNumber", is(givenMembership.getMainDebitor().getDebitorNumberSuffix()))
.body("mainDebitor.debitorNumberSuffix", is((int) givenMembership.getMainDebitor().getDebitorNumberSuffix()))
.body("memberNumber", is(givenMembership.getMemberNumber()))
.body("validFrom", is("2022-11-01"))
.body("validTo", is("2023-12-31"))

View File

@ -150,8 +150,6 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTest {
// tenant
"{ grant role membership#20002:First.tenant to role membership#20002:First.agent by system and assume }",
"{ grant role partner#10001:First.guest to role membership#20002:First.tenant by system and assume }",
// "{ grant role debitor#1100First.guest to role membership#20002:First.tenant by system and assume }",
// "{ grant role membership#20002:First.tenant to role debitor#1100First.agent by system and assume }",
"{ grant role debitor#1000111:First.guest to role membership#20002:First.tenant by system and assume }",
"{ grant role membership#20002:First.tenant to role debitor#1000111:First.agent by system and assume }",
@ -161,7 +159,6 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTest {
"{ grant perm view on membership#20002:First to role membership#20002:First.guest by system and assume }",
"{ grant role membership#20002:First.guest to role membership#20002:First.tenant by system and assume }",
"{ grant role membership#20002:First.guest to role partner#10001:First.tenant by system and assume }",
// "{ grant role membership#20002:First.guest to role debitor#1100First.tenant by system and assume }",
"{ grant role membership#20002:First.guest to role debitor#1000111:First.tenant by system and assume }",
null));

View File

@ -459,19 +459,6 @@ public class ImportOfficeData extends ContextBasedTest {
private void deleteFromRbacTables() {
jpaAttempt.transacted(() -> {
context(rbacSuperuser);
final var usersNotToDelete = em.createNativeQuery("select name from rbacuser where name like 'superuser-%'")
.getResultList();
final var usersToDelete = em.createNativeQuery("select name from rbacuser where name not like 'superuser-%'")
.getResultList();
System.getenv();
});
jpaAttempt.transacted(() -> {
context(rbacSuperuser);
// em.createNativeQuery("DELETE FROM rbacobject WHERE objecttable like 'hs_%'").executeUpdate();
// em.createNativeQuery("DELETE FROM rbacgrants WHERE true").executeUpdate();
// em.createNativeQuery("DELETE FROM rbacpermission WHERE true").executeUpdate();
// em.createNativeQuery("DELETE FROM rbacreference WHERE true").executeUpdate();
em.createNativeQuery("delete from rbacuser_rv where name not like 'superuser-%'").executeUpdate();
em.createNativeQuery("delete from tx_journal where true").executeUpdate();
em.createNativeQuery("delete from tx_context where true").executeUpdate();