cleanup and fix ImportOfficeData

This commit is contained in:
Michael Hoennig 2024-06-03 10:11:33 +02:00
parent 81e6ddab91
commit 6151a25136
4 changed files with 4 additions and 4 deletions

View File

@ -162,10 +162,10 @@ public class HsBookingItemEntity implements Stringifyable, RbacObject, Validatab
public static RbacView rbac() { public static RbacView rbac() {
return rbacViewFor("bookingItem", HsBookingItemEntity.class) return rbacViewFor("bookingItem", HsBookingItemEntity.class)
.withIdentityView(SQL.projection("caption")) // FIXME: cleanIdentifier(...)? .withIdentityView(SQL.projection("caption"))
.withRestrictedViewOrderBy(SQL.expression("validity")) .withRestrictedViewOrderBy(SQL.expression("validity"))
.withUpdatableColumns("version", "caption", "validity", "resources") .withUpdatableColumns("version", "caption", "validity", "resources")
.toRole("global", ADMIN).grantPermission(INSERT) // FIXME: Why is this necessary to insert test data? .toRole("global", ADMIN).grantPermission(INSERT) // TODO.impl: Why is this necessary to insert test data?
.toRole("global", ADMIN).grantPermission(DELETE) .toRole("global", ADMIN).grantPermission(DELETE)
.importEntityAlias("project", HsBookingProjectEntity.class, usingDefaultCase(), .importEntityAlias("project", HsBookingProjectEntity.class, usingDefaultCase(),

View File

@ -136,7 +136,7 @@ public class HsHostingAssetEntity implements Stringifyable, RbacObject, Validata
.withIdentityView(SQL.projection("identifier")) .withIdentityView(SQL.projection("identifier"))
.withRestrictedViewOrderBy(SQL.expression("identifier")) .withRestrictedViewOrderBy(SQL.expression("identifier"))
.withUpdatableColumns("version", "caption", "config") .withUpdatableColumns("version", "caption", "config")
.toRole(GLOBAL, ADMIN).grantPermission(INSERT) // FIXME: Why is this necessary to insert test data? .toRole(GLOBAL, ADMIN).grantPermission(INSERT) // TODO.impl: Why is this necessary to insert test data?
.importEntityAlias("bookingItem", HsBookingItemEntity.class, usingDefaultCase(), .importEntityAlias("bookingItem", HsBookingItemEntity.class, usingDefaultCase(),
dependsOnColumn("bookingItemUuid"), dependsOnColumn("bookingItemUuid"),

View File

@ -178,7 +178,6 @@ class HsHostingAssetRepositoryIntegrationTest extends ContextBasedTestWithCleanu
public void normalUser_canViewOnlyRelatedAsset() { public void normalUser_canViewOnlyRelatedAsset() {
// given: // given:
context("person-FirbySusan@example.com"); context("person-FirbySusan@example.com");
// context("superuser-alex@hostsharing.net"); // FIXME
final var projectUuid = projectRepo.findAll().stream() final var projectUuid = projectRepo.findAll().stream()
.filter(p -> p.getCaption().equals("D-1000111 default project")) .filter(p -> p.getCaption().equals("D-1000111 default project"))
.findAny().orElseThrow().getUuid(); .findAny().orElseThrow().getUuid();

View File

@ -623,6 +623,7 @@ public class ImportOfficeData extends ContextBasedTest {
context(rbacSuperuser); context(rbacSuperuser);
em.createNativeQuery("delete from hs_hosting_asset where true").executeUpdate(); em.createNativeQuery("delete from hs_hosting_asset where true").executeUpdate();
em.createNativeQuery("delete from hs_booking_item where true").executeUpdate(); em.createNativeQuery("delete from hs_booking_item where true").executeUpdate();
em.createNativeQuery("delete from hs_booking_project where true").executeUpdate();
em.createNativeQuery("delete from hs_office_coopassetstransaction where true").executeUpdate(); em.createNativeQuery("delete from hs_office_coopassetstransaction where true").executeUpdate();
em.createNativeQuery("delete from hs_office_coopassetstransaction_legacy_id where true").executeUpdate(); em.createNativeQuery("delete from hs_office_coopassetstransaction_legacy_id where true").executeUpdate();
em.createNativeQuery("delete from hs_office_coopsharestransaction where true").executeUpdate(); em.createNativeQuery("delete from hs_office_coopsharestransaction where true").executeUpdate();