From e2cf8573aab7c0e2b55072289ccab394bb6025e6 Mon Sep 17 00:00:00 2001 From: Yannick Clausen Date: Wed, 13 Nov 2024 11:09:26 +0100 Subject: [PATCH] add befristung --- loadtest/usecases/2_create-delete-new-user.ts | 4 ++-- loadtest/util/api.ts | 3 ++- loadtest/util/data.ts | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/loadtest/usecases/2_create-delete-new-user.ts b/loadtest/usecases/2_create-delete-new-user.ts index 0c700c4..325747f 100644 --- a/loadtest/usecases/2_create-delete-new-user.ts +++ b/loadtest/usecases/2_create-delete-new-user.ts @@ -10,7 +10,7 @@ import { postPersonenkontextWorkflow, } from "../util/api.ts"; import { getDefaultOptions } from "../util/config.ts"; -import { getRandomName, pickRandomItem } from "../util/data.ts"; +import { getFutureDate, getRandomName, pickRandomItem } from "../util/data.ts"; import { goToUserList, login } from "../util/page.ts"; import { deleteAllTestUsers } from "../util/resource-helper.ts"; import { wrapTestFunction } from "../util/usecase-wrapper.ts"; @@ -67,7 +67,7 @@ function main(users = getDefaultAdminMix()) { const body = { ...getRandomName(), personalnummer: "", - befristung: new Date("2055-07-31T22:00:00.000Z"), + befristung: getFutureDate(), createPersonenkontexte: [ { organisationId: organisation.id, diff --git a/loadtest/util/api.ts b/loadtest/util/api.ts index aaaddb5..e0e8a71 100644 --- a/loadtest/util/api.ts +++ b/loadtest/util/api.ts @@ -36,7 +36,7 @@ import { getStatusChecker, } from "./checks.ts"; import { getBackendUrl } from "./config.ts"; -import { NAME_PREFIX } from "./data.ts"; +import { getFutureDate, NAME_PREFIX } from "./data.ts"; import { prettyLog } from "./debug.ts"; const backendUrl = getBackendUrl(); @@ -327,6 +327,7 @@ export function putPersonLock(personId: string, lock: boolean) { lock, //@ts-expect-error openapi generator converts this to camelcase locked_by: NAME_PREFIX, + locked_until: getFutureDate(), }; const params = { headers: { "Content-Type": "application/json" }, diff --git a/loadtest/util/data.ts b/loadtest/util/data.ts index 548b8b0..6b24f7e 100644 --- a/loadtest/util/data.ts +++ b/loadtest/util/data.ts @@ -48,3 +48,7 @@ export function getRandomName(): { vorname: s, }; } + +export function getFutureDate() { + return new Date("2055-07-31T22:00:00.000Z"); +}