jev Result
fun jevResult(body: JsonObject, questions: QuestionSet, model: String = JevDefaults.MODEL, requestId: String? = null): JevResult(source)
A JevResult built from a raw response body, as JevApi.evaluate would have returned it for questions.
val jev = mockk<JevApi>()
coEvery { jev.evaluate(any(), any(), any()) } returns
jevResult("""{"answers":{"urgent":{"type":"noul","noul":0.92}}}""", Triage.questions)Content copied to clipboard
The body is validated exactly as a real one is, so a malformed answer raises JevResponseValidationException here too. Recording a real response and replaying it is a good way to keep a fixture honest.
fun jevResult(body: String, questions: QuestionSet, model: String = JevDefaults.MODEL, requestId: String? = null): JevResult(source)
The same, from the response body as JSON text.