re-add accidentally deleted tests

This commit is contained in:
Michael Hoennig 2024-12-29 11:18:55 +01:00
parent b0bfb06833
commit 4450deecb7
2 changed files with 51 additions and 2 deletions

View File

@ -143,7 +143,38 @@ class HsOfficePersonRbacRepositoryIntegrationTest extends ContextBasedTestWithCl
allThesePersonsAreReturned(
result,
"NP Smith, Peter",
"LP Peter Smith - The Second Hand and Thrift Stores-n-Shipping e.K.");
"LP Peter Smith - The Second Hand and Thrift Stores-n-Shipping e.K.",
"IF Third OHG",
"UF Erben Bessler");
}
@Test
public void arbitraryUser_canViewOnlyItsOwnPerson() {
// given:
final var givenPerson = givenSomeTemporaryPerson("pac-admin-zzz00@zzz.example.com");
// when:
context("pac-admin-zzz00@zzz.example.com");
final var result = personRbacRepo.findPersonByOptionalNameLike(null);
// then:
exactlyThesePersonsAreReturned(result, givenPerson.getTradeName());
}
}
@Nested
class FindByCaptionLike {
@Test
public void globalAdmin_withoutAssumedRole_canViewAllPersons() {
// given
context("superuser-alex@hostsharing.net", null);
// when
final var result = personRbacRepo.findPersonByOptionalNameLike("Peter Smith - The Second Hand%");
// then
exactlyThesePersonsAreReturned(result, "Peter Smith - The Second Hand and Thrift Stores-n-Shipping e.K.");
}
@Test

View File

@ -126,7 +126,25 @@ class HsOfficePersonRealRepositoryIntegrationTest extends ContextBasedTestWithCl
allThesePersonsAreReturned(
result,
"NP Smith, Peter",
"LP Peter Smith - The Second Hand and Thrift Stores-n-Shipping e.K.");
"LP Peter Smith - The Second Hand and Thrift Stores-n-Shipping e.K.",
"IF Third OHG",
"UF Erben Bessler");
}
}
@Nested
class FindByCaptionLike {
@Test
public void arbitraryUser_canViewAllPersons() {
// given
context("selfregistered-user-drew@hostsharing.org");
// when
final var result = personRealRepo.findPersonByOptionalNameLike("Peter Smith - The Second Hand%");
// then
exactlyThesePersonsAreReturned(result, "Peter Smith - The Second Hand and Thrift Stores-n-Shipping e.K.");
}
}