From cea409c13671c7f45576065cca4182343609171c Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Wed, 31 Jul 2024 13:27:13 +0200 Subject: [PATCH] split persist-stages --- .../hs/migration/ImportHostingAssets.java | 57 ++++++++++++++++++- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/migration/ImportHostingAssets.java b/src/test/java/net/hostsharing/hsadminng/hs/migration/ImportHostingAssets.java index 4c152eb5..60855f6f 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/migration/ImportHostingAssets.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/migration/ImportHostingAssets.java @@ -378,30 +378,81 @@ public class ImportHostingAssets extends ImportOfficeData { @Test @Order(19000) @Commit - void persistHostingAssetEntities() { + void persistBookingProjects() { - System.out.println("PERSISTING hosting-assets to database '" + jdbcUrl + "' as user '" + postgresAdminUser + "'"); + System.out.println("PERSISTING booking-projects to database '" + jdbcUrl + "' as user '" + postgresAdminUser + "'"); jpaAttempt.transacted(() -> { context(rbacSuperuser); bookingProjects.forEach(this::persist); }).assertSuccessful(); + } + + @Test + @Order(19010) + @Commit + void persistBookingItems() { + + System.out.println("PERSISTING booking-items to database '" + jdbcUrl + "' as user '" + postgresAdminUser + "'"); jpaAttempt.transacted(() -> { context(rbacSuperuser); bookingItems.forEach(this::persistRecursively); }).assertSuccessful(); + } + + @Test + @Order(19120) + @Commit + void persistCloudServers() { + + System.out.println("PERSISTING cloud-servers to database '" + jdbcUrl + "' as user '" + postgresAdminUser + "'"); persistHostingAssetsOfType(CLOUD_SERVER); + } + + @Test + @Order(19130) + @Commit + void persistManagedServers() { + System.out.println("PERSISTING managed-servers to database '" + jdbcUrl + "' as user '" + postgresAdminUser + "'"); persistHostingAssetsOfType(MANAGED_SERVER); + } + + @Test + @Order(19140) + @Commit + void persistManagedWebspaces() { + System.out.println("PERSISTING managed-webspaces to database '" + jdbcUrl + "' as user '" + postgresAdminUser + "'"); persistHostingAssetsOfType(MANAGED_WEBSPACE); + } + + @Test + @Order(19150) + @Commit + void persistIPNumbers() { + System.out.println("PERSISTING ip-numbers to database '" + jdbcUrl + "' as user '" + postgresAdminUser + "'"); persistHostingAssetsOfType(IPV4_NUMBER); + } + + @Test + @Order(19160) + @Commit + void persistUnixUsers() { + System.out.println("PERSISTING unix-users to database '" + jdbcUrl + "' as user '" + postgresAdminUser + "'"); persistHostingAssetsOfType(UNIX_USER); + } + + @Test + @Order(19170) + @Commit + void persistEmailAliases() { + System.out.println("PERSISTING email-aliases to database '" + jdbcUrl + "' as user '" + postgresAdminUser + "'"); persistHostingAssetsOfType(EMAIL_ALIAS); } @Test - @Order(19010) + @Order(19900) void verifyPersistedUnixUsersWithUserId() { assumeThatWeAreImportingControlledTestData();