TSK-1254: Added explicit test for base 64 encoded LDAP values.

This commit is contained in:
holgerhagen 2020-06-24 15:14:58 +02:00
parent 8760bdceb3
commit 0367a3deac
2 changed files with 19 additions and 2 deletions

View File

@ -76,6 +76,23 @@ class AccessIdControllerIntTest {
.containsExactlyInAnyOrder("Schläfrig, Tim", "Eifrig, Elena"); .containsExactlyInAnyOrder("Schläfrig, Tim", "Eifrig, Elena");
} }
@Test
void should_returnAccessIdWithUmlauten_ifBased64EncodedUserIsLookedUp() {
ResponseEntity<List<AccessIdRepresentationModel>> response =
template.exchange(
restHelper.toUrl(Mapping.URL_ACCESSID) + "?search-for=läf",
HttpMethod.GET,
restHelper.defaultRequest(),
ParameterizedTypeReference.forType(AccessIdListResource.class));
List<AccessIdRepresentationModel> body = response.getBody();
assertThat(body).isNotNull();
assertThat(body).hasSize(1);
assertThat(body)
.extracting(AccessIdRepresentationModel::getName)
.containsExactlyInAnyOrder("Schläfrig, Tim");
}
@Test @Test
void testBadRequestWhenSearchForIsTooShort() { void testBadRequestWhenSearchForIsTooShort() {
ThrowingCallable httpCall = ThrowingCallable httpCall =

View File

@ -156,9 +156,9 @@ objectclass: top
givenName: Tim givenName: Tim
description: desc description: desc
uid: user-2-2 uid: user-2-2
sn: Schläfrig sn:: U2NobMOkZnJpZw==
ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 2 ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 2
cn: Tim Schläfrig cn:: VGltIFNjaGzDpGZyaWc=
userPassword: user-2-1 userPassword: user-2-1
######################## ########################