add DomainSetup-HostingAssets for new BookingItem via created-event #111

Merged
hsh-michaelhoennig merged 31 commits from add-hsoting-asset-to-booking-item-resource-and-created-event into master 2024-10-08 11:48:35 +02:00
Showing only changes of commit 05ffbac882 - Show all commits

View File

@ -157,7 +157,7 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup
)
);
final var givenParentAsset = givenParentAsset(MANAGED_SERVER, "vm1011");
final var expectedUnixUserId = lastUnixUserId();
final var expectedUnixUserId = nextUnixUserId();
final var location = RestAssured // @formatter:off
.given()
@ -208,9 +208,11 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup
.isEqualTo("""
HsHostingAsset(UNIX_USER, fir10, fir10 webspace user, MANAGED_WEBSPACE:fir10, {
"password" : null,
"userid" : 1000000
"userid" : {lastUnixUserId}
})
""".trim());
"""
.replace("{lastUnixUserId}", expectedUnixUserId.toString())
.trim());
}
@Test
@ -781,10 +783,10 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup
}
private Integer lastUnixUserId() {
final Object result = em.createNativeQuery("SELECT last_value from hs_hosting.asset_unixuser_system_id_seq", Integer.class)
private Integer nextUnixUserId() {
final Object result = em.createNativeQuery("SELECT nextval('hs_hosting.asset_unixuser_system_id_seq')", Integer.class)
.getSingleResult();
return (Integer) result;
return (Integer) result + 1;
}
}