Use error property of JSON return object
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 31 Aug 2017 18:30:38 +0000 (20:30 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 1 Sep 2017 20:45:24 +0000 (22:45 +0200)
src/test/kotlin/net/pterodactylus/sone/web/ajax/BookmarkAjaxPageTest.kt

index d6ade8b..7e72e56 100644 (file)
@@ -16,14 +16,14 @@ class BookmarkAjaxPageTest : JsonPageTest("bookmark.ajax", requiresLogin = false
        @Test
        fun `missing post ID results in invalid id response`() {
                assertThat(json.isSuccess, equalTo(false))
-               assertThat((json as JsonErrorReturnObject).error, equalTo("invalid-post-id"))
+               assertThat(json.error, equalTo("invalid-post-id"))
        }
 
        @Test
        fun `empty post ID results in invalid id response`() {
                addRequestParameter("post", "")
                assertThat(json.isSuccess, equalTo(false))
-               assertThat((json as JsonErrorReturnObject).error, equalTo("invalid-post-id"))
+               assertThat(json.error, equalTo("invalid-post-id"))
        }
 
        @Test