public function it_stops_propagation_and_throws_unauthorizedexception_when_authorization_service_denies_access_without_deferred_and_exposes_message_name()
{
$authorizationService = $this->prophesize(AuthorizationService::class);
$authorizationService->isGranted('test_event')->willReturn(false);
$actionEvent = $this->prophesize(ActionEvent::class);
$actionEvent->getParam(QueryBus::EVENT_PARAM_PROMISE)->willReturn(null);
$actionEvent->getParam(MessageBus::EVENT_PARAM_MESSAGE_NAME)->willReturn('test_event');
$actionEvent->stopPropagation(true)->willReturn(null);
$routeGuard = new FinalizeGuard($authorizationService->reveal(), true);
$routeGuard->onFinalize($actionEvent->reveal());
}