+ private val JsonReturnObject.error get() = if (this is JsonErrorReturnObject) this.error else null
+
+ protected fun assertThatJsonIsSuccessful() {
+ assertThat(json.isSuccess, equalTo(true))
+ }
+
+ protected fun assertThatJsonFailed(error: String? = null) {
+ assertThat(json.isSuccess, equalTo(false))
+ error?.run { assertThat(json.error, equalTo(this)) }
+ }