diff --git a/src/main/kotlin/api/EventsApi.kt b/src/main/kotlin/api/EventsApi.kt index 731b726..4c48d07 100644 --- a/src/main/kotlin/api/EventsApi.kt +++ b/src/main/kotlin/api/EventsApi.kt @@ -21,7 +21,7 @@ interface EventsApi { suspend fun triggerEvent(@Body body: TriggerEventRequest): Response> @POST("$ENDPOINT/trigger/bulk") - suspend fun bulkTriggerEvent(@Body body: BulkTriggerEventRequest): Response> + suspend fun bulkTriggerEvent(@Body body: BulkTriggerEventRequest): Response>> @POST("$ENDPOINT/trigger/broadcast") suspend fun broadcastEvent(@Body body: BroadcastEventRequest): Response> diff --git a/src/main/kotlin/extensions/EventsExtensions.kt b/src/main/kotlin/extensions/EventsExtensions.kt index 81ccdda..2586fec 100644 --- a/src/main/kotlin/extensions/EventsExtensions.kt +++ b/src/main/kotlin/extensions/EventsExtensions.kt @@ -16,7 +16,7 @@ suspend fun Novu.trigger(body: TriggerEventRequest): ResponseWrapper? { +suspend fun Novu.bulkTrigger(body: BulkTriggerEventRequest): ResponseWrapper>? { val response = eventsApi.bulkTriggerEvent(body) return response.extractResponse(logger) } diff --git a/src/test/kotlin/EventsApiTest.kt b/src/test/kotlin/EventsApiTest.kt index bcdf20e..3000e10 100644 --- a/src/test/kotlin/EventsApiTest.kt +++ b/src/test/kotlin/EventsApiTest.kt @@ -97,11 +97,13 @@ class EventsApiTest { @Test fun testBulkTriggerEvent() = runTest { val responseBody = ResponseWrapper( - TriggerResponse( - acknowledged = true, - status = "status", - transactionId = "transactionId", - error = listOf("error") + listOf( + TriggerResponse( + acknowledged = true, + status = "status", + transactionId = "transactionId", + error = listOf("error") + ) ) ) mockWebServer.enqueue(