remove UseCase from Alias

This commit is contained in:
Michael Hoennig 2024-12-17 10:37:16 +01:00
parent 2971f4196d
commit 9fa5bd96d6
2 changed files with 3 additions and 4 deletions

View File

@ -50,7 +50,7 @@ public abstract class ScenarioTest extends ContextBasedTest {
return Optional.of(currentTestMethodProduces.pop()); return Optional.of(currentTestMethodProduces.pop());
} }
public record Alias<T extends UseCase<T>>(Class<T> useCase, UUID uuid) { public record Alias<T extends UseCase<T>>(UUID uuid) {
@Override @Override
public String toString() { public String toString() {
@ -117,7 +117,6 @@ public abstract class ScenarioTest extends ContextBasedTest {
putAlias( putAlias(
"Person: Hostsharing eG", "Person: Hostsharing eG",
new Alias<>( new Alias<>(
null,
personRepo.findPersonByOptionalNameLike("Hostsharing eG") personRepo.findPersonByOptionalNameLike("Hostsharing eG")
.stream() .stream()
.map(HsOfficePersonRbacEntity::getUuid) .map(HsOfficePersonRbacEntity::getUuid)

View File

@ -306,14 +306,14 @@ public abstract class UseCase<T extends UseCase<?>> {
final var value = extractor.apply(this); final var value = extractor.apply(this);
ScenarioTest.putAlias( ScenarioTest.putAlias(
alias, alias,
new ScenarioTest.Alias<>(UseCase.this.getClass(), UUID.fromString(value))); new ScenarioTest.Alias<>(UUID.fromString(value)));
return this; return this;
} }
public HttpResponse keepAs(final String alias) { public HttpResponse keepAs(final String alias) {
ScenarioTest.putAlias( ScenarioTest.putAlias(
nonNullAlias(alias), nonNullAlias(alias),
new ScenarioTest.Alias<>(UseCase.this.getClass(), locationUuid)); new ScenarioTest.Alias<>(locationUuid));
return this; return this;
} }