@Test
fun `request without sone id results in invalid-sone-id`() {
- assertThat(json.isSuccess, equalTo(false))
- assertThat(json.error, equalTo("invalid-sone-id"))
+ assertThatJsonFailed("invalid-sone-id")
}
@Test
fun `request with sone follows sone`() {
addSone(mock<Sone>().apply { whenever(id).thenReturn("sone-id") })
addRequestParameter("sone", "sone-id")
- assertThat(json.isSuccess, equalTo(true))
+ assertThatJsonIsSuccessful()
verify(core).followSone(currentSone, "sone-id")
}
val sone = mock<Sone>()
addSone(sone, "sone-id")
addRequestParameter("sone", "sone-id")
- assertThat(json.isSuccess, equalTo(true))
+ assertThatJsonIsSuccessful()
verify(core).markSoneKnown(sone)
}