{"action":"created","comment":{"url":"https://api.github.com/repos/keboola/runner-sync-api/pulls/comments/221567723","pull_request_review_id":160244533,"id":221567723,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTU2NzcyMw==","diff_hunk":"@@ -0,0 +1,91 @@\n+<?php\n+\n+declare(strict_types=1);\n+\n+namespace App\\Tests\\Processor;\n+\n+use App\\Processor\\RequestProcessor;\n+use Keboola\\ErrorControl\\Exception\\UserException;\n+use Keboola\\ObjectEncryptor\\ObjectEncryptorFactory;\n+use Symfony\\Bundle\\FrameworkBundle\\Test\\WebTestCase;\n+use Symfony\\Component\\HttpFoundation\\Request;\n+\n+class RequestProcessorTest extends WebTestCase\n+{\n+    public function setUp() : void\n+    {\n+        parent::setUp();\n+        static::bootKernel();\n+    }\n+\n+    private function getEncryptorFactory(): ObjectEncryptorFactory\n+    {\n+        /** @var ObjectEncryptorFactory $encryptorFactory */\n+        $encryptorFactory = clone self::$container->get(ObjectEncryptorFactory::class);\n+        $encryptorFactory->setStackId('123');\n+        $encryptorFactory->setComponentId('123');\n+        $encryptorFactory->setConfigurationId('123');\n+        $encryptorFactory->setProjectId('123');\n+        return $encryptorFactory;\n+    }\n+\n+    public function testProcessEmpty(): void\n+    {\n+        $content = '{}';\n+        $request = Request::create('/dummy', 'GET', [], [], [], [], $content);\n+        self::expectException(UserException::class);\n+        self::expectExceptionMessage('The configData attribute must be present in the request body and be an object.');\n+        RequestProcessor::process($request, $this->getEncryptorFactory());\n+    }\n+\n+    public function testProcessConfigDataEmpty(): void\n+    {\n+        $content = '{\"configData\": null}';\n+        $request = Request::create('/dummy', 'GET', [], [], [], [], $content);\n+        self::expectException(UserException::class);\n+        self::expectExceptionMessage('The configData attribute must be present in the request body and be an object.');\n+        RequestProcessor::process($request, $this->getEncryptorFactory());\n+    }\n+\n+    public function testProcessConfigDataInvalid(): void\n+    {\n+        $content = '{\"configData\": \"fooBar\"}';\n+        $request = Request::create('/dummy', 'GET', [], [], [], [], $content);\n+        self::expectException(UserException::class);","path":"tests/Processor/RequestProcessorTest.php","position":54,"original_position":54,"commit_id":"58d8357cd8e82abb99e0e4af3f607d040cd96926","original_commit_id":"58d8357cd8e82abb99e0e4af3f607d040cd96926","user":{"login":"ondrejhlavacek","id":497675,"node_id":"MDQ6VXNlcjQ5NzY3NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/497675?v=4","gravatar_id":"","url":"https://api.github.com/users/ondrejhlavacek","html_url":"https://github.com/ondrejhlavacek","followers_url":"https://api.github.com/users/ondrejhlavacek/followers","following_url":"https://api.github.com/users/ondrejhlavacek/following{/other_user}","gists_url":"https://api.github.com/users/ondrejhlavacek/gists{/gist_id}","starred_url":"https://api.github.com/users/ondrejhlavacek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ondrejhlavacek/subscriptions","organizations_url":"https://api.github.com/users/ondrejhlavacek/orgs","repos_url":"https://api.github.com/users/ondrejhlavacek/repos","events_url":"https://api.github.com/users/ondrejhlavacek/events{/privacy}","received_events_url":"https://api.github.com/users/ondrejhlavacek/received_events","type":"User","site_admin":false},"body":"možná by všechny UserExceptions šly řešit přes data providery?","created_at":"2018-10-01T10:56:43Z","updated_at":"2018-10-01T10:56:43Z","html_url":"https://github.com/keboola/runner-sync-api/pull/18#discussion_r221567723","pull_request_url":"https://api.github.com/repos/keboola/runner-sync-api/pulls/18","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/keboola/runner-sync-api/pulls/comments/221567723"},"html":{"href":"https://github.com/keboola/runner-sync-api/pull/18#discussion_r221567723"},"pull_request":{"href":"https://api.github.com/repos/keboola/runner-sync-api/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/keboola/runner-sync-api/pulls/18","id":219324482,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5MzI0NDgy","html_url":"https://github.com/keboola/runner-sync-api/pull/18","diff_url":"https://github.com/keboola/runner-sync-api/pull/18.diff","patch_url":"https://github.com/keboola/runner-sync-api/pull/18.patch","issue_url":"https://api.github.com/repos/keboola/runner-sync-api/issues/18","number":18,"state":"open","locked":false,"title":"refactor","user":{"login":"odinuv","id":4319320,"node_id":"MDQ6VXNlcjQzMTkzMjA=","avatar_url":"https://avatars0.githubusercontent.com/u/4319320?v=4","gravatar_id":"","url":"https://api.github.com/users/odinuv","html_url":"https://github.com/odinuv","followers_url":"https://api.github.com/users/odinuv/followers","following_url":"https://api.github.com/users/odinuv/following{/other_user}","gists_url":"https://api.github.com/users/odinuv/gists{/gist_id}","starred_url":"https://api.github.com/users/odinuv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odinuv/subscriptions","organizations_url":"https://api.github.com/users/odinuv/orgs","repos_url":"https://api.github.com/users/odinuv/repos","events_url":"https://api.github.com/users/odinuv/events{/privacy}","received_events_url":"https://api.github.com/users/odinuv/received_events","type":"User","site_admin":false},"body":"fixes #14","created_at":"2018-10-01T10:17:16Z","updated_at":"2018-10-01T10:56:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"54033501106ca62cd078fa1c59d62afd6003ecee","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/keboola/runner-sync-api/pulls/18/commits","review_comments_url":"https://api.github.com/repos/keboola/runner-sync-api/pulls/18/comments","review_comment_url":"https://api.github.com/repos/keboola/runner-sync-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/keboola/runner-sync-api/issues/18/comments","statuses_url":"https://api.github.com/repos/keboola/runner-sync-api/statuses/58d8357cd8e82abb99e0e4af3f607d040cd96926","head":{"label":"keboola:odin-refactor","ref":"odin-refactor","sha":"58d8357cd8e82abb99e0e4af3f607d040cd96926","user":{"login":"keboola","id":1424387,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MjQzODc=","avatar_url":"https://avatars1.githubusercontent.com/u/1424387?v=4","gravatar_id":"","url":"https://api.github.com/users/keboola","html_url":"https://github.com/keboola","followers_url":"https://api.github.com/users/keboola/followers","following_url":"https://api.github.com/users/keboola/following{/other_user}","gists_url":"https://api.github.com/users/keboola/gists{/gist_id}","starred_url":"https://api.github.com/users/keboola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keboola/subscriptions","organizations_url":"https://api.github.com/users/keboola/orgs","repos_url":"https://api.github.com/users/keboola/repos","events_url":"https://api.github.com/users/keboola/events{/privacy}","received_events_url":"https://api.github.com/users/keboola/received_events","type":"Organization","site_admin":false},"repo":{"id":134317214,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQzMTcyMTQ=","name":"runner-sync-api","full_name":"keboola/runner-sync-api","private":false,"owner":{"login":"keboola","id":1424387,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MjQzODc=","avatar_url":"https://avatars1.githubusercontent.com/u/1424387?v=4","gravatar_id":"","url":"https://api.github.com/users/keboola","html_url":"https://github.com/keboola","followers_url":"https://api.github.com/users/keboola/followers","following_url":"https://api.github.com/users/keboola/following{/other_user}","gists_url":"https://api.github.com/users/keboola/gists{/gist_id}","starred_url":"https://api.github.com/users/keboola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keboola/subscriptions","organizations_url":"https://api.github.com/users/keboola/orgs","repos_url":"https://api.github.com/users/keboola/repos","events_url":"https://api.github.com/users/keboola/events{/privacy}","received_events_url":"https://api.github.com/users/keboola/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/keboola/runner-sync-api","description":null,"fork":false,"url":"https://api.github.com/repos/keboola/runner-sync-api","forks_url":"https://api.github.com/repos/keboola/runner-sync-api/forks","keys_url":"https://api.github.com/repos/keboola/runner-sync-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keboola/runner-sync-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keboola/runner-sync-api/teams","hooks_url":"https://api.github.com/repos/keboola/runner-sync-api/hooks","issue_events_url":"https://api.github.com/repos/keboola/runner-sync-api/issues/events{/number}","events_url":"https://api.github.com/repos/keboola/runner-sync-api/events","assignees_url":"https://api.github.com/repos/keboola/runner-sync-api/assignees{/user}","branches_url":"https://api.github.com/repos/keboola/runner-sync-api/branches{/branch}","tags_url":"https://api.github.com/repos/keboola/runner-sync-api/tags","blobs_url":"https://api.github.com/repos/keboola/runner-sync-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keboola/runner-sync-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keboola/runner-sync-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/keboola/runner-sync-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keboola/runner-sync-api/statuses/{sha}","languages_url":"https://api.github.com/repos/keboola/runner-sync-api/languages","stargazers_url":"https://api.github.com/repos/keboola/runner-sync-api/stargazers","contributors_url":"https://api.github.com/repos/keboola/runner-sync-api/contributors","subscribers_url":"https://api.github.com/repos/keboola/runner-sync-api/subscribers","subscription_url":"https://api.github.com/repos/keboola/runner-sync-api/subscription","commits_url":"https://api.github.com/repos/keboola/runner-sync-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/keboola/runner-sync-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/keboola/runner-sync-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/keboola/runner-sync-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/keboola/runner-sync-api/contents/{+path}","compare_url":"https://api.github.com/repos/keboola/runner-sync-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keboola/runner-sync-api/merges","archive_url":"https://api.github.com/repos/keboola/runner-sync-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keboola/runner-sync-api/downloads","issues_url":"https://api.github.com/repos/keboola/runner-sync-api/issues{/number}","pulls_url":"https://api.github.com/repos/keboola/runner-sync-api/pulls{/number}","milestones_url":"https://api.github.com/repos/keboola/runner-sync-api/milestones{/number}","notifications_url":"https://api.github.com/repos/keboola/runner-sync-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keboola/runner-sync-api/labels{/name}","releases_url":"https://api.github.com/repos/keboola/runner-sync-api/releases{/id}","deployments_url":"https://api.github.com/repos/keboola/runner-sync-api/deployments","created_at":"2018-05-21T19:44:37Z","updated_at":"2018-09-27T12:27:27Z","pushed_at":"2018-10-01T10:42:34Z","git_url":"git://github.com/keboola/runner-sync-api.git","ssh_url":"git@github.com:keboola/runner-sync-api.git","clone_url":"https://github.com/keboola/runner-sync-api.git","svn_url":"https://github.com/keboola/runner-sync-api","homepage":null,"size":288,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":9,"license":null,"forks":0,"open_issues":9,"watchers":1,"default_branch":"master"}},"base":{"label":"keboola:master","ref":"master","sha":"6226a6fd67d038b9f37d17e5969bd6c9152abb5a","user":{"login":"keboola","id":1424387,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MjQzODc=","avatar_url":"https://avatars1.githubusercontent.com/u/1424387?v=4","gravatar_id":"","url":"https://api.github.com/users/keboola","html_url":"https://github.com/keboola","followers_url":"https://api.github.com/users/keboola/followers","following_url":"https://api.github.com/users/keboola/following{/other_user}","gists_url":"https://api.github.com/users/keboola/gists{/gist_id}","starred_url":"https://api.github.com/users/keboola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keboola/subscriptions","organizations_url":"https://api.github.com/users/keboola/orgs","repos_url":"https://api.github.com/users/keboola/repos","events_url":"https://api.github.com/users/keboola/events{/privacy}","received_events_url":"https://api.github.com/users/keboola/received_events","type":"Organization","site_admin":false},"repo":{"id":134317214,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQzMTcyMTQ=","name":"runner-sync-api","full_name":"keboola/runner-sync-api","private":false,"owner":{"login":"keboola","id":1424387,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MjQzODc=","avatar_url":"https://avatars1.githubusercontent.com/u/1424387?v=4","gravatar_id":"","url":"https://api.github.com/users/keboola","html_url":"https://github.com/keboola","followers_url":"https://api.github.com/users/keboola/followers","following_url":"https://api.github.com/users/keboola/following{/other_user}","gists_url":"https://api.github.com/users/keboola/gists{/gist_id}","starred_url":"https://api.github.com/users/keboola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keboola/subscriptions","organizations_url":"https://api.github.com/users/keboola/orgs","repos_url":"https://api.github.com/users/keboola/repos","events_url":"https://api.github.com/users/keboola/events{/privacy}","received_events_url":"https://api.github.com/users/keboola/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/keboola/runner-sync-api","description":null,"fork":false,"url":"https://api.github.com/repos/keboola/runner-sync-api","forks_url":"https://api.github.com/repos/keboola/runner-sync-api/forks","keys_url":"https://api.github.com/repos/keboola/runner-sync-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keboola/runner-sync-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keboola/runner-sync-api/teams","hooks_url":"https://api.github.com/repos/keboola/runner-sync-api/hooks","issue_events_url":"https://api.github.com/repos/keboola/runner-sync-api/issues/events{/number}","events_url":"https://api.github.com/repos/keboola/runner-sync-api/events","assignees_url":"https://api.github.com/repos/keboola/runner-sync-api/assignees{/user}","branches_url":"https://api.github.com/repos/keboola/runner-sync-api/branches{/branch}","tags_url":"https://api.github.com/repos/keboola/runner-sync-api/tags","blobs_url":"https://api.github.com/repos/keboola/runner-sync-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keboola/runner-sync-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keboola/runner-sync-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/keboola/runner-sync-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keboola/runner-sync-api/statuses/{sha}","languages_url":"https://api.github.com/repos/keboola/runner-sync-api/languages","stargazers_url":"https://api.github.com/repos/keboola/runner-sync-api/stargazers","contributors_url":"https://api.github.com/repos/keboola/runner-sync-api/contributors","subscribers_url":"https://api.github.com/repos/keboola/runner-sync-api/subscribers","subscription_url":"https://api.github.com/repos/keboola/runner-sync-api/subscription","commits_url":"https://api.github.com/repos/keboola/runner-sync-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/keboola/runner-sync-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/keboola/runner-sync-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/keboola/runner-sync-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/keboola/runner-sync-api/contents/{+path}","compare_url":"https://api.github.com/repos/keboola/runner-sync-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keboola/runner-sync-api/merges","archive_url":"https://api.github.com/repos/keboola/runner-sync-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keboola/runner-sync-api/downloads","issues_url":"https://api.github.com/repos/keboola/runner-sync-api/issues{/number}","pulls_url":"https://api.github.com/repos/keboola/runner-sync-api/pulls{/number}","milestones_url":"https://api.github.com/repos/keboola/runner-sync-api/milestones{/number}","notifications_url":"https://api.github.com/repos/keboola/runner-sync-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keboola/runner-sync-api/labels{/name}","releases_url":"https://api.github.com/repos/keboola/runner-sync-api/releases{/id}","deployments_url":"https://api.github.com/repos/keboola/runner-sync-api/deployments","created_at":"2018-05-21T19:44:37Z","updated_at":"2018-09-27T12:27:27Z","pushed_at":"2018-10-01T10:42:34Z","git_url":"git://github.com/keboola/runner-sync-api.git","ssh_url":"git@github.com:keboola/runner-sync-api.git","clone_url":"https://github.com/keboola/runner-sync-api.git","svn_url":"https://github.com/keboola/runner-sync-api","homepage":null,"size":288,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":9,"license":null,"forks":0,"open_issues":9,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/keboola/runner-sync-api/pulls/18"},"html":{"href":"https://github.com/keboola/runner-sync-api/pull/18"},"issue":{"href":"https://api.github.com/repos/keboola/runner-sync-api/issues/18"},"comments":{"href":"https://api.github.com/repos/keboola/runner-sync-api/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/keboola/runner-sync-api/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/keboola/runner-sync-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/keboola/runner-sync-api/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/keboola/runner-sync-api/statuses/58d8357cd8e82abb99e0e4af3f607d040cd96926"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ondrejhlavacek"}}