dave
03/27/2019, 2:14 PMinterface Approver {
fun <T : HttpMessage> assertApproved(httpMessage: T)
}
fun Approver.assertApproved(response: Response, expectedStatus: Status) =
assertApproved(response.apply { assertEquals(expectedStatus, response.status) })
fun <T : HttpMessage> Approver.hasApprovedContent(): Matcher<T> = ...
The interface method is generified by HttpMessage, so for the first extension to be specific to Response
felt a little wrong. The second was specific to hamkrest, which is totally outside the remit of the actual interface. On top of that, we don't even ship hamkrest with the module, so whilst convienient, it's even further away conceptually from the main interface.tom_barnsbury
03/28/2019, 8:01 AMdave
03/28/2019, 9:01 AMtom_barnsbury
03/28/2019, 10:56 AM