feature/use-case-acceptance-tests #116

Merged
hsh-michaelhoennig merged 49 commits from feature/use-case-acceptance-tests into master 2024-10-30 11:40:46 +01:00
3 changed files with 12 additions and 5 deletions
Showing only changes of commit 4911ca54c0 - Show all commits

View File

@ -55,7 +55,7 @@ public abstract class UseCase<T extends UseCase<?>> {
}
public final HttpResponse doRun() {
requirements.forEach((alias, factpory) -> factpory.apply(alias).run());
requirements.forEach((alias, factory) -> factory.apply(alias).run().keep());
return run();
}

View File

@ -20,8 +20,11 @@ import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static org.assertj.core.api.Assertions.assertThat;
public abstract class UseCaseTest extends ContextBasedTest {
final static String RUN_AS_USER = "superuser-alex@hostsharing.net"; // TODO.test: use global:AGENT when implemented
@ -85,8 +88,12 @@ public abstract class UseCaseTest extends ContextBasedTest {
return aliases.containsKey(alias);
}
static Alias<?> getAlias(final String alias) {
return aliases.get(alias);
static Alias<?> getAlias(final String name) {
final var alias = aliases.get(name);
assertThat(alias).as("alias '" + name + "' not found in aliases [" +
aliases.keySet().stream().map(v -> "'" + v + "'").collect(Collectors.joining(", ")) + "]"
).isNotNull();
return alias;
}
static void putAlias(final String name, final Alias<?> value) {

View File

@ -43,8 +43,8 @@ public class CreateSelfDebitorForPartner extends UseCase<CreateSelfDebitorForPar
{
"debitorRel": {
"type": "DEBITOR", // FIXME: should be defaulted to DEBITOR
"anchorUuid": ${person:Test AG.uuid},
"holderUuid": ${person:Test AG.uuid},
"anchorUuid": ${Person: Test AG},
"holderUuid": ${Person: Test AG},
"contactUuid": ${Contact: Test AG - billing department}
},
"debitorNumberSuffix": "00",