suspend function testing with spock
I have a simple function in kotlin like that :
suspend fun createTicket(@Valid request: CreateTicketRequest, authentication: Authentication): HttpResponse {
request.customerId = "customerId"
logger().info("Receive by the client $request")
return HttpResponse.created(service.create(request))
}
I've already Mock the request and the authentication.
So, I call it on Spock:
def 'It should create a ticket with success'() {
given:
def request = createRequest(...