X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ftest%2FMatchers.kt;h=ecb20492e2d4e0da7fc60b9b2f08ff7eed61e324;hp=1f479f6ecec350fa76b599bcf43b9767535aee26;hb=2a9ef0e07136d8c56f4eea32ed49e43bfd5e576f;hpb=73ba74461ca2dd1da89f322aa87035f710fe4865 diff --git a/src/test/kotlin/net/pterodactylus/sone/test/Matchers.kt b/src/test/kotlin/net/pterodactylus/sone/test/Matchers.kt index 1f479f6..ecb2049 100644 --- a/src/test/kotlin/net/pterodactylus/sone/test/Matchers.kt +++ b/src/test/kotlin/net/pterodactylus/sone/test/Matchers.kt @@ -1,6 +1,7 @@ package net.pterodactylus.sone.test import freenet.support.* +import net.pterodactylus.sone.data.Post import net.pterodactylus.sone.freenet.wot.* import net.pterodactylus.sone.utils.* import net.pterodactylus.util.web.* @@ -106,6 +107,9 @@ fun hasField(name: String, valueMatcher: Matcher) = object : TypeSafeDia } } +fun isPost(isRecipientId: Matcher = any(String::class.java)) = AttributeMatcher("post") + .addAttribute("recipient ID", { it.recipientId.orNull() }, isRecipientId) + /** * [TypeSafeDiagnosingMatcher] implementation that aims to cut down boilerplate on verifying the attributes * of typical container objects.