{"action":"created","comment":{"url":"https://api.github.com/repos/ePages-de/epages-docs/pulls/comments/80634311","pull_request_review_id":1678362,"id":80634311,"diff_hunk":"@@ -0,0 +1,191 @@\n+---\n+layout: post\n+title: \"How we test our API\"\n+date: \"2016-09-28 11:11:11\"\n+image: blog-header/heartbeat.jpg\n+categories: tech-stories\n+authors: [\"Ulf B.\"]\n+---\n+\n+A few years ago, at the time when the development of the ePages REST API started,\n+ePages 6 was just a huge monolith written in Perl and already hard to handle.\n+Since the monolith should not be inflated even more and in order to be able to use state-of-the-art frameworks,\n+the REST API was started as a separate service implemented in Java.\n+\n+This service communicates with the monolith via REST and SOAP in order to operate on the data we won't to expose to the public.\n+All the API related business logic like right management and rate limits are implemented in Java such that the API's we had to implement in Perl could\n+become quiete simple.\n+\n+Of course all the resource and services classes are coverey by unit test on both sides, Perl and Java,\n+but since the functionality of the API is based on two different projects that live in two different repositories\n+which have two different teams responsible for the releases,\n+we wanted to have a simple way to check with one click if everything - from end to end - is working as expected.\n+\n+This was the starting point of RAT - our Rest API Test framework.\n+\n+## RAT\n+\n+The idea of RAT was to create a framework that allows us to easily verify the state of the REST API on an abritrary ePages installation.\n+\n+In order to do so, RAT sends requests to the API and validates the response.\n+To be able to compare the response with an expected one, we let the test run on shop of the DemoShopType\n+(The developer installation of ePages includes a DemoShopType which allows to create a demo shop with certain products of different types and a few orders).\n+We wanted the test cases to be able to run in a arbitrary order. The problem is that some of the API calls change a shop (DELETE product),\n+which lead to different results in the following calls. The solution is to create new shops for testing those calls.\n+The ePages6 REST API does not offer an endpoint to create new shops so far, so we used the ePages SOAP API to do that.\n+\n+RAT is based on [REST-assured](http://rest-assured.io/) and [Serenity BDD](http://www.thucydides.info), two tools that take over a lot of work on the way to produce nice test results. In the next paragraphs I will introduce these tools briefly and show how we use them.\n+\n+### REST-assured\n+\n+The certain test cases are implemented using REST-assured. It is a framework that is specially designed for testing REST APIs and allows easily to send different kind of requests and validation of their responses.\n+\n+A simple check if the product resource of our REST API is returning 22 products could look like that:","path":"_posts/2016/2016-09-28-rest-api-test-framework.md","position":43,"original_position":43,"commit_id":"1a369c8c5a3ee6dbc0e7f798496a39c6f8144517","original_commit_id":"1a369c8c5a3ee6dbc0e7f798496a39c6f8144517","user":{"login":"ubep","id":7428918,"avatar_url":"https://avatars.githubusercontent.com/u/7428918?v=3","gravatar_id":"","url":"https://api.github.com/users/ubep","html_url":"https://github.com/ubep","followers_url":"https://api.github.com/users/ubep/followers","following_url":"https://api.github.com/users/ubep/following{/other_user}","gists_url":"https://api.github.com/users/ubep/gists{/gist_id}","starred_url":"https://api.github.com/users/ubep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubep/subscriptions","organizations_url":"https://api.github.com/users/ubep/orgs","repos_url":"https://api.github.com/users/ubep/repos","events_url":"https://api.github.com/users/ubep/events{/privacy}","received_events_url":"https://api.github.com/users/ubep/received_events","type":"User","site_admin":false},"body":"ok","created_at":"2016-09-27T07:30:49Z","updated_at":"2016-09-27T07:30:49Z","html_url":"https://github.com/ePages-de/epages-docs/pull/645#discussion_r80634311","pull_request_url":"https://api.github.com/repos/ePages-de/epages-docs/pulls/645","_links":{"self":{"href":"https://api.github.com/repos/ePages-de/epages-docs/pulls/comments/80634311"},"html":{"href":"https://github.com/ePages-de/epages-docs/pull/645#discussion_r80634311"},"pull_request":{"href":"https://api.github.com/repos/ePages-de/epages-docs/pulls/645"}}},"pull_request":{"url":"https://api.github.com/repos/ePages-de/epages-docs/pulls/645","id":86704343,"html_url":"https://github.com/ePages-de/epages-docs/pull/645","diff_url":"https://github.com/ePages-de/epages-docs/pull/645.diff","patch_url":"https://github.com/ePages-de/epages-docs/pull/645.patch","issue_url":"https://api.github.com/repos/ePages-de/epages-docs/issues/645","number":645,"state":"open","locked":false,"title":"Blogpost/team red rat","user":{"login":"ubep","id":7428918,"avatar_url":"https://avatars.githubusercontent.com/u/7428918?v=3","gravatar_id":"","url":"https://api.github.com/users/ubep","html_url":"https://github.com/ubep","followers_url":"https://api.github.com/users/ubep/followers","following_url":"https://api.github.com/users/ubep/following{/other_user}","gists_url":"https://api.github.com/users/ubep/gists{/gist_id}","starred_url":"https://api.github.com/users/ubep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubep/subscriptions","organizations_url":"https://api.github.com/users/ubep/orgs","repos_url":"https://api.github.com/users/ubep/repos","events_url":"https://api.github.com/users/ubep/events{/privacy}","received_events_url":"https://api.github.com/users/ubep/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-26T09:01:07Z","updated_at":"2016-09-27T07:30:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c149162da10444101502025deee262d8ebca0b6e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ePages-de/epages-docs/pulls/645/commits","review_comments_url":"https://api.github.com/repos/ePages-de/epages-docs/pulls/645/comments","review_comment_url":"https://api.github.com/repos/ePages-de/epages-docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ePages-de/epages-docs/issues/645/comments","statuses_url":"https://api.github.com/repos/ePages-de/epages-docs/statuses/1a369c8c5a3ee6dbc0e7f798496a39c6f8144517","head":{"label":"ubep:blogpost/team-red-rat","ref":"blogpost/team-red-rat","sha":"1a369c8c5a3ee6dbc0e7f798496a39c6f8144517","user":{"login":"ubep","id":7428918,"avatar_url":"https://avatars.githubusercontent.com/u/7428918?v=3","gravatar_id":"","url":"https://api.github.com/users/ubep","html_url":"https://github.com/ubep","followers_url":"https://api.github.com/users/ubep/followers","following_url":"https://api.github.com/users/ubep/following{/other_user}","gists_url":"https://api.github.com/users/ubep/gists{/gist_id}","starred_url":"https://api.github.com/users/ubep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubep/subscriptions","organizations_url":"https://api.github.com/users/ubep/orgs","repos_url":"https://api.github.com/users/ubep/repos","events_url":"https://api.github.com/users/ubep/events{/privacy}","received_events_url":"https://api.github.com/users/ubep/received_events","type":"User","site_admin":false},"repo":{"id":49964621,"name":"epages-docs","full_name":"ubep/epages-docs","owner":{"login":"ubep","id":7428918,"avatar_url":"https://avatars.githubusercontent.com/u/7428918?v=3","gravatar_id":"","url":"https://api.github.com/users/ubep","html_url":"https://github.com/ubep","followers_url":"https://api.github.com/users/ubep/followers","following_url":"https://api.github.com/users/ubep/following{/other_user}","gists_url":"https://api.github.com/users/ubep/gists{/gist_id}","starred_url":"https://api.github.com/users/ubep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubep/subscriptions","organizations_url":"https://api.github.com/users/ubep/orgs","repos_url":"https://api.github.com/users/ubep/repos","events_url":"https://api.github.com/users/ubep/events{/privacy}","received_events_url":"https://api.github.com/users/ubep/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ubep/epages-docs","description":"Source of ePages Developer Portal","fork":true,"url":"https://api.github.com/repos/ubep/epages-docs","forks_url":"https://api.github.com/repos/ubep/epages-docs/forks","keys_url":"https://api.github.com/repos/ubep/epages-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ubep/epages-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ubep/epages-docs/teams","hooks_url":"https://api.github.com/repos/ubep/epages-docs/hooks","issue_events_url":"https://api.github.com/repos/ubep/epages-docs/issues/events{/number}","events_url":"https://api.github.com/repos/ubep/epages-docs/events","assignees_url":"https://api.github.com/repos/ubep/epages-docs/assignees{/user}","branches_url":"https://api.github.com/repos/ubep/epages-docs/branches{/branch}","tags_url":"https://api.github.com/repos/ubep/epages-docs/tags","blobs_url":"https://api.github.com/repos/ubep/epages-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ubep/epages-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ubep/epages-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ubep/epages-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ubep/epages-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/ubep/epages-docs/languages","stargazers_url":"https://api.github.com/repos/ubep/epages-docs/stargazers","contributors_url":"https://api.github.com/repos/ubep/epages-docs/contributors","subscribers_url":"https://api.github.com/repos/ubep/epages-docs/subscribers","subscription_url":"https://api.github.com/repos/ubep/epages-docs/subscription","commits_url":"https://api.github.com/repos/ubep/epages-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ubep/epages-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ubep/epages-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ubep/epages-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ubep/epages-docs/contents/{+path}","compare_url":"https://api.github.com/repos/ubep/epages-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ubep/epages-docs/merges","archive_url":"https://api.github.com/repos/ubep/epages-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ubep/epages-docs/downloads","issues_url":"https://api.github.com/repos/ubep/epages-docs/issues{/number}","pulls_url":"https://api.github.com/repos/ubep/epages-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/ubep/epages-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/ubep/epages-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ubep/epages-docs/labels{/name}","releases_url":"https://api.github.com/repos/ubep/epages-docs/releases{/id}","deployments_url":"https://api.github.com/repos/ubep/epages-docs/deployments","created_at":"2016-01-19T16:07:42Z","updated_at":"2016-01-19T16:07:43Z","pushed_at":"2016-09-26T16:32:24Z","git_url":"git://github.com/ubep/epages-docs.git","ssh_url":"git@github.com:ubep/epages-docs.git","clone_url":"https://github.com/ubep/epages-docs.git","svn_url":"https://github.com/ubep/epages-docs","homepage":"https://developer.epages.com/","size":176982,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"ePages-de:master","ref":"master","sha":"6979a3fc8cf592d362e9b58ea9aac7f904d4276f","user":{"login":"ePages-de","id":1125854,"avatar_url":"https://avatars.githubusercontent.com/u/1125854?v=3","gravatar_id":"","url":"https://api.github.com/users/ePages-de","html_url":"https://github.com/ePages-de","followers_url":"https://api.github.com/users/ePages-de/followers","following_url":"https://api.github.com/users/ePages-de/following{/other_user}","gists_url":"https://api.github.com/users/ePages-de/gists{/gist_id}","starred_url":"https://api.github.com/users/ePages-de/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ePages-de/subscriptions","organizations_url":"https://api.github.com/users/ePages-de/orgs","repos_url":"https://api.github.com/users/ePages-de/repos","events_url":"https://api.github.com/users/ePages-de/events{/privacy}","received_events_url":"https://api.github.com/users/ePages-de/received_events","type":"Organization","site_admin":false},"repo":{"id":30595510,"name":"epages-docs","full_name":"ePages-de/epages-docs","owner":{"login":"ePages-de","id":1125854,"avatar_url":"https://avatars.githubusercontent.com/u/1125854?v=3","gravatar_id":"","url":"https://api.github.com/users/ePages-de","html_url":"https://github.com/ePages-de","followers_url":"https://api.github.com/users/ePages-de/followers","following_url":"https://api.github.com/users/ePages-de/following{/other_user}","gists_url":"https://api.github.com/users/ePages-de/gists{/gist_id}","starred_url":"https://api.github.com/users/ePages-de/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ePages-de/subscriptions","organizations_url":"https://api.github.com/users/ePages-de/orgs","repos_url":"https://api.github.com/users/ePages-de/repos","events_url":"https://api.github.com/users/ePages-de/events{/privacy}","received_events_url":"https://api.github.com/users/ePages-de/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ePages-de/epages-docs","description":"Source of ePages Developer Portal","fork":false,"url":"https://api.github.com/repos/ePages-de/epages-docs","forks_url":"https://api.github.com/repos/ePages-de/epages-docs/forks","keys_url":"https://api.github.com/repos/ePages-de/epages-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ePages-de/epages-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ePages-de/epages-docs/teams","hooks_url":"https://api.github.com/repos/ePages-de/epages-docs/hooks","issue_events_url":"https://api.github.com/repos/ePages-de/epages-docs/issues/events{/number}","events_url":"https://api.github.com/repos/ePages-de/epages-docs/events","assignees_url":"https://api.github.com/repos/ePages-de/epages-docs/assignees{/user}","branches_url":"https://api.github.com/repos/ePages-de/epages-docs/branches{/branch}","tags_url":"https://api.github.com/repos/ePages-de/epages-docs/tags","blobs_url":"https://api.github.com/repos/ePages-de/epages-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ePages-de/epages-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ePages-de/epages-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ePages-de/epages-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ePages-de/epages-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/ePages-de/epages-docs/languages","stargazers_url":"https://api.github.com/repos/ePages-de/epages-docs/stargazers","contributors_url":"https://api.github.com/repos/ePages-de/epages-docs/contributors","subscribers_url":"https://api.github.com/repos/ePages-de/epages-docs/subscribers","subscription_url":"https://api.github.com/repos/ePages-de/epages-docs/subscription","commits_url":"https://api.github.com/repos/ePages-de/epages-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ePages-de/epages-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ePages-de/epages-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ePages-de/epages-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ePages-de/epages-docs/contents/{+path}","compare_url":"https://api.github.com/repos/ePages-de/epages-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ePages-de/epages-docs/merges","archive_url":"https://api.github.com/repos/ePages-de/epages-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ePages-de/epages-docs/downloads","issues_url":"https://api.github.com/repos/ePages-de/epages-docs/issues{/number}","pulls_url":"https://api.github.com/repos/ePages-de/epages-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/ePages-de/epages-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/ePages-de/epages-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ePages-de/epages-docs/labels{/name}","releases_url":"https://api.github.com/repos/ePages-de/epages-docs/releases{/id}","deployments_url":"https://api.github.com/repos/ePages-de/epages-docs/deployments","created_at":"2015-02-10T14:20:56Z","updated_at":"2016-09-13T06:23:34Z","pushed_at":"2016-09-26T09:01:07Z","git_url":"git://github.com/ePages-de/epages-docs.git","ssh_url":"git@github.com:ePages-de/epages-docs.git","clone_url":"https://github.com/ePages-de/epages-docs.git","svn_url":"https://github.com/ePages-de/epages-docs","homepage":"https://developer.epages.com/","size":227778,"stargazers_count":7,"watchers_count":7,"language":"RAML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":5,"forks":44,"open_issues":5,"watchers":7,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ePages-de/epages-docs/pulls/645"},"html":{"href":"https://github.com/ePages-de/epages-docs/pull/645"},"issue":{"href":"https://api.github.com/repos/ePages-de/epages-docs/issues/645"},"comments":{"href":"https://api.github.com/repos/ePages-de/epages-docs/issues/645/comments"},"review_comments":{"href":"https://api.github.com/repos/ePages-de/epages-docs/pulls/645/comments"},"review_comment":{"href":"https://api.github.com/repos/ePages-de/epages-docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ePages-de/epages-docs/pulls/645/commits"},"statuses":{"href":"https://api.github.com/repos/ePages-de/epages-docs/statuses/1a369c8c5a3ee6dbc0e7f798496a39c6f8144517"}}}}
{"actor":{"display_login":"ubep"}}