$webhookEventLogRepository->
create([[ 'id' =>
$webhookEventId,
'appName' => 'SwagApp',
'deliveryStatus' => WebhookEventLogDefinition::STATUS_QUEUED,
'webhookName' => 'hook1',
'eventName' => 'order',
'appVersion' => '0.0.1',
'url' => 'https://test.com',
'serializedWebhookMessage' =>
serialize($webhookEventMessage),
]], Context::
createDefaultContext());
$this->
appendNewResponse(new Response(200
));
($this->webhookEventMessageHandler
)($webhookEventMessage);
$timestamp =
time();
$request =
$this->
getLastRequest();
static::
assertInstanceOf(RequestInterface::
class,
$request);
$payload =
$request->
getBody()->
getContents();
$body =
json_decode($payload, true, 512, \JSON_THROW_ON_ERROR
);
static::
assertEquals('POST',
$request->
getMethod());
static::
assertEquals($body['body'
], 'payload'
);