improve readme and cleanup

This commit is contained in:
Michael Hoennig 2024-11-04 17:55:04 +01:00
parent 42c4d4102e
commit 8342aedff4
3 changed files with 25 additions and 5 deletions

View File

@ -1,7 +1,5 @@
package net.hostsharing.hsadminng.hs.office.scenarios.contact; package net.hostsharing.hsadminng.hs.office.scenarios;
import net.hostsharing.hsadminng.hs.office.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.office.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.office.scenarios.UseCase.HttpResponse; import net.hostsharing.hsadminng.hs.office.scenarios.UseCase.HttpResponse;
import java.util.function.Consumer; import java.util.function.Consumer;

View File

@ -63,4 +63,27 @@ Here, use-cases can be re-used, usually with different data.
### The Use-Case Itself ### The Use-Case Itself
The use-case The use-case is implemented by the `run()`-method which contains HTTP-calls.
Each HTTP-call is wrapped into either `obtain(...)` to keep the result in a placeholder variable,
the variable name is also used as a title.
Or it's wrapped into a `withTitle(...)` to assign a title.
The HTTP-call is followed by some assertions, e.g. the HTTP status and JSON-path-expression-matchers.
Use `${...}` for placeholders which need to be replaced with JSON quotes
(e.g. strings are quoted, numbers are not),
`%{...}` for placeholders which need to be rendered raw
and `&{...}` for placeholders which need to get URI-encoded.
Properties with null-values are removed from the JSON.
If you need to keep a null-value, e.g. to delete a property,
use `NULL` (all caps).
### The Use-Case Verification
The verification-step is implemented by the `verify()`-method which usually contains a HTTP-HTTP-call.
It can also contain a JSON-path verification to check if a certain value is in the result.

View File

@ -6,7 +6,6 @@ import com.jayway.jsonpath.JsonPath;
import io.restassured.http.ContentType; import io.restassured.http.ContentType;
import lombok.Getter; import lombok.Getter;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import net.hostsharing.hsadminng.hs.office.scenarios.contact.PathAssertion;
import net.hostsharing.hsadminng.reflection.AnnotationFinder; import net.hostsharing.hsadminng.reflection.AnnotationFinder;
import org.apache.commons.collections4.map.LinkedMap; import org.apache.commons.collections4.map.LinkedMap;
import org.assertj.core.api.OptionalAssert; import org.assertj.core.api.OptionalAssert;