From d8b8330c6f0a28a59586970648dd166ca48fe2ee Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 1 Nov 2019 18:37:45 +0100 Subject: [PATCH] =?utf8?q?=F0=9F=9A=A7=20Add=20matcher=20for=20own=20ident?= =?utf8?q?ities?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/test/kotlin/net/pterodactylus/sone/test/Matchers.kt | 9 +++++++++ 1 file changed, 9 insertions(+) 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. -- 2.7.4