Alex Kuznetsov
04/19/2020, 8:09 PMdata class Thing(val color: String, val shape: String)
val myThing = Thing("Red", "Square")
serializeToSourceCode(myThing)
output:
Thing(color="Red", shape="Square")
The context: I am replacing an API call with a mock. I have a lot of integration tests that hit the actual API. I have a proxy for the API calls to go through. On every API call thru that proxy, I'd like to get something like this:
every { myApi.callMethod(1, Thing("Red", "Square") } returns LocalDate.of(2020, 4, 30)
So that I don't have to type that manually.