From a643b86295a5310332c2a25eea2cf9ac3689f4f6 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Mon, 21 Oct 2024 16:09:02 +0200 Subject: [PATCH] print only initially given properties --- .../hostsharing/hsadminng/hs/office/usecases/UseCase.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/usecases/UseCase.java b/src/test/java/net/hostsharing/hsadminng/hs/office/usecases/UseCase.java index a7ea4b29..607cfcdf 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/usecases/UseCase.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/usecases/UseCase.java @@ -8,6 +8,7 @@ import org.apache.commons.collections4.map.LinkedMap; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; +import java.util.LinkedHashMap; import java.util.Map; import java.util.UUID; import java.util.function.Function; @@ -21,6 +22,7 @@ public abstract class UseCase> { private final UseCaseTest testSuite; private final Map>> requirements = new LinkedMap<>(); private final String resultAlias; + private final Map givenProperties = new LinkedHashMap<>(); private String nextTitle; // FIXME: ugly public UseCase(final UseCaseTest testSuite) { @@ -55,7 +57,7 @@ public abstract class UseCase> { | name | value | |------|-------| """.trim()); - UseCaseTest.properties().forEach((key, value) -> log("| " + key + " | " + value + " |")); + givenProperties.forEach((key, value) -> log("| " + key + " | " + value + " |")); log(""); requirements.forEach((alias, factory) -> factory.apply(alias).run().keep()); return run(); @@ -64,6 +66,7 @@ public abstract class UseCase> { protected abstract HttpResponse run(); public final UseCase given(final String propName, final Object propValue) { + givenProperties.put(propName, propValue); UseCaseTest.putProperty(propName, propValue); return this; }