com.baulsupp.oksocial.output.TestOutputHandler.kt Maven / Gradle / Ivy
package com.baulsupp.oksocial.output
class TestOutputHandler : OutputHandler {
val responses: MutableList = mutableListOf()
val failures: MutableList = mutableListOf()
val stdout: MutableList = mutableListOf()
override suspend fun showOutput(response: R) {
responses.add(response)
}
override suspend fun showError(message: String?, e: Throwable?) {
if (e != null) {
failures.add(e)
}
}
override fun info(message: String) {
stdout.add(message)
}
}