Add support for reversed student name mailbox matching (#2051)

* Add support for reversed student name mailbox matching

* Add additional log stmt to mailbox matching in all mailbox load

* Revert changes in mapper
This commit is contained in:
Mikołaj Pich 2022-11-19 08:52:35 +01:00 committed by GitHub
parent 6c115fb915
commit b160367744
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 1 deletions

View file

@ -64,6 +64,18 @@ class GetMailboxByStudentUseCaseTest {
assertEquals(expectedMailbox, selectedMailbox)
}
@Test
fun `get mailbox for user with reversed name`() = runTest {
val student = getStudentEntity(
userName = "Kowalski Jan",
studentName = "Jan Kowalski",
)
val expectedMailbox = getMailboxEntity("Kowalski Jan")
coEvery { mailboxDao.loadAll(any()) } returns listOf(expectedMailbox)
assertEquals(expectedMailbox, systemUnderTest(student))
}
@Test
fun `get mailbox for unique non-authorized student`() = runTest {
val student = getStudentEntity(