From: David ‘Bombe’ Roden Date: Fri, 1 Nov 2019 17:37:45 +0000 (+0100) Subject: 🚧 Add matcher for own identities X-Git-Tag: v81^2~93 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=d8b8330c6f0a28a59586970648dd166ca48fe2ee;p=Sone.git 🚧 Add matcher for own identities --- diff --git a/src/test/kotlin/net/pterodactylus/sone/test/Matchers.kt b/src/test/kotlin/net/pterodactylus/sone/test/Matchers.kt index d941c01..21d225c 100644 --- a/src/test/kotlin/net/pterodactylus/sone/test/Matchers.kt +++ b/src/test/kotlin/net/pterodactylus/sone/test/Matchers.kt @@ -65,6 +65,15 @@ fun isIdentity(id: String, nickname: String, requestUri: String, contexts: Match .addAttribute("contexts", Identity::getContexts, contexts) .addAttribute("properties", Identity::getProperties, properties) +fun isOwnIdentity(id: String, nickname: String, requestUri: String, insertUri: String, contexts: Matcher>, properties: Matcher>) = + AttributeMatcher("own identity") + .addAttribute("id", id, OwnIdentity::getId) + .addAttribute("nickname", nickname, OwnIdentity::getNickname) + .addAttribute("request uri", requestUri, OwnIdentity::getRequestUri) + .addAttribute("insert uri", insertUri, OwnIdentity::getInsertUri) + .addAttribute("contexts", OwnIdentity::getContexts, contexts) + .addAttribute("properties", OwnIdentity::getProperties, properties) + /** * [TypeSafeDiagnosingMatcher] implementation that aims to cut down boilerplate on verifying the attributes * of typical container objects.