Don’t hand in null to function not allowing it
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / database / memory / MemoryPostTest.kt
1 package net.pterodactylus.sone.database.memory
2
3 import com.google.common.base.Optional.*
4 import net.pterodactylus.sone.test.*
5 import org.hamcrest.MatcherAssert.*
6 import org.hamcrest.Matchers.*
7 import org.junit.*
8 import java.util.*
9
10 class MemoryPostTest {
11
12         @Test
13         fun `memory post returns empty optional for post without recipient`() {
14                 val postDatabase = mock<MemoryDatabase>()
15                 val memoryPost = MemoryPost(postDatabase, postDatabase, UUID.randomUUID().toString(), "soneId", null, 123, "text")
16                 assertThat(memoryPost.recipient, equalTo(absent()))
17         }
18
19 }