refactoring scenario-tests #126

Merged
hsh-michaelhoennig merged 7 commits from feature/refactoring-scenario-tests into master 2024-11-29 14:03:35 +01:00
45 changed files with 84 additions and 81 deletions
Showing only changes of commit e9e078673c - Show all commits

View File

@ -68,6 +68,7 @@ public class ArchitectureTest {
"..hs.hosting.asset",
"..hs.hosting.asset.validators",
"..hs.hosting.asset.factories",
"..hs.scenarios",
"..errors",
"..mapper",
"..ping",
@ -160,9 +161,11 @@ public class ArchitectureTest {
.that().resideInAPackage("..hs.office.(*)..")
.should().onlyBeAccessed().byClassesThat()
.resideInAnyPackage(
"..hs.office.(*)..",
"..hs.office.(*)..",
"..hs.booking.(*)..",
"..hs.hosting.(*)..",
"..hs.scenarios",
"..hs.migration",
"..rbacgrant" // TODO.test: just because of RbacGrantsDiagramServiceIntegrationTest
);

View File

@ -30,9 +30,9 @@ import net.hostsharing.hsadminng.hs.office.scenarios.person.ShouldUpdatePersonDa
import net.hostsharing.hsadminng.hs.office.scenarios.subscription.RemoveOperationsContactFromPartner;
import net.hostsharing.hsadminng.hs.office.scenarios.subscription.SubscribeToMailinglist;
import net.hostsharing.hsadminng.hs.office.scenarios.subscription.UnsubscribeFromMailinglist;
import net.hostsharing.hsadminng.test.scenarios.Produces;
import net.hostsharing.hsadminng.test.scenarios.Requires;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.Produces;
import net.hostsharing.hsadminng.hs.scenarios.Requires;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import net.hostsharing.hsadminng.test.IgnoreOnFailureExtension;
import org.junit.jupiter.api.ClassOrderer;

View File

@ -1,7 +1,7 @@
package net.hostsharing.hsadminng.hs.office.scenarios.contact;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import org.springframework.http.HttpStatus;

View File

@ -1,7 +1,7 @@
package net.hostsharing.hsadminng.hs.office.scenarios.contact;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import org.springframework.http.HttpStatus;
import static io.restassured.http.ContentType.JSON;

View File

@ -1,7 +1,7 @@
package net.hostsharing.hsadminng.hs.office.scenarios.contact;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import org.springframework.http.HttpStatus;
import static io.restassured.http.ContentType.JSON;

View File

@ -1,7 +1,7 @@
package net.hostsharing.hsadminng.hs.office.scenarios.contact;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import static io.restassured.http.ContentType.JSON;
import static org.springframework.http.HttpStatus.CREATED;

View File

@ -1,7 +1,7 @@
package net.hostsharing.hsadminng.hs.office.scenarios.debitor;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.office.scenarios.person.CreatePerson;
import static io.restassured.http.ContentType.JSON;

View File

@ -1,7 +1,7 @@
package net.hostsharing.hsadminng.hs.office.scenarios.debitor;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import static io.restassured.http.ContentType.JSON;
import static org.springframework.http.HttpStatus.CREATED;

View File

@ -1,7 +1,7 @@
package net.hostsharing.hsadminng.hs.office.scenarios.debitor;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import static io.restassured.http.ContentType.JSON;
import static org.springframework.http.HttpStatus.CREATED;

View File

@ -1,7 +1,7 @@
package net.hostsharing.hsadminng.hs.office.scenarios.debitor;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import org.springframework.http.HttpStatus;
public class DeleteDebitor extends UseCase<DeleteDebitor> {

View File

@ -1,7 +1,7 @@
package net.hostsharing.hsadminng.hs.office.scenarios.debitor;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import org.springframework.http.HttpStatus;
public class DontDeleteDefaultDebitor extends UseCase<DontDeleteDefaultDebitor> {

View File

@ -1,7 +1,7 @@
package net.hostsharing.hsadminng.hs.office.scenarios.debitor;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import org.springframework.http.HttpStatus;
import static io.restassured.http.ContentType.JSON;

View File

@ -1,7 +1,7 @@
package net.hostsharing.hsadminng.hs.office.scenarios.debitor;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import static io.restassured.http.ContentType.JSON;
import static org.springframework.http.HttpStatus.OK;

View File

@ -1,8 +1,8 @@
package net.hostsharing.hsadminng.hs.office.scenarios.membership;
import io.restassured.http.ContentType;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import org.springframework.http.HttpStatus;
import static io.restassured.http.ContentType.JSON;

View File

@ -1,8 +1,8 @@
package net.hostsharing.hsadminng.hs.office.scenarios.membership;
import io.restassured.http.ContentType;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import org.springframework.http.HttpStatus;
import static io.restassured.http.ContentType.JSON;

View File

@ -1,6 +1,6 @@
package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
public class CreateCoopAssetsDepositTransaction extends CreateCoopAssetsTransaction {

View File

@ -1,6 +1,6 @@
package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
public class CreateCoopAssetsDisbursalTransaction extends CreateCoopAssetsTransaction {

View File

@ -1,6 +1,6 @@
package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
public class CreateCoopAssetsRevertSimpleTransaction extends CreateCoopAssetsTransaction {

View File

@ -1,13 +1,13 @@
package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets;
import io.restassured.http.ContentType;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import org.springframework.http.HttpStatus;
import java.math.BigDecimal;
import static net.hostsharing.hsadminng.test.scenarios.ScenarioTest.resolveTyped;
import static net.hostsharing.hsadminng.hs.scenarios.ScenarioTest.resolveTyped;
public class CreateCoopAssetsRevertTransferTransaction extends CreateCoopAssetsTransaction {

View File

@ -1,8 +1,8 @@
package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets;
import io.restassured.http.ContentType;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import org.springframework.http.HttpStatus;
import static io.restassured.http.ContentType.JSON;

View File

@ -1,10 +1,10 @@
package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.office.scenarios.membership.CreateMembership;
import net.hostsharing.hsadminng.hs.office.scenarios.partner.CreatePartner;
import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS;
import static net.hostsharing.hsadminng.hs.scenarios.TemplateResolver.Resolver.DROP_COMMENTS;
public class CreateCoopAssetsTransferTransaction extends CreateCoopAssetsTransaction {

View File

@ -1,6 +1,6 @@
package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopshares;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
public class CreateCoopSharesCancellationTransaction extends CreateCoopSharesTransaction {

View File

@ -1,6 +1,6 @@
package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopshares;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
public class CreateCoopSharesRevertTransaction extends CreateCoopSharesTransaction {

View File

@ -1,6 +1,6 @@
package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopshares;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
public class CreateCoopSharesSubscriptionTransaction extends CreateCoopSharesTransaction {

View File

@ -1,8 +1,8 @@
package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopshares;
import io.restassured.http.ContentType;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import org.springframework.http.HttpStatus;
import static io.restassured.http.ContentType.JSON;

View File

@ -1,8 +1,8 @@
package net.hostsharing.hsadminng.hs.office.scenarios.partner;
import io.restassured.http.ContentType;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import org.springframework.http.HttpStatus;
import static io.restassured.http.ContentType.JSON;

View File

@ -1,8 +1,8 @@
package net.hostsharing.hsadminng.hs.office.scenarios.partner;
import io.restassured.http.ContentType;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import org.springframework.http.HttpStatus;
import static io.restassured.http.ContentType.JSON;

View File

@ -1,8 +1,8 @@
package net.hostsharing.hsadminng.hs.office.scenarios.partner;
import io.restassured.http.ContentType;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import org.springframework.http.HttpStatus;
import static io.restassured.http.ContentType.JSON;

View File

@ -1,7 +1,7 @@
package net.hostsharing.hsadminng.hs.office.scenarios.partner;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import org.springframework.http.HttpStatus;
public class DeletePartner extends UseCase<DeletePartner> {

View File

@ -1,8 +1,8 @@
package net.hostsharing.hsadminng.hs.office.scenarios.person;
import io.restassured.http.ContentType;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import org.springframework.http.HttpStatus;
public class CreatePerson extends UseCase<CreatePerson> {

View File

@ -1,7 +1,7 @@
package net.hostsharing.hsadminng.hs.office.scenarios.person;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import org.springframework.http.HttpStatus;
import static io.restassured.http.ContentType.JSON;

View File

@ -1,7 +1,7 @@
package net.hostsharing.hsadminng.hs.office.scenarios.subscription;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import static io.restassured.http.ContentType.JSON;
import static org.springframework.http.HttpStatus.NOT_FOUND;

View File

@ -1,8 +1,8 @@
package net.hostsharing.hsadminng.hs.office.scenarios.subscription;
import io.restassured.http.ContentType;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import org.springframework.http.HttpStatus;
import static io.restassured.http.ContentType.JSON;

View File

@ -1,7 +1,7 @@
package net.hostsharing.hsadminng.hs.office.scenarios.subscription;
import net.hostsharing.hsadminng.test.scenarios.UseCase;
import net.hostsharing.hsadminng.test.scenarios.ScenarioTest;
import net.hostsharing.hsadminng.hs.scenarios.UseCase;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
import static io.restassured.http.ContentType.JSON;
import static org.springframework.http.HttpStatus.NO_CONTENT;

View File

@ -1,4 +1,4 @@
package net.hostsharing.hsadminng.test.scenarios;
package net.hostsharing.hsadminng.hs.scenarios;
public final class JsonOptional<V> {

View File

@ -1,10 +1,10 @@
package net.hostsharing.hsadminng.test.scenarios;
package net.hostsharing.hsadminng.hs.scenarios;
import net.hostsharing.hsadminng.test.scenarios.UseCase.HttpResponse;
import net.hostsharing.hsadminng.hs.scenarios.UseCase.HttpResponse;
import java.util.function.Consumer;
import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS;
import static net.hostsharing.hsadminng.hs.scenarios.TemplateResolver.Resolver.DROP_COMMENTS;
import static org.junit.jupiter.api.Assertions.fail;
public class PathAssertion {

View File

@ -1,4 +1,4 @@
package net.hostsharing.hsadminng.test.scenarios;
package net.hostsharing.hsadminng.hs.scenarios;
import lombok.experimental.UtilityClass;

View File

@ -1,4 +1,4 @@
package net.hostsharing.hsadminng.test.scenarios;
package net.hostsharing.hsadminng.hs.scenarios;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

View File

@ -1,4 +1,4 @@
package net.hostsharing.hsadminng.test.scenarios;
package net.hostsharing.hsadminng.hs.scenarios;
import lombok.SneakyThrows;
import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity;
@ -6,7 +6,7 @@ import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRepository;
import net.hostsharing.hsadminng.lambda.Reducer;
import net.hostsharing.hsadminng.rbac.context.ContextBasedTest;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver;
import net.hostsharing.hsadminng.hs.scenarios.TemplateResolver.Resolver;
import org.apache.commons.collections4.SetUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.jetbrains.annotations.NotNull;
@ -30,8 +30,8 @@ import java.util.stream.Stream;
import static java.util.Arrays.stream;
import static java.util.Optional.ofNullable;
import static net.hostsharing.hsadminng.test.scenarios.Produces.Aggregator.producedAliases;
import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS;
import static net.hostsharing.hsadminng.hs.scenarios.Produces.Aggregator.producedAliases;
import static net.hostsharing.hsadminng.hs.scenarios.TemplateResolver.Resolver.DROP_COMMENTS;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
import static org.assertj.core.api.Assertions.assertThat;

View File

@ -1,4 +1,4 @@
package net.hostsharing.hsadminng.test.scenarios;
package net.hostsharing.hsadminng.hs.scenarios;
import org.apache.commons.lang3.StringUtils;
@ -10,7 +10,7 @@ import java.util.Objects;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS;
import static net.hostsharing.hsadminng.hs.scenarios.TemplateResolver.Resolver.DROP_COMMENTS;
public class TemplateResolver {

View File

@ -1,10 +1,10 @@
package net.hostsharing.hsadminng.test.scenarios;
package net.hostsharing.hsadminng.hs.scenarios;
import org.junit.jupiter.api.Test;
import java.util.Map;
import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS;
import static net.hostsharing.hsadminng.hs.scenarios.TemplateResolver.Resolver.DROP_COMMENTS;
import static org.assertj.core.api.Assertions.assertThat;
class TemplateResolverUnitTest {

View File

@ -1,4 +1,4 @@
package net.hostsharing.hsadminng.test.scenarios;
package net.hostsharing.hsadminng.hs.scenarios;
import lombok.SneakyThrows;
import net.hostsharing.hsadminng.system.SystemProcess;

View File

@ -1,4 +1,4 @@
package net.hostsharing.hsadminng.test.scenarios;
package net.hostsharing.hsadminng.hs.scenarios;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
@ -35,8 +35,8 @@ import java.util.function.Supplier;
import static java.net.URLEncoder.encode;
import static java.util.stream.Collectors.joining;
import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.DROP_COMMENTS;
import static net.hostsharing.hsadminng.test.scenarios.TemplateResolver.Resolver.KEEP_COMMENTS;
import static net.hostsharing.hsadminng.hs.scenarios.TemplateResolver.Resolver.DROP_COMMENTS;
import static net.hostsharing.hsadminng.hs.scenarios.TemplateResolver.Resolver.KEEP_COMMENTS;
import static net.hostsharing.hsadminng.test.DebuggerDetection.isDebuggerAttached;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.fail;

View File

@ -1,4 +1,4 @@
package net.hostsharing.hsadminng.test.scenarios;
package net.hostsharing.hsadminng.hs.scenarios;
import static org.assertj.core.api.Assumptions.assumeThat;