From 81bfa4288fb00419024d735205b6c1125b9bdec4 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Mon, 7 Oct 2024 16:46:57 +0200 Subject: [PATCH] fix lastUnixUserId --- .../HsHostingAssetControllerAcceptanceTest.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/HsHostingAssetControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/HsHostingAssetControllerAcceptanceTest.java index 6f2d42d4..a782e45d 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/HsHostingAssetControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/HsHostingAssetControllerAcceptanceTest.java @@ -184,10 +184,12 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup "identifier": "fir10", "caption": "some separate ManagedWebspace HA", "config": { - "groupid": 1000000 + "groupid": {lastUnixUserId} } } - """)) + """ + .replace("{lastUnixUserId}", lastUnixUserId().toString()) + )) .header("Location", matchesRegex("http://localhost:[1-9][0-9]*/api/hs/hosting/assets/[^/]*")) .extract().header("Location"); // @formatter:on @@ -777,4 +779,11 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup }).returnedValue(); } + + private Integer lastUnixUserId() { + final Object result = em.createNativeQuery("SELECT last_value from hs_hosting.asset_unixuser_system_id_seq", Integer.class) + .getSingleResult(); + return (Integer) result; + } + }