{"info":{"_postman_id":"c2152fc1-69b8-4852-b142-da71a76161a6","name":"Intro to writing tests - with examples","description":"<html><head></head><body><p>This collection contains examples of tests that you can use to automate your testing process.</p>\n<ul>\n<li>Basic test syntax</li>\n<li>API tests</li>\n<li>Integration tests</li>\n</ul>\n<h1 id=\"quick-tips-for-writing-tests\">Quick tips for writing tests</h1>\n<ul>\n<li>Organize your test scenarios by grouping your requests in <a href=\"https://www.getpostman.com/docs/v6/postman/collections/intro_to_collections\">collections</a> and <a href=\"https://www.getpostman.com/docs/v6/postman/collections/managing_collections#adding-folders\">folders</a>, and naming them descriptively</li>\n<li>Document your API’s requirements using <a href=\"https://www.getpostman.com/docs/v6/postman/collections/using_markdown_for_descriptions\">markdown in the descriptions</a></li>\n<li>Use <a href=\"https://www.getpostman.com/docs/v6/postman/environments_and_globals/variables\">variables</a> to simulate more sophisticated user flows</li>\n<li>Common tests that will be run after every request can be added to collection-level tests or folder-level tests</li>\n</ul>\n<h1 id=\"resources\">Resources</h1>\n<p>If you're not already familiar with writing tests in Postman, check out these resources.</p>\n<ul>\n<li>Postman docs: <a href=\"https://www.getpostman.com/docs/v6/postman/scripts/test_scripts\">Test scripts</a></li>\n<li>Postman docs: <a href=\"https://www.getpostman.com/docs/v6/postman/scripts/test_examples\">Test examples</a></li>\n<li>Community contribution: <a href=\"https://community.getpostman.com/t/the-postman-cheatsheet-quick-reference-guide/1054\">Quick reference guide</a></li>\n<li>Community contribution: <a href=\"https://github.com/DannyDainton/All-Things-Postman\">Examples and guides</a></li>\n<li>Postman blog: <a href=\"http://blog.getpostman.com/2017/10/25/writing-tests-in-postman/\">Writing tests in Postman</a></li>\n<li>Postman blog: <a href=\"http://blog.getpostman.com/2017/07/28/api-testing-tips-from-a-postman-professional/\">API testing tips from a Postman professional</a></li>\n</ul>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Quick tips for writing tests","slug":"quick-tips-for-writing-tests"},{"content":"Resources","slug":"resources"}],"owner":"23556175","collectionId":"c2152fc1-69b8-4852-b142-da71a76161a6","publishedId":"2s83YVJST9","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2022-09-26T15:01:34.000Z"},"item":[{"name":"Basic test syntax","item":[{"name":"pm.test","event":[{"listen":"test","script":{"id":"7fe7a173-1a36-43a1-bbe8-20e3cf555bc2","exec":["// use the `pm.*` API to write your test","// the `pm.test()` method accepts 2 parameters","// the first parameter is the name of your test (be descriptive)","// the second parameter is a function whereby if any assertions within your function fail, then the test will fail","","pm.test(\"Name of the first test\", function () {","    // make an assertion","    // if your assertion throws an error, this test will fail","    pm.response.to.have.status(200);","});","","pm.test(\"Name of the second test\", function () {","    // make as many assertions as you'd like as part of this test","    // if any assertion throws an error, this test will fail","    pm.response.to.have.status(200);","    pm.response.to.be.ok;","    pm.response.to.be.json;","});",""],"type":"text/javascript"}}],"id":"b680289c-42a8-42b8-8c03-34af51966d7f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://postman-echo.com/get?foo1=bar1&foo2=bar2","description":"<p>In the Postman app, review the tests written under the <strong>Tests</strong> tab in the request builder on the top. Send this request, and view the results of the tests under the <strong>Tests</strong> tab in the response viewer on the bottom.</p>\n<h3 id=\"the-pm-api\">The <code>pm.*</code> API</h3>\n<p>Use the <code>pm.*</code> API to write your test under the <strong>Tests</strong> tab in Postman. The <code>pm.test()</code> method accepts 2 parameters. The first parameter is the name of the test, so it's important to give your test a descriptive name to provide more information in case the test fails. The second parameter is a function whereby if any assertions within your function fail, then the test will fail.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>pm.test(\"Name of the second test\", function () {\n    // make as many assertions as you'd like as part of this test\n    // if any assertion throws an error, this test will fail\n    pm.response.to.have.status(200);\n    pm.response.to.be.ok;\n    pm.response.to.be.json;\n});\n</code></pre>","urlObject":{"protocol":"https","path":["get"],"host":["postman-echo","com"],"query":[{"key":"foo1","value":"bar1"},{"key":"foo2","value":"bar2"}],"variable":[]}},"response":[{"id":"16d4b920-3dc6-4954-b130-485b8025f999","name":"Status","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://postman-echo.com/get?foo1=bar1&foo2=bar2","protocol":"https","host":["postman-echo","com"],"path":["get"],"query":[{"key":"foo1","value":"bar1"},{"key":"foo2","value":"bar2"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Encoding","value":"gzip"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Thu, 15 Nov 2018 22:21:20 GMT"},{"key":"ETag","value":"W/\"1cd-LkUKVugbVYQuMcTU7OTzmp77cMo\""},{"key":"Server","value":"nginx"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Content-Length","value":"348"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"args\": {\n        \"foo1\": \"bar1\",\n        \"foo2\": \"bar2\"\n    },\n    \"headers\": {\n        \"x-forwarded-proto\": \"https\",\n        \"host\": \"postman-echo.com\",\n        \"accept\": \"*/*\",\n        \"accept-encoding\": \"gzip, deflate\",\n        \"cache-control\": \"no-cache\",\n        \"cookie\": \"sails.sid=s%3AK8csWt5VZ3Oalv85HiBtffDcrSOJ-RiP.V14RjjJqkOv8%2BLXuHRmZ9l50G8S6eU16yLU%2F3N%2F0dKU\",\n        \"postman-token\": \"c6b9bca5-7369-4da8-a539-6c906d1133f2\",\n        \"user-agent\": \"PostmanRuntime/7.3.0\",\n        \"x-forwarded-port\": \"443\"\n    },\n    \"url\": \"https://postman-echo.com/get?foo1=bar1&foo2=bar2\"\n}"}],"_postman_id":"b680289c-42a8-42b8-8c03-34af51966d7f"},{"name":"pm.expect and pm.response","event":[{"listen":"test","script":{"id":"7fe7a173-1a36-43a1-bbe8-20e3cf555bc2","exec":["// Note the difference in the test failure message under the **Test Results** tab when using pm.response vs. pm.expect","pm.test(\"Status code is 200 - pm.response\", function () {","    pm.response.to.have.status(201); // written to fail","});","","pm.test(\"Status code is 200 - pm.expect\", function () {","    pm.expect(pm.response.code).to.equal(201); //written to fail","});","","// Using a 2nd optional parameter with the pm.expect function to create a custom error message ","pm.test(\"Using a custom error message\", function () {","    pm.expect(false, 'nooo why fail??').to.be.ok;","});",""],"type":"text/javascript"}}],"id":"31b7d619-e48c-46c3-af87-3b1e28be6186","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://postman-echo.com/get?foo1=bar1&foo2=bar2","description":"<p>Within the second parameter of the <code>pm.test()</code> function, you can use either <code>pm.response()</code> or <code>pm.expect()</code> to make your assertions. </p>\n<p>Under the <strong>Tests</strong> tab in the Postman app, review the tests comparing and contrasting the 2 methods.</p>\n<p>The <code>pm.expect()</code> generic assertion function relies on <a href=\"https://www.chaijs.com/\">Chai.js</a>, a BDD / TDD assertion library for node. </p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>pm.test(\"Environment to be production\", function () {\n  pm.expect(pm.environment.get(\"env\")).to.equal(\"production\");\n});\n</code></pre><p>You can also use a 2nd optional parameter with the <code>pm.expect()</code> function to create a custom error message.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>pm.test(\"Using a custom error message\", function () {\n    pm.expect(false, 'nooo why fail??').to.be.ok;\n});\n</code></pre><p>The <code>pm.response()</code> method uses <code>pm.expect()</code> under the hood. Using <code>pm.response()</code> as your base assertion allows you to receive more specific error messages when debugging. Here are some <a href=\"https://www.getpostman.com/docs/v6/postman/scripts/postman_sandbox_api_reference#response-assertion-api-in-test-scripts\"><code>pm.response()</code> methods</a>. Review the error messages under the <strong>Test Results</strong> tab to see the difference.</p>\n","urlObject":{"protocol":"https","path":["get"],"host":["postman-echo","com"],"query":[{"key":"foo1","value":"bar1"},{"key":"foo2","value":"bar2"}],"variable":[]}},"response":[{"id":"80b613ca-acbb-4237-a2f2-c3a133581b7c","name":"Status","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://postman-echo.com/get?foo1=bar1&foo2=bar2","protocol":"https","host":["postman-echo","com"],"path":["get"],"query":[{"key":"foo1","value":"bar1"},{"key":"foo2","value":"bar2"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Encoding","value":"gzip"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Thu, 15 Nov 2018 22:21:20 GMT"},{"key":"ETag","value":"W/\"1cd-LkUKVugbVYQuMcTU7OTzmp77cMo\""},{"key":"Server","value":"nginx"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Content-Length","value":"348"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"args\": {\n        \"foo1\": \"bar1\",\n        \"foo2\": \"bar2\"\n    },\n    \"headers\": {\n        \"x-forwarded-proto\": \"https\",\n        \"host\": \"postman-echo.com\",\n        \"accept\": \"*/*\",\n        \"accept-encoding\": \"gzip, deflate\",\n        \"cache-control\": \"no-cache\",\n        \"cookie\": \"sails.sid=s%3AK8csWt5VZ3Oalv85HiBtffDcrSOJ-RiP.V14RjjJqkOv8%2BLXuHRmZ9l50G8S6eU16yLU%2F3N%2F0dKU\",\n        \"postman-token\": \"c6b9bca5-7369-4da8-a539-6c906d1133f2\",\n        \"user-agent\": \"PostmanRuntime/7.3.0\",\n        \"x-forwarded-port\": \"443\"\n    },\n    \"url\": \"https://postman-echo.com/get?foo1=bar1&foo2=bar2\"\n}"}],"_postman_id":"31b7d619-e48c-46c3-af87-3b1e28be6186"},{"name":"https://onepiecefilmredmovie.com","id":"d398eeab-947d-4f77-8fa8-16cd02e88baa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://onepiecefilmredmovie.com","description":"<p>19 secs ago - Still Now Here Option’s to Downloading or watching One Piece Film Red 2022 streaming the full movie online for free. Do you like movies? If so, then you’ll love New Romance Movie: One Piece Film Red 2022. This movie is one of the best in its genre Animation, Adventure, Action, Fantasy . One Piece Film Red will be available to watch online on Netflix's very soon!</p>\n<p>➤➤Stream Now ➡ <a href=\"https://onepiecefilmredmovie.com\">https://onepiecefilmredmovie.com</a></p>\n<p>➤➤Download Now ➡ <a href=\"https://onepiecefilmredmovie.com\">https://onepiecefilmredmovie.com</a></p>\n<p>One Piece Film Red is an upcoming Movie produced by Shueisha</p>\n<p>One Piece Film Red 2022 Uta — the most beloved singer in the world. Her voice, which she sings with while concealing her true identity, has been described as “otherworldly.” She will appear in public for the first time at a live concert. As the venue fills with all kinds of Uta fans — excited pirates, the Navy watching closely, and the Straw Hats led by Luffy who simply came to enjoy her sonorous performance — the voice that the whole world has been waiting for is about to resound.</p>\n<p>The film is scheduled for a Disney+ release on 2022-08-06, 2022.</p>\n<p>2022 How to watch There are a few ways to watch One Piece Film Red will be available to watch online on Netflix very soon! So whether you want to watch One Piece Film Red on your laptop, phone, or tablet, you’ll be able to enjoy the movie just about anywhere. And with One Piece Film Red being such an anticipated release! Yes we have found an authentic streaming option / service. Details on how you can watch One Piece Film Red 2022 for free throughout the year are described below.</p>\n<p>Is One Piece Film Red available to stream? Is watching One Piece Film Red on Crunchyroll, Disney Plus, HBO Max, Netflix or Amazon Prime? Yes we have found an authentic streaming option.</p>\n<p>Showcase Cinema Warwick There are a few ways to watch One Piece Film Red online in the U.S. You can use a streaming service such as Netflix, Hulu, or Amazon Prime Video. You can also rent or buy the movie on iTunes or Google Play. You can also watch it on-demand or on a streaming app available on your TV or streaming device if you have cable.</p>\n<p>One Piece Film Red is not available on HBO Max. It was a TV movie and is part of the Manga One Piece. The studio behind it, Sadly, One Piece Film Red is not available to watch on any streaming service right now. However, fans needn’t fear, for the plan is for One Piece Film Red to follow in the footsteps of other Sony movies and land on Starz — a streaming channel you can subscribe to through Amazon Prime Video.</p>\n<p>So whether you want to watch One Piece Film Red on your laptop, phone, or tablet, you’ll be able to enjoy the movie just about anywhere. And with One Piece Film Red being such an anticipated release.</p>\n<p>One Piece Film Red was released on 6th August 2022 in theatres and now, it will be officially available on the OTT platform after some months. The movie is available to watch online and download in Full HD (1080P), HD (720P), 480P, 360P quality.</p>\n<p>How to watch One Piece Film Red for free</p>\n<p>A silver lining to One Piece Film Red being delayed a bit longer, more chance for new moviegoers to experience the original One Piece Film Red for themselves — or for fans of the movie to watch it for the eighth hundred time, no judgement.</p>\n<p>At this time, One Piece Film Red is available to stream with a Netflix subscription.</p>\n<p>Is One Piece Film Red on Netflix?</p>\n<p>The streaming giant has a massive catalog of television shows and movies, but it does not include ‘One Piece Film Red.’ We recommend our readers watch other dark fantasy films like ‘The Witcher: Nightmare of the Wolf.’</p>\n<p>Is One Piece Film Red on Amazon Prime?</p>\n<p>Amazon Prime’s current catalog does not include ‘One Piece Film Red.’ However, the film may eventually release on the platform as video-on-demand in the coming months. Therefore, people must regularly look for the dark fantasy movie on Amazon Prime’s official website. Viewers who are looking for something similar can watch the original show ‘Dororo.’</p>\n<p>There are a few ways to watch One Piece Film Red online in the U.S. You can use a streaming service such as Netflix, Hulu, or Amazon Prime Video. You can also rent or buy the movie on iTunes or Google Play. You can also watch it on-demand or on a streaming app available on your TV or streaming device if you have cable.</p>\n<p>Where to Watch One Piece Film Red Online?</p>\n<p>There are currently no platforms that have the rights to Watch One Piece Film Red Online. MAPPA has decided to air the movie only in theaters because it has been a huge success. The studio, on the other hand, does not wish to divert revenue. Streaming the movie would only slash the profits, not increase them.</p>\n<p>As a result, no streaming services are authorized to offer One Piece Film Red for free. The film would, however, very definitely be acquired by services like Funimation, Netflix, and Crunchyroll. As a last consideration, which of these outlets will likely distribute the film worldwide?</p>\n<p>Is One Piece Film Red available on HBO Max?</p>\n<p>HBO Max is a relatively new streaming service that offers One Piece Film Red for viewing. You can watch One Piece Film Red on HBO Max if you’re already a member. If you aren’t already a member, you can sign up for a one-month free trial and then cancel it before the month is up if you don’t want to keep the subscription.</p>\n<p>Is One Piece Film Red Available On Disney Plus?</p>\n<p>One Piece Film Red is a movie that may be streamed on Disney Plus. You can watch One Piece Film Red on Disney Plus if you’re already a member. If you don’t want to subscribe after trying out the service for a month, you can cancel before the month ends. On other streaming services, One Piece Film Red may be rented or purchased.</p>\n<p>What is One Piece Film Red About?</p>\n","urlObject":{"protocol":"https","host":["onepiecefilmredmovie","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"d398eeab-947d-4f77-8fa8-16cd02e88baa"}],"id":"c33798ea-3fac-47e4-bbe0-3a5a99668799","description":"<p>Oh goody. Did you ever think you would get so excited to read this section title?</p>\n<p>The <a href=\"https://www.getpostman.com/docs/v6/postman/scripts/postman_sandbox\">Postman Sandbox</a> is a JavaScript execution environment that is accessible during pre-request scripts and test scripts. Whatever code you write under the pre-request and test tabs is executed in this sandbox.</p>\n<p>Any code that you write under the <strong>Tests</strong> tab in the Postman app will execute after your request. Consequently you have access to the <code>pm.response</code> object to make assertions against the actual response -- this is what we call a Postman test.</p>\n<p>Review the example tests under the <strong>Tests</strong> tab in the Postman app.</p>\n<blockquote>\n<p><strong>Quick tips for syntax</strong></p>\n</blockquote>\n<ul>\n<li>Give each test a descriptive name. When the test fails, this will provide context to the error.</li>\n<li>Use <code>pm.response()</code> as your base assertion where possible to provide more descriptive error messages.</li>\n<li>Use the optional 2nd parameter in <code>pm.expect()</code> to create custom error messages.</li>\n</ul>\n","event":[{"listen":"prerequest","script":{"id":"051b4289-2f0a-4ed6-9686-09e97619d7d4","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"11ba2c70-036c-4df5-8f8e-64ad86feecbc","type":"text/javascript","exec":[""]}}],"_postman_id":"c33798ea-3fac-47e4-bbe0-3a5a99668799"},{"name":"API tests","item":[{"name":"Status","event":[{"listen":"test","script":{"id":"7fe7a173-1a36-43a1-bbe8-20e3cf555bc2","exec":["pm.test(\"response is ok\", function () {","    pm.response.to.have.status(200);","});",""],"type":"text/javascript"}}],"id":"7f1a8280-4379-4e20-9960-f93783e05b59","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://postman-echo.com/get?foo1=bar1&foo2=bar2","description":"<p>This test is to validate the response status code. This SNIPPET is also available on the right sidebar under <code>Status code: Code in 200</code>.</p>\n","urlObject":{"protocol":"https","path":["get"],"host":["postman-echo","com"],"query":[{"key":"foo1","value":"bar1"},{"key":"foo2","value":"bar2"}],"variable":[]}},"response":[{"id":"f86163ef-59e8-497a-8c16-46d6f9c9724d","name":"Status","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://postman-echo.com/get?foo1=bar1&foo2=bar2","protocol":"https","host":["postman-echo","com"],"path":["get"],"query":[{"key":"foo1","value":"bar1"},{"key":"foo2","value":"bar2"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Encoding","value":"gzip"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Thu, 15 Nov 2018 22:21:20 GMT"},{"key":"ETag","value":"W/\"1cd-LkUKVugbVYQuMcTU7OTzmp77cMo\""},{"key":"Server","value":"nginx"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Content-Length","value":"348"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"args\": {\n        \"foo1\": \"bar1\",\n        \"foo2\": \"bar2\"\n    },\n    \"headers\": {\n        \"x-forwarded-proto\": \"https\",\n        \"host\": \"postman-echo.com\",\n        \"accept\": \"*/*\",\n        \"accept-encoding\": \"gzip, deflate\",\n        \"cache-control\": \"no-cache\",\n        \"cookie\": \"sails.sid=s%3AK8csWt5VZ3Oalv85HiBtffDcrSOJ-RiP.V14RjjJqkOv8%2BLXuHRmZ9l50G8S6eU16yLU%2F3N%2F0dKU\",\n        \"postman-token\": \"c6b9bca5-7369-4da8-a539-6c906d1133f2\",\n        \"user-agent\": \"PostmanRuntime/7.3.0\",\n        \"x-forwarded-port\": \"443\"\n    },\n    \"url\": \"https://postman-echo.com/get?foo1=bar1&foo2=bar2\"\n}"}],"_postman_id":"7f1a8280-4379-4e20-9960-f93783e05b59"},{"name":"Performance","event":[{"listen":"test","script":{"id":"1d125e2e-be9b-4f50-bea7-94dccaf630e2","exec":["pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});"],"type":"text/javascript"}}],"id":"43459673-2fea-486f-aac4-4a8470743b38","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"This is expected to be sent back as part of response body."},"url":"https://postman-echo.com/put","description":"<p>This test is to validate the response time. This SNIPPET is also available on the right sidebar under <code>Response time is less than 200ms</code>.</p>\n","urlObject":{"protocol":"https","path":["put"],"host":["postman-echo","com"],"query":[],"variable":[]}},"response":[{"id":"96fab00f-0718-4fac-bf2b-30290dd1cf07","name":"Performance","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"This is expected to be sent back as part of response body."},"url":"https://postman-echo.com/put"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Encoding","value":"gzip"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Thu, 15 Nov 2018 22:21:34 GMT"},{"key":"ETag","value":"W/\"235-EkrhuBWZKrBKKgRg6q6rJ7DOZ/o\""},{"key":"Server","value":"nginx"},{"key":"set-cookie","value":"sails.sid=s%3AUuE9kqyAFxbvBvvH8aX3WEBLXiNgjK7-.ErzxoeVFY7HfTK%2BPjoOs%2BzaP3yU8%2BcM59adz0oo9LlA; Path=/; HttpOnly"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Content-Length","value":"414"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"args\": {},\n    \"data\": \"This is expected to be sent back as part of response body.\",\n    \"files\": {},\n    \"form\": {},\n    \"headers\": {\n        \"x-forwarded-proto\": \"https\",\n        \"host\": \"postman-echo.com\",\n        \"content-length\": \"58\",\n        \"accept\": \"*/*\",\n        \"accept-encoding\": \"gzip, deflate\",\n        \"cache-control\": \"no-cache\",\n        \"content-type\": \"text/plain\",\n        \"cookie\": \"sails.sid=s%3AK8csWt5VZ3Oalv85HiBtffDcrSOJ-RiP.V14RjjJqkOv8%2BLXuHRmZ9l50G8S6eU16yLU%2F3N%2F0dKU\",\n        \"postman-token\": \"cc394095-6587-4079-bcba-3705b175115d\",\n        \"user-agent\": \"PostmanRuntime/7.3.0\",\n        \"x-forwarded-port\": \"443\"\n    },\n    \"json\": null,\n    \"url\": \"https://postman-echo.com/put\"\n}"}],"_postman_id":"43459673-2fea-486f-aac4-4a8470743b38"},{"name":"Data type","event":[{"listen":"test","script":{"id":"c13c4555-1755-450a-9fe5-9b97e9482232","exec":["pm.test(\"Content-Type is present\", function () {","    pm.response.to.have.header(\"Content-Type\");","});","","pm.test(\"Content-Type is JSON\", function () {","    pm.response.to.be.json;","})"],"type":"text/javascript"}}],"id":"1e087017-968e-4338-81c3-9f7c03607d57","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"This is expected to be sent back as part of response body."},"url":"https://postman-echo.com/patch","description":"<p>This test is to validate the content type of the returned content. This SNIPPET is also available on the right sidebar under <code>Response headers: Content-Type header check</code>.</p>\n","urlObject":{"protocol":"https","path":["patch"],"host":["postman-echo","com"],"query":[],"variable":[]}},"response":[{"id":"e80d07d9-7c48-4e9f-a236-38a5d493f23a","name":"Data type","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"This is expected to be sent back as part of response body."},"url":"https://postman-echo.com/patch"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Encoding","value":"gzip"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Thu, 15 Nov 2018 22:21:46 GMT"},{"key":"ETag","value":"W/\"237-50TomUYGT9/V9ahCSqZGYpnnS48\""},{"key":"Server","value":"nginx"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Content-Length","value":"410"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"args\": {},\n    \"data\": \"This is expected to be sent back as part of response body.\",\n    \"files\": {},\n    \"form\": {},\n    \"headers\": {\n        \"x-forwarded-proto\": \"https\",\n        \"host\": \"postman-echo.com\",\n        \"content-length\": \"58\",\n        \"accept\": \"*/*\",\n        \"accept-encoding\": \"gzip, deflate\",\n        \"cache-control\": \"no-cache\",\n        \"content-type\": \"text/plain\",\n        \"cookie\": \"sails.sid=s%3AUuE9kqyAFxbvBvvH8aX3WEBLXiNgjK7-.ErzxoeVFY7HfTK%2BPjoOs%2BzaP3yU8%2BcM59adz0oo9LlA\",\n        \"postman-token\": \"ebd30dd5-0044-4665-ae5c-cb31118f1119\",\n        \"user-agent\": \"PostmanRuntime/7.3.0\",\n        \"x-forwarded-port\": \"443\"\n    },\n    \"json\": null,\n    \"url\": \"https://postman-echo.com/patch\"\n}"}],"_postman_id":"1e087017-968e-4338-81c3-9f7c03607d57"},{"name":"Functional","event":[{"listen":"test","script":{"id":"7b857593-79c2-4063-9a13-b5953ddde209","exec":["pm.test(\"Returns 7 char alphanumeric id\", function () {","    let jsonData = pm.response.json();","    pm.expect(jsonData.form.someHash).to.match(/^[a-z0-9]{7}$/);","});","","pm.test(\"Returns 15 char alhpanumeric id\", function () {","    let jsonData = pm.response.json();","    pm.expect(jsonData.form.secondHash).to.match(/^[a-z0-9]{15}$/);","});",""],"type":"text/javascript"}}],"id":"bdc86391-5b00-4f07-9aba-691b6477e9df","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"someHash","type":"text","value":"7654321"},{"key":"secondHash","type":"text","value":"987654321asdfgh"}]},"url":"https://postman-echo.com/post","description":"<p>This test is written to validate the server performed a function as expected.</p>\n","urlObject":{"protocol":"https","path":["post"],"host":["postman-echo","com"],"query":[],"variable":[]}},"response":[{"id":"b1ca1b12-60eb-467c-88cb-781bc0041838","name":"Functional","originalRequest":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"someHash","type":"text","value":"7654321"},{"key":"secondHash","type":"text","value":"987654321asdfgh"}]},"url":"https://postman-echo.com/post"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Encoding","value":"gzip"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Thu, 15 Nov 2018 22:22:08 GMT"},{"key":"ETag","value":"W/\"277-9d2jX3MwxfNYN4a9mHbeHYeuEMA\""},{"key":"Server","value":"nginx"},{"key":"set-cookie","value":"sails.sid=s%3AG3Skk-KwKzhuN9bCFLG38XDvX_n76FY7.SnEQNLnssVB0vIWq0%2Bqn%2FoZhMdvJqAp6Toc8YMDlMhw; Path=/; HttpOnly"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Content-Length","value":"408"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"args\": {},\n    \"data\": \"\",\n    \"files\": {},\n    \"form\": {\n        \"someHash\": \"7654321\",\n        \"secondHash\": \"987654321asdfgh\"\n    },\n    \"headers\": {\n        \"x-forwarded-proto\": \"https\",\n        \"host\": \"postman-echo.com\",\n        \"content-length\": \"43\",\n        \"accept\": \"*/*\",\n        \"accept-encoding\": \"gzip, deflate\",\n        \"cache-control\": \"no-cache\",\n        \"content-type\": \"application/x-www-form-urlencoded\",\n        \"cookie\": \"sails.sid=s%3AUuE9kqyAFxbvBvvH8aX3WEBLXiNgjK7-.ErzxoeVFY7HfTK%2BPjoOs%2BzaP3yU8%2BcM59adz0oo9LlA\",\n        \"postman-token\": \"e6a118ae-af47-4fb6-ac35-3cf2bcbafd00\",\n        \"user-agent\": \"PostmanRuntime/7.3.0\",\n        \"x-forwarded-port\": \"443\"\n    },\n    \"json\": {\n        \"someHash\": \"7654321\",\n        \"secondHash\": \"987654321asdfgh\"\n    },\n    \"url\": \"https://postman-echo.com/post\"\n}"}],"_postman_id":"bdc86391-5b00-4f07-9aba-691b6477e9df"},{"name":"Functional2","event":[{"listen":"test","script":{"id":"ab36a04d-50b5-4350-b343-4f5e1fdbafe0","exec":["pm.test(\"response is ok\", function () {","    pm.response.to.have.status(200);","});","","let jsonResponse = pm.response.json();","","pm.test(\"Response should be a parsable JSON\", function() {","    pm.expect(jsonResponse).to.be.ok;","});","","pm.test(\"Response body should be an object\", function() {","    pm.expect(jsonResponse).to.be.an('object');","});","","pm.test(\"Response body should be in the correct format\", function() {","    pm.expect(jsonResponse.args).to.be.a('object');","    pm.expect(jsonResponse.data).to.be.a('string');","    pm.expect(jsonResponse.files).to.be.a('object');","    pm.expect(jsonResponse.form).to.be.a('object');","    pm.expect(jsonResponse.headers).to.be.a('object');","});","",""],"type":"text/javascript"}}],"id":"5f0a256d-aa33-49c1-9ac3-4e63ccbb3b90","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"This is expected to be sent back as part of response body."},"url":"https://postman-echo.com/delete","description":"<p>Another example of bundling several assertions within a single test, and also of bundling several tests within a try-catch code block.</p>\n","urlObject":{"protocol":"https","path":["delete"],"host":["postman-echo","com"],"query":[],"variable":[]}},"response":[{"id":"346fde39-3900-4d4a-8ce8-06178ed80e44","name":"Functional2","originalRequest":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"This is expected to be sent back as part of response body."},"url":"https://postman-echo.com/delete"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Encoding","value":"gzip"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Thu, 15 Nov 2018 22:22:22 GMT"},{"key":"ETag","value":"W/\"236-unqr/LuiPP07B85WHuciASf+YdA\""},{"key":"Server","value":"nginx"},{"key":"set-cookie","value":"sails.sid=s%3Aa9JaDxhKoLl3zyptDL3Vbo-kXgiIoqOY.o566AhO0IGGXbdop127kZi0Xq9bHd0q3RjrHgs2G9c4; Path=/; HttpOnly"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Content-Length","value":"415"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"args\": {},\n    \"data\": \"This is expected to be sent back as part of response body.\",\n    \"files\": {},\n    \"form\": {},\n    \"headers\": {\n        \"x-forwarded-proto\": \"https\",\n        \"host\": \"postman-echo.com\",\n        \"content-length\": \"58\",\n        \"accept\": \"*/*\",\n        \"accept-encoding\": \"gzip, deflate\",\n        \"cache-control\": \"no-cache\",\n        \"content-type\": \"text/plain\",\n        \"cookie\": \"sails.sid=s%3AG3Skk-KwKzhuN9bCFLG38XDvX_n76FY7.SnEQNLnssVB0vIWq0%2Bqn%2FoZhMdvJqAp6Toc8YMDlMhw\",\n        \"postman-token\": \"a26a6cbb-abb4-4e8b-8a1e-4ba63450afcb\",\n        \"user-agent\": \"PostmanRuntime/7.3.0\",\n        \"x-forwarded-port\": \"443\"\n    },\n    \"json\": null,\n    \"url\": \"https://postman-echo.com/delete\"\n}"}],"_postman_id":"5f0a256d-aa33-49c1-9ac3-4e63ccbb3b90"},{"name":"JSON schema v4 validation","event":[{"listen":"test","script":{"id":"7fe7a173-1a36-43a1-bbe8-20e3cf555bc2","exec":["var schema = {","  \"items\": {","    \"type\": \"boolean\"","  }","};","","var data1 = [true, false];","var data2 = [true, 123];","","pm.test('Schema is valid', function() {","  pm.expect(tv4.validate(data1, schema)).to.be.true;","//   pm.expect(tv4.validate(data2, schema)).to.be.true; // this statement would not be true","});",""],"type":"text/javascript"}}],"id":"e5c88cbf-f83d-4875-b2fd-378c61840774","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://postman-echo.com/get?foo1=bar1&foo2=bar2","description":"<p>A schema is simply a declaration describing the structure of data. Some teams use a specific schema and would like to validate their server responses against this schema. You can define a custom schema, and validate your your server responses against this schema.</p>\n<p>One of the API tests that we previously talked about is validating that the response payloads returned from the server are well-formed. You can do that by making assertions that elements in the response match your expectations. </p>\n<p>Review the test written under the <strong>Tests</strong> tab to validate that response payloads returned from the server are well-formed. </p>\n<p>This example uses <a href=\"http://geraintluff.github.io/tv4/\">Tiny Validator for JSON Schema v4</a>. The Postman sandbox offers a built-in tv4 validator to simplify your assertions. Use <a href=\"http://json-schema.org/\">json-schema</a> <a href=\"http://json-schema.org/latest/json-schema-core.html\">draft v4</a> to validate simple values and complex objects using a rich <a href=\"http://json-schema.org/latest/json-schema-validation.html\">validation vocabulary</a> (<a href=\"http://json-schema.org/examples.html\">examples</a>).</p>\n","urlObject":{"protocol":"https","path":["get"],"host":["postman-echo","com"],"query":[{"key":"foo1","value":"bar1"},{"key":"foo2","value":"bar2"}],"variable":[]}},"response":[{"id":"2fdb7100-6b1b-41d5-a553-7d657695e053","name":"JSON schema v4","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://postman-echo.com/get?foo1=bar1&foo2=bar2","protocol":"https","host":["postman-echo","com"],"path":["get"],"query":[{"key":"foo1","value":"bar1"},{"key":"foo2","value":"bar2"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Encoding","value":"gzip"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Thu, 15 Nov 2018 22:26:56 GMT"},{"key":"ETag","value":"W/\"1c7-KZYP4szBTzxKQXHzZuUzeRc6eu8\""},{"key":"Server","value":"nginx"},{"key":"set-cookie","value":"sails.sid=s%3Azdvp_jvbvOB5mzzWKmS_7y6miNWal_a6.J5pGiESESIJ0CZLwvG9rF5Vsk4deBwxJhwo9E9JS4o8; Path=/; HttpOnly"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Content-Length","value":"342"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"args\": {\n        \"foo1\": \"bar1\",\n        \"foo2\": \"bar2\"\n    },\n    \"headers\": {\n        \"x-forwarded-proto\": \"https\",\n        \"host\": \"postman-echo.com\",\n        \"accept\": \"*/*\",\n        \"accept-encoding\": \"gzip, deflate\",\n        \"cache-control\": \"no-cache\",\n        \"cookie\": \"sails.sid=s%3AwJjqwuZdKqKOiQ9FVnzMr8QoFaPFxpfD.ldt8sflpZLQkRbE1yyJtcIZIuirLfn4yFsVxtvFolWY\",\n        \"postman-token\": \"9dd498fe-4233-4512-a506-974f85cab10d\",\n        \"user-agent\": \"PostmanRuntime/7.3.0\",\n        \"x-forwarded-port\": \"443\"\n    },\n    \"url\": \"https://postman-echo.com/get?foo1=bar1&foo2=bar2\"\n}"}],"_postman_id":"e5c88cbf-f83d-4875-b2fd-378c61840774"},{"name":"SQL injection security check","event":[{"listen":"test","script":{"id":"7b857593-79c2-4063-9a13-b5953ddde209","exec":["pm.test(\"Does not return password\", function () {","    let jsonData = pm.response.json();","    pm.expect(jsonData.form.customerName).to.not.include(\"examplePassword\");","});"],"type":"text/javascript"}}],"id":"f00fa6bf-1ed4-438f-83fd-2cd00d1907bb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"customerName","value":"' or '1'='1","description":"<p> String query = \"SELECT account_balance FROM user_data WHERE user_name = \"</p>\n<ul>\n<li>request.getParameter(\"customerName\");</li>\n</ul>\n","type":"text"},{"key":"anotherAttack","value":"' or 1=1; drop table myTable; --","description":"<p>Probably best not to do this one in production, or at all, except for demonstration purposes</p>\n","type":"text","disabled":true}]},"url":"https://postman-echo.com/post","description":"<p>Hackers can attack your web server by injecting malicious strings as a request parameter. If your server is not handling user input properly, these strings can be interpreted by your server as SQL commands that result in leaking sensitive information or general mayhem.</p>\n<p>More resources <a href=\"https://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet\">here</a>.</p>\n","urlObject":{"protocol":"https","path":["post"],"host":["postman-echo","com"],"query":[],"variable":[]}},"response":[{"id":"7ca908e6-fb51-4447-8b1b-01d53c9cd0e4","name":"SQL injection security check","originalRequest":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"customerName","value":"' or '1'='1","description":" String query = \"SELECT account_balance FROM user_data WHERE user_name = \"\n   + request.getParameter(\"customerName\");","type":"text"},{"key":"anotherAttack","value":"' or 1=1; drop table myTable; --","description":"Probably best not to do this one in production, or at all, except for demonstration purposes","type":"text","disabled":true}]},"url":"https://postman-echo.com/post"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Encoding","value":"gzip"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Thu, 15 Nov 2018 22:54:34 GMT"},{"key":"ETag","value":"W/\"249-6aeADdjaahUu4RmO474pv4LUCJk\""},{"key":"Server","value":"nginx"},{"key":"set-cookie","value":"sails.sid=s%3AqIFh_GxNGvPg8xIoXG3SXa3q2FttuGK_.CEzJcRVX9GQwHnXPKthJmnkwV90OP23VXhuGizFFuXE; Path=/; HttpOnly"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Content-Length","value":"403"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"args\": {},\n    \"data\": \"\",\n    \"files\": {},\n    \"form\": {\n        \"customerName\": \"' or '1'='1\"\n    },\n    \"headers\": {\n        \"x-forwarded-proto\": \"https\",\n        \"host\": \"postman-echo.com\",\n        \"content-length\": \"38\",\n        \"accept\": \"*/*\",\n        \"accept-encoding\": \"gzip, deflate\",\n        \"cache-control\": \"no-cache\",\n        \"content-type\": \"application/x-www-form-urlencoded\",\n        \"cookie\": \"sails.sid=s%3A7tFj5KB_lujWMK1xoroPV_xSKkRDxR1W.qUauhME8lGY%2FnBlCT4iVRCs0badee7%2Fmen9XorL%2FJ4s\",\n        \"postman-token\": \"031152dc-59c7-4529-8f8a-29faf9f41afe\",\n        \"user-agent\": \"PostmanRuntime/7.3.0\",\n        \"x-forwarded-port\": \"443\"\n    },\n    \"json\": {\n        \"customerName\": \"' or '1'='1\"\n    },\n    \"url\": \"https://postman-echo.com/post\"\n}"}],"_postman_id":"f00fa6bf-1ed4-438f-83fd-2cd00d1907bb"}],"id":"d3c6fe14-6131-45a6-b3a4-ed690e03624d","description":"<p>This folder contains examples of testing a single HTTP API request.</p>\n<p>In the Postman app, under the <strong>Tests</strong> tab of the request builder for each request, notice the test(s) written to validate specific assertions. Some of these tests are available as a SNIPPET on the right sidebar.</p>\n<p>Send each request to see the results under the <strong>Tests</strong> tab in the response viewer.</p>\n","event":[{"listen":"prerequest","script":{"id":"98994d2e-261d-49a0-9d13-0832a97eeaf9","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"4eeee8f4-3096-4f28-a069-2bf8ed1b208c","type":"text/javascript","exec":[""]}}],"_postman_id":"d3c6fe14-6131-45a6-b3a4-ed690e03624d"},{"name":"Integration tests","item":[{"name":"Using variables","item":[{"name":"Bitcoin exchange rate","event":[{"listen":"test","script":{"id":"50d48c65-1a55-4ab8-a422-3b23c81ddaf6","exec":["// let's write code that extract information from the response, and then save it as an environment variable, so that we can use it in our next request.","","let jsonData = pm.response.json();","pm.environment.set(\"bitcoinRate\", jsonData.bpi.USD.rate);","","pm.test(\"Response includes specified elements\", function () {","    let response = pm.response.json();","    pm.expect(response).to.have.ownProperty(\"chartName\"); ","    pm.expect(response.chartName).to.equal(\"Bitcoin\");","});","","// you can also use global, collection, and session variables","// you can also set local variables which are available throughout a collection run","pm.variables.set(\"exampleLocalVariable\", \"this-example-of-a-local-variable\");"],"type":"text/javascript"}}],"id":"7c59833d-40d9-4f7c-8e28-6a8fa36a9978","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://api.coindesk.com/v1/bpi/currentprice.json","description":"<p>CoinDesk provides a simple API to make its <a href=\"https://www.coindesk.com/price/\">Bitcoin Price Index (BPI)</a> data programmatically available to others. Data is returned in JSON format.</p>\n<p>Read more about the <a href=\"https://www.coindesk.com/api/\">Coindesk API</a>.</p>\n<p>Under the <strong>Tests</strong> tab in the Postman app, see how we extract data from the response, save it as a variable, so that we can use the information in subsequent requests. We will be using an environment to save this information. Make sure you have created and selected <a href=\"https://www.getpostman.com/docs/v6/postman/environments_and_globals/intro_to_environments_and_globals\">an environment</a>, and then send this request.</p>\n","urlObject":{"protocol":"https","path":["v1","bpi","currentprice.json"],"host":["api","coindesk","com"],"query":[],"variable":[]}},"response":[{"id":"8d780a52-db05-4953-a5c1-8716c8b7c7dc","name":"Bitcoin exchange rate","originalRequest":{"method":"GET","header":[],"url":"https://api.coindesk.com/v1/bpi/currentprice.json"},"status":"OK","code":200,"_postman_previewlanguage":"script","header":[{"key":"Content-Type","value":"application/javascript"},{"key":"Content-Length","value":"672"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Cache-Control","value":"max-age=15"},{"key":"Date","value":"Mon, 19 Nov 2018 20:25:22 GMT"},{"key":"Expires","value":"Mon, 19 Nov 2018 20:26:07 UTC"},{"key":"Server","value":"nginx/1.12.1"},{"key":"X-Powered-By","value":"Fat-Free Framework"},{"key":"Age","value":"2"},{"key":"X-Cache","value":"Hit from cloudfront"},{"key":"Via","value":"1.1 3566cbcd49f71967b52a565888e4d272.cloudfront.net (CloudFront)"},{"key":"X-Amz-Cf-Id","value":"sS2RrgR1BnUjWPD6l_WQw-3GNk2xW7nbM2FMEISFO2c06_P3TjUEwQ=="}],"cookie":[],"responseTime":null,"body":"{\"time\":{\"updated\":\"Nov 19, 2018 20:25:00 UTC\",\"updatedISO\":\"2018-11-19T20:25:00+00:00\",\"updateduk\":\"Nov 19, 2018 at 20:25 GMT\"},\"disclaimer\":\"This data was produced from the CoinDesk Bitcoin Price Index (USD). Non-USD currency data converted using hourly conversion rate from openexchangerates.org\",\"chartName\":\"Bitcoin\",\"bpi\":{\"USD\":{\"code\":\"USD\",\"symbol\":\"&#36;\",\"rate\":\"5,003.4550\",\"description\":\"United States Dollar\",\"rate_float\":5003.455},\"GBP\":{\"code\":\"GBP\",\"symbol\":\"&pound;\",\"rate\":\"3,892.1176\",\"description\":\"British Pound Sterling\",\"rate_float\":3892.1176},\"EUR\":{\"code\":\"EUR\",\"symbol\":\"&euro;\",\"rate\":\"4,368.2164\",\"description\":\"Euro\",\"rate_float\":4368.2164}}}"}],"_postman_id":"7c59833d-40d9-4f7c-8e28-6a8fa36a9978"},{"name":"Echo the exchange rate","event":[{"listen":"test","script":{"id":"7fe7a173-1a36-43a1-bbe8-20e3cf555bc2","exec":["pm.test(\"response is ok\", function () {","    pm.response.to.have.status(200);","});",""],"type":"text/javascript"}}],"id":"7c55a143-702e-4a97-9816-d9f527e82632","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://postman-echo.com/get?foo1={{bitcoinRate}}","description":"<p>This request will use information saved to a variable in a previous request.</p>\n<p>You can send the request to view this information echoed back in the response. Alternatively, you can click the <strong>Quick Look</strong> in the top right <a href=\"https://www.getpostman.com/docs/v5/postman/environments_and_globals/manage_environments#editing-an-active-environment\">to verify the environment variable has been set</a>.</p>\n","urlObject":{"protocol":"https","path":["get"],"host":["postman-echo","com"],"query":[{"description":{"content":"<p>Set this variable in the previous request</p>\n","type":"text/plain"},"key":"foo1","value":"{{bitcoinRate}}"}],"variable":[]}},"response":[{"id":"0e3f4ec2-a282-4496-b0e7-4b98f7063e2f","name":"Status","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://postman-echo.com/get?foo1=bar1&foo2=bar2","protocol":"https","host":["postman-echo","com"],"path":["get"],"query":[{"key":"foo1","value":"bar1"},{"key":"foo2","value":"bar2"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Encoding","value":"gzip"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Thu, 15 Nov 2018 22:21:20 GMT"},{"key":"ETag","value":"W/\"1cd-LkUKVugbVYQuMcTU7OTzmp77cMo\""},{"key":"Server","value":"nginx"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Content-Length","value":"348"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"args\": {\n        \"foo1\": \"bar1\",\n        \"foo2\": \"bar2\"\n    },\n    \"headers\": {\n        \"x-forwarded-proto\": \"https\",\n        \"host\": \"postman-echo.com\",\n        \"accept\": \"*/*\",\n        \"accept-encoding\": \"gzip, deflate\",\n        \"cache-control\": \"no-cache\",\n        \"cookie\": \"sails.sid=s%3AK8csWt5VZ3Oalv85HiBtffDcrSOJ-RiP.V14RjjJqkOv8%2BLXuHRmZ9l50G8S6eU16yLU%2F3N%2F0dKU\",\n        \"postman-token\": \"c6b9bca5-7369-4da8-a539-6c906d1133f2\",\n        \"user-agent\": \"PostmanRuntime/7.3.0\",\n        \"x-forwarded-port\": \"443\"\n    },\n    \"url\": \"https://postman-echo.com/get?foo1=bar1&foo2=bar2\"\n}"}],"_postman_id":"7c55a143-702e-4a97-9816-d9f527e82632"}],"id":"c5e70bff-16cf-40d9-82e7-d11415577aef","description":"<p>The 2 requests in this sub-folder demonstrate how you can use variables to save information that can be used in subsequent requests. Let's see how to do this with an <a href=\"https://www.getpostman.com/docs/v6/postman/environments_and_globals/intro_to_environments_and_globals\">environment variable</a>.</p>\n<h3 id=\"considerations-for-using-variables\">Considerations for using variables</h3>\n<p>If you're planning to automate your testing and / or run your test suite as part of your Continuous Integration / Continuous Delivery (CI/CD) pipeline, there's some considerations for how you handle your <a href=\"https://www.getpostman.com/docs/v6/postman/environments_and_globals/variables\">variables</a>.</p>\n<p><img src=\"https://i.imgur.com/cQFnvSZ.png\" alt=\"[variable scopes](https://i.imgur.com/cQFnvSZ.png)\" /></p>\n<ul>\n<li><a href=\"https://community.getpostman.com/t/the-postman-cheatsheet-quick-reference-guide/1054/7?u=joyce\">Local variables</a> can be used to save a temporary state within a request and also throughout a collection run. Using a local variable means you won't have to unset the variable during teardown or pollute your namespace.</li>\n<li><a href=\"https://www.getpostman.com/docs/v6/postman/environments_and_globals/manage_environments\">Environment variables</a> are portable and can be used to store server configuration elements. In this way, you can easily swap out the configuration for your staging environment with your production environment when necessary.</li>\n<li><a href=\"https://www.getpostman.com/docs/v6/postman/environments_and_globals/variables#defining-collection-variables\">Collection variables</a> are specific to a single collection.</li>\n<li><a href=\"https://www.getpostman.com/docs/v6/postman/environments_and_globals/manage_globals\">Global variables</a> are specific to a single workspace. In a personal workspace, your <code>username</code> might never change. In a team workspace, you might have dummy user credentials that are shared across the team.</li>\n<li><a href=\"https://www.getpostman.com/docs/v6/postman/environments_and_globals/sessions\">Session variables</a> are available for global, collection, and environment variables to maintain variable values within your current session. In this way, you can keep your mutations private and not overwrite any team values.</li>\n</ul>\n<h3 id=\"persisting-variable-values\">Persisting variable values</h3>\n<p>Variables can be used to save and update a value throughout a collection run. What if you want to use variables to save state across different runs of the same collection?</p>\n<p>Say you want to save the highest ranked player on a leaderboard as an environment value. The behavior of persisting variable values after a collection has been run may differ depending on how you run your collection.</p>\n<ul>\n<li>In the Postman app <a href=\"https://www.getpostman.com/docs/v6/postman/collection_runs/intro_to_collection_runs\">collection runner</a>, the default setting is that variables are NOT persisted. That means at the end of a collection run, any variable values that you updated throughout the collection run will be reset to their initial values. There is a checkbox to <code>Keep variable values</code> that you can select as an option in the collection runner window before you run the collection.</li>\n<li>With <a href=\"https://www.getpostman.com/docs/v6/postman/collection_runs/command_line_integration_with_newman\">Newman</a> and <a href=\"https://www.getpostman.com/docs/v6/postman/monitors/intro_monitors\">Postman monitors</a>, the default setting is that variables are NOT persisted. In this case, there's no built-in option to persist your values. However, you can use the <a href=\"https://docs.api.getpostman.com/\">Postman API</a> to <a href=\"https://docs.api.getpostman.com/#6517e0d6-3bc3-3da5-ab57-7a578a8504ce\">update your environment</a>, running this request as part of your collection.</li>\n</ul>\n","event":[{"listen":"prerequest","script":{"id":"95c9c1f0-284e-4952-9480-adc87bd9f663","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"959d8747-af6e-4500-b2a9-928a1d34392c","type":"text/javascript","exec":[""]}}],"_postman_id":"c5e70bff-16cf-40d9-82e7-d11415577aef"},{"name":"Scenario","item":[{"name":"Fetch a list of items","event":[{"listen":"test","script":{"id":"404cf0db-7cb6-4897-9e66-4bf1ff9fb6fa","exec":["pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Response is an array\", function () {","    pm.response.to.be.an.array; ","});",""],"type":"text/javascript"}}],"id":"6538c887-b682-4f28-8f2a-b323d6dff342","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","type":"text","value":"Bearer {{example_api_key}}"},{"key":"Content-Type","value":"application/json","type":"text"}],"url":"http://localhost:3002/items","description":"<p>A <code>GET</code> to the <code>/items</code> endpoint allows your application to fetch a list of all items.</p>\n<p>Look under <strong>Examples</strong> to view an example response.</p>\n","urlObject":{"protocol":"http","port":"3002","path":["items"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"4d161ecc-daec-4f1c-8cf7-dd892d29b45d","name":"Fetch a list of items","originalRequest":{"method":"GET","header":[{"key":"Authorization","type":"text","value":"Bearer {{example_api_key}}"},{"key":"Content-Type","value":"application/json","type":"text"}],"url":{"raw":"http://localhost:3002/items?Authorization=Bearer {{example_api_key}}&Content-type=application/json","protocol":"http","host":["localhost"],"port":"3002","path":["items"],"query":[{"key":"Authorization","value":"Bearer {{example_api_key}}"},{"key":"Content-type","value":"application/json"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"item_id\": \"304829\",\n        \"name\": \"delicata\",\n        \"price\": \"0.79\",\n        \"unit\": \"lb\",\n        \"currency\": \"USD\"\n    },\n    {\n        \"item_id\": \"304830\",\n        \"name\": \"butternut\",\n        \"price\": \"0.59\",\n        \"unit\": \"lb\",\n        \"currency\": \"USD\"\n    },\n    {\n        \"item_id\": \"304831\",\n        \"name\": \"acorn\",\n        \"price\": \"0.49\",\n        \"unit\": \"lb\",\n        \"currency\": \"USD\"\n    }\n]"}],"_postman_id":"6538c887-b682-4f28-8f2a-b323d6dff342"},{"name":"Create a new item","event":[{"listen":"test","script":{"id":"b9928271-707c-420c-a262-35b3cd0da910","exec":["pm.test(\"Status code is 201\", function () {","    pm.response.to.have.status(201);","});","","// save the `item_id` returned in the response as an environment variable","let jsonResponse = pm.response.json();","pm.environment.set(\"itemId\", jsonResponse.item_id);","pm.environment.set(\"itemName\", jsonResponse.name);",""],"type":"text/javascript"}}],"id":"15a008a2-5b48-4301-b502-77b8b7c763e8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","type":"text","value":"Bearer {{example_api_key}}"},{"key":"Content-type","type":"text","value":"application/json"}],"body":{"mode":"formdata","formdata":[{"key":"name","type":"text","value":"kabocha"},{"key":"price","type":"text","value":"0.89"},{"key":"unit","type":"text","value":"lb"},{"key":"currency","type":"text","value":"USD"}]},"url":"http://localhost:3002/items","description":"<p>A <code>POST</code> to the <code>/items</code> endpoint allows your application to create a new item. A successful response will return an <code>item_id</code>, which can be saved as an environment variable to be used in subsequent requests.</p>\n<p>Look under <strong>Examples</strong> to view an example response.</p>\n","urlObject":{"protocol":"http","port":"3002","path":["items"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"93a0f023-4a04-4fda-b0cd-017e201fc403","name":"Create a new item","originalRequest":{"method":"POST","header":[{"key":"Authorization","type":"text","value":"Bearer {{example_api_key}}"},{"key":"Content-type","value":"application/json","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"name","value":"kabocha","type":"text"},{"key":"price","value":"0.89","type":"text"},{"key":"unit","value":"lb","type":"text"},{"key":"currency","value":"USD","type":"text"}]},"url":{"raw":"http://localhost:3002/items?Authorization=Bearer {{example_api_key}}&Content-type=application/json","protocol":"http","host":["localhost"],"port":"3002","path":["items"],"query":[{"key":"Authorization","value":"Bearer {{example_api_key}}","type":"text"},{"key":"Content-type","value":"application/json","type":"text"}]}},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"item_id\": \"304832\",\n    \"name\": \"kabocha\",\n    \"price\": \"0.89\",\n    \"unit\": \"lb\",\n    \"currency\": \"USD\"\n}"}],"_postman_id":"15a008a2-5b48-4301-b502-77b8b7c763e8"},{"name":"Verify new item exists","event":[{"listen":"test","script":{"id":"f352b0a3-b6ab-4c03-9926-db87522e1830","exec":["pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Item name is correct\", function () {","    let response = pm.response.json();","    let savedItemName = pm.environment.get(\"itemName\");","    pm.expect(response.name).to.be(savedItemName);","});",""],"type":"text/javascript"}}],"id":"1bcc608a-c4ca-4d03-969f-dd6f6837368e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","type":"text","value":"Bearer {{example_api_key}}"},{"key":"Content-type","type":"text","value":"application/json"}],"url":"http://localhost:3002/items/{{itemId}}","description":"<p>A <code>GET</code> to the <code>/items/:itemId</code> endpoint allows your application to retrieve details about the specified item.</p>\n<p>Look under <strong>Examples</strong> to view an example response.</p>\n","urlObject":{"protocol":"http","port":"3002","path":["items","{{itemId}}"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"72575d95-9007-4e3d-bded-e1b78ad36ec9","name":"Verify new item exists","originalRequest":{"method":"GET","header":[{"key":"Authorization","type":"text","value":"Bearer {{example_api_key}}"},{"key":"Content-type","value":"application/json","type":"text"}],"url":{"raw":"http://localhost:3002/items/{{itemId}}?Authorization=Bearer {{example_api_key}}&Content-type=application/json","protocol":"http","host":["localhost"],"port":"3002","path":["items","{{itemId}}"],"query":[{"key":"Authorization","value":"Bearer {{example_api_key}}","type":"text"},{"key":"Content-type","value":"application/json","type":"text"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"item_id\": \"304832\",\n    \"name\": \"kabocha\",\n    \"price\": \"0.89\",\n    \"unit\": \"lb\",\n    \"currency\": \"USD\"\n}"}],"_postman_id":"1bcc608a-c4ca-4d03-969f-dd6f6837368e"},{"name":"Add item to cart","event":[{"listen":"test","script":{"id":"8e41d200-9723-409d-821f-120dc6f06116","exec":["pm.test(\"Status code is 201\", function () {","    pm.response.to.have.status(201);","});","","pm.test(\"Successful add status response\", function () {","    let response = pm.response.json();","    pm.expect(response.status).to.equal(\"item added\");","});",""],"type":"text/javascript"}}],"id":"b66f090b-94b7-42d7-8f2e-364ab22de3fa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","type":"text","value":"Bearer {{example_api_key}}"},{"key":"Content-type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"http://localhost:3002/{{memberId}}/cart","description":"<p>A <code>POST</code> to the <code>/:memberId/cart</code> endpoint allows your application to add an item to the specified member's cart. </p>\n<p>Look under <strong>Examples</strong> to view an example response.</p>\n","urlObject":{"protocol":"http","port":"3002","path":["{{memberId}}","cart"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"165e1219-dab3-40fc-b6b7-3df01162a241","name":"Add item to cart","originalRequest":{"method":"POST","header":[{"key":"Authorization","type":"text","value":"Bearer {{example_api_key}}"},{"key":"Content-type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":{"raw":"http://localhost:3002/{{memberId}}/cart?Authorization=Bearer {{example_api_key}}&Content-type=application/json","protocol":"http","host":["localhost"],"port":"3002","path":["{{memberId}}","cart"],"query":[{"key":"Authorization","value":"Bearer {{example_api_key}}","type":"text"},{"key":"Content-type","value":"application/json","type":"text"}]}},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n\t\"cart_id\": \"109\",\n\t\"status\": \"item added\"\n}"}],"_postman_id":"b66f090b-94b7-42d7-8f2e-364ab22de3fa"},{"name":"Delete item from cart","event":[{"listen":"test","script":{"id":"cb15b5e5-7813-41e6-943b-0578e3f63ee1","exec":["pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Successful delete status response\", function () {","    let response = pm.response.json();","    pm.expect(response.status).to.equal(\"item removed\");","});",""],"type":"text/javascript"}}],"id":"6f367b45-4da4-42c0-8751-d9d6fe022687","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","type":"text","value":"Bearer {{example_api_key}}"},{"key":"Content-type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"http://localhost:3002/{{memberId}}/cart/{{itemId}}","description":"<p>A <code>DELETE</code> to the <code>/:memberId/cart/:itemId</code> endpoint allows your application to delete an item to the specified member's cart.</p>\n<p>Look under <strong>Examples</strong> to view an example response.</p>\n","urlObject":{"protocol":"http","port":"3002","path":["{{memberId}}","cart","{{itemId}}"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"61c56417-c71a-454d-b4b3-d6fc1865917e","name":"Delete item from cart","originalRequest":{"method":"DELETE","header":[{"key":"Authorization","type":"text","value":"Bearer {{example_api_key}}"},{"key":"Content-type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":{"raw":"http://localhost:3002/{{memberId}}/cart/{{itemId}}?Authorization=Bearer {{example_api_key}}&Content-type=application/json","protocol":"http","host":["localhost"],"port":"3002","path":["{{memberId}}","cart","{{itemId}}"],"query":[{"key":"Authorization","value":"Bearer {{example_api_key}}","type":"text"},{"key":"Content-type","value":"application/json","type":"text"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n\t\"cart_id\": \"109\",\n\t\"status\": \"item removed\"\n}"}],"_postman_id":"6f367b45-4da4-42c0-8751-d9d6fe022687"},{"name":"Verify item removed","event":[{"listen":"test","script":{"id":"43d762c5-5ab9-4d0e-aa4d-50e2205f076b","exec":["pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Cart does not include deleted item\", function () {","    let savedItemId = pm.environment.get(\"itemId\");","    pm.response.to.not.include(savedItemId);    ","});",""],"type":"text/javascript"}}],"id":"1340ac97-074a-4767-a4b0-9987cb584b3e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","type":"text","value":"Bearer {{example_api_key}}"},{"key":"Content-type","value":"application/json","type":"text"}],"url":"http://localhost:3002/{{memberId}}/cart","description":"<p>A <code>GET</code> to the <code>:memberId/cart</code> endpoint allows you to retrieve a list of all items in the specified member's cart.</p>\n<p>Look under <strong>Examples</strong> to view an example response.</p>\n","urlObject":{"protocol":"http","port":"3002","path":["{{memberId}}","cart"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"d988cb55-4d4b-40dd-ae46-6ff05801f2fa","name":"Verify item removed","originalRequest":{"method":"GET","header":[{"key":"Authorization","type":"text","value":"Bearer {{example_api_key}}"},{"key":"Content-type","value":"application/json","type":"text"}],"url":{"raw":"http://localhost:3002/{{memberId}}/cart?Authorization=Bearer {{examples_api_key}}&Content-type=application/json","protocol":"http","host":["localhost"],"port":"3002","path":["{{memberId}}","cart"],"query":[{"key":"Authorization","value":"Bearer {{examples_api_key}}","type":"text"},{"key":"Content-type","value":"application/json","type":"text"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n\t\"member_id\": \"5489098\",\n\t\"cart_id\": \"109\",\n\t\"items\": [\n\t\t{\n\t\t\t\"item_id\": \"304832\",\n\t\t\t\"quantity\": \"1\"\n\t\t},\n\t\t{\n\t\t\t\"item_id\": \"304836\",\n\t\t\t\"quantity\": \"2\"\n\t\t}\n\t],\n\t\"subtotal\": \"2.09\",\n\t\"tax\": \"0.03\",\n\t\"freight\": \"0.05\",\n\t\"total\": \"2.27\"\n}"}],"_postman_id":"1340ac97-074a-4767-a4b0-9987cb584b3e"}],"id":"679b811e-8d38-4dca-852c-402d555e694d","description":"<p>The requests in this sub-folder demonstrate how your scenario tests can be structured.</p>\n<p>Executing the requests in this folder runs your API tests sequentially mirroring typical user behavior. </p>\n<h1 id=\"control-your-workflow\">Control your workflow</h1>\n<p>You can also use the <code>postman.setNextRequest()</code> method to <a href=\"https://www.getpostman.com/docs/v6/postman/scripts/branching_and_looping\">control your workflow</a> and create more sophisticated testing logic.</p>\n","event":[{"listen":"prerequest","script":{"id":"a95ec91b-98a1-447d-b3f0-74800b5c4fc8","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"2fb3d4ce-9e18-4b51-bcd3-bf187098058b","type":"text/javascript","exec":[""]}}],"_postman_id":"679b811e-8d38-4dca-852c-402d555e694d"},{"name":"Service Consumer → Service Provider #contract","item":[{"name":"Setup","item":[{"name":"Create User","event":[{"listen":"test","script":{"id":"95defde9-6a9e-4d34-a671-954af6d91b1f","type":"text/javascript","exec":["const response = pm.response.json();","","pm.environment.set(\"jwt_token\", response.access_token);"]}}],"id":"71cd6ce3-a6b3-4cb0-8eb5-f845a0278888","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"username\": \"user\",\n\t\"password\": \"password\",\n\t\"extra\": \"blerg\"\n}"},"url":"http://localhost:3001/users","description":"<p>The body must have <code>username</code>, <code>password</code> and <code>extra</code>. It returns <code>id_token</code> and <code>access_token</code> which are signed with the secret located at the <code>config.json</code> file. The <code>id_token</code> will contain the <code>username</code> and the <code>extra</code> information sent, while the <code>access_token</code> will contain the <code>audience</code>, <code>jti</code>, <code>issuer</code> and <code>scope</code>.</p>\n","urlObject":{"protocol":"http","port":"3001","path":["users"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"6305336d-f6a3-4576-afbc-a87fd6a94815","name":"Successful response","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"username\": \"user\",\n\t\"password\": \"password\",\n\t\"extra\": \"blerg\"\n}"},"url":"http://localhost:3001/users"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Access-Control-Allow-Origin","value":"*","name":"Access-Control-Allow-Origin","description":"Specifies a URI that may access the resource. For requests without credentials, the server may specify '*' as a wildcard, thereby allowing any origin to access the resource."},{"key":"Connection","value":"keep-alive","name":"Connection","description":"Options that are desired for the connection"},{"key":"Content-Length","value":"523","name":"Content-Length","description":"The length of the response body in octets (8-bit bytes)"},{"key":"Content-Type","value":"application/json; charset=utf-8","name":"Content-Type","description":"The mime type of this content"},{"key":"Date","value":"Thu, 13 Sep 2018 20:42:22 GMT","name":"Date","description":"The date and time that the message was sent"},{"key":"ETag","value":"W/\"20b-/ULiXCB/BjV9XztkCrB50vUZugI\"","name":"ETag","description":"An identifier for a specific version of a resource, often a message digest"},{"key":"X-Powered-By","value":"Express","name":"X-Powered-By","description":"Specifies the technology (ASP.NET, PHP, JBoss, e.g.) supporting the web application (version details are often in X-Runtime, X-Version, or X-AspNet-Version)"}],"cookie":[],"responseTime":null,"body":"{\"id_token\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InVzZXIiLCJleHRyYSI6ImJsZXJnIiwiaWQiOjIsImlhdCI6MTUzNjg3MTM0MiwiZXhwIjoxNTM2ODg5MzQyfQ.OWx1l_oDyuC7Oi0uO-iglA9quxxZ2ksX-BT2lqYjojY\",\"access_token\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2dvbnRvLmNvbSIsImF1ZCI6Im5vZGVqcy1qd3QtYXV0aCIsImV4cCI6MTUzNjg3NDk0Miwic2NvcGUiOiJmdWxsX2FjY2VzcyIsInN1YiI6ImxhbGFsYW5kfGdvbnRvIiwianRpIjoiazJ4QXBOVVExWm1tQWdtcSIsImFsZyI6IkhTMjU2IiwiaWF0IjoxNTM2ODcxMzQyfQ.RTNmeyb-6mZpFEqQz0V194nKax91qJk5GN01u3hpA-Q\"}"}],"_postman_id":"71cd6ce3-a6b3-4cb0-8eb5-f845a0278888"},{"name":"Create Session","event":[{"listen":"test","script":{"id":"6e5ff1d0-38e9-4978-8632-2a7fd49757db","type":"text/javascript","exec":["const response = pm.response.json();","","pm.environment.set(\"jwt_token\", response.access_token);"]}}],"id":"16f345ff-0ed1-49b9-8812-5703e5b54539","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"username\": \"user\",\n\t\"password\": \"password\"\n}"},"url":"http://localhost:3001/sessions/create","description":"<p>The body must have <code>username</code> and <code>password</code>. It returns <code>id_token</code> and <code>access_token</code> are signed with the secret located at the <code>config.json</code> file. The <code>id_token</code> will contain the <code>username</code> and the <code>extra</code> information sent, while the <code>access_token</code> will contain the <code>audience</code>, <code>jti</code>, <code>issuer</code> and <code>scope</code>.</p>\n","urlObject":{"protocol":"http","port":"3001","path":["sessions","create"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"1ba4a146-b052-461e-839e-18f626fb7427","name":"Successful response","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"username\": \"user\",\n\t\"password\": \"password\"\n}"},"url":"http://localhost:3001/sessions/create"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Access-Control-Allow-Origin","value":"*","name":"Access-Control-Allow-Origin","description":"Specifies a URI that may access the resource. For requests without credentials, the server may specify '*' as a wildcard, thereby allowing any origin to access the resource."},{"key":"Connection","value":"keep-alive","name":"Connection","description":"Options that are desired for the connection"},{"key":"Content-Length","value":"523","name":"Content-Length","description":"The length of the response body in octets (8-bit bytes)"},{"key":"Content-Type","value":"application/json; charset=utf-8","name":"Content-Type","description":"The mime type of this content"},{"key":"Date","value":"Thu, 13 Sep 2018 20:44:42 GMT","name":"Date","description":"The date and time that the message was sent"},{"key":"ETag","value":"W/\"20b-OddoFD1q11lfCJ55kXMN6jd5YHE\"","name":"ETag","description":"An identifier for a specific version of a resource, often a message digest"},{"key":"X-Powered-By","value":"Express","name":"X-Powered-By","description":"Specifies the technology (ASP.NET, PHP, JBoss, e.g.) supporting the web application (version details are often in X-Runtime, X-Version, or X-AspNet-Version)"}],"cookie":[],"responseTime":null,"body":"{\"id_token\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InVzZXIiLCJleHRyYSI6ImJsZXJnIiwiaWQiOjIsImlhdCI6MTUzNjg3MTQ4MiwiZXhwIjoxNTM2ODg5NDgyfQ.ssLIBEyAF73iQQH7byi6OiXfa1r467wKx_VmfhjJSeY\",\"access_token\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2dvbnRvLmNvbSIsImF1ZCI6Im5vZGVqcy1qd3QtYXV0aCIsImV4cCI6MTUzNjg3NTA4Miwic2NvcGUiOiJmdWxsX2FjY2VzcyIsInN1YiI6ImxhbGFsYW5kfGdvbnRvIiwianRpIjoiRVJmSVVoR2hmaUxNbDFFUyIsImFsZyI6IkhTMjU2IiwiaWF0IjoxNTM2ODcxNDgyfQ.isN1Pl40xa8Ml_8Alh6kcrqO6JvXCkXdCBx0IFeFzCc\"}"}],"_postman_id":"16f345ff-0ed1-49b9-8812-5703e5b54539"}],"id":"19fea940-ce21-4280-8d7a-cd203bc77548","description":"<p>Sometimes you need to do some initial groundwork to prepare your test environment for your test cases. Perhaps you're generating new users, creating authentication tokens, or simply initializing variables.</p>\n<p>You can handle setup and teardown as separate requests occurring respectively before and after your tests. You can also handle setup and teardown for <em>each</em> request as pre-request or test scripts.</p>\n","event":[{"listen":"prerequest","script":{"id":"5587cb78-a4e5-4423-8119-f33311f9bc8e","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"b757dfe5-789b-4bc9-acaa-d3b0aefebbbf","type":"text/javascript","exec":[""]}}],"_postman_id":"19fea940-ce21-4280-8d7a-cd203bc77548"},{"name":"Tests","item":[{"name":"Protected Random Quote","event":[{"listen":"test","script":{"id":"57ecacd0-46db-4df7-ae5d-9ac0fadb2958","exec":["pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Response time is less than 200ms\", function () {","    pm.expect(pm.response.responseTime).to.be.below(200);","});","","pm.test(\"Response is a string\", function () {","    pm.response.to.be.string;","});"],"type":"text/javascript"}}],"id":"074529b6-f18d-4ad7-a023-031aaee76b00","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"<p>Replace {{jwt_token}} with your JWT token.</p>\n"}],"url":"http://localhost:3001/api/protected/random-quote","description":"<p>It returns a String with a Random quote from Chuck Norris. It requires authentication. </p>\n<p>The JWT - <code>access_token</code> must be sent on the <code>Authorization</code> header as follows: <code>Authorization: Bearer {jwt}</code></p>\n","urlObject":{"protocol":"http","port":"3001","path":["api","protected","random-quote"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"4e54bfcd-471a-4f6d-9cae-48ec610582bd","name":"Protected Random Quote","originalRequest":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"Replace {{jwt_token}} with your JWT token."}],"url":"http://localhost:3001/api/protected/random-quote"},"status":"OK","code":200,"_postman_previewlanguage":"html","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"text/html; charset=utf-8"},{"key":"Content-Length","value":"65"},{"key":"ETag","value":"W/\"41-h+wcZh2eGYail4Kdu43XrGBYjS4\""},{"key":"Date","value":"Fri, 16 Nov 2018 23:28:37 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"Chuck Norris's tears cure cancer ..... too bad he has never cried"}],"_postman_id":"074529b6-f18d-4ad7-a023-031aaee76b00"}],"id":"d9e66074-7120-43ce-9c3d-3a78b02100ab","description":"<p>Automating the setup and teardown allows you to quickly re-create your test conditions in a consistent way so that you can repeat your tests. Creating repeatable tests allows you to more efficiently tweak other variables, isolate the system under test, and observe the results in a scalable manner.</p>\n","event":[{"listen":"prerequest","script":{"id":"cbf0a702-faed-42a7-b31c-9f317a78048a","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"a185452f-8816-44e1-be6d-26a3709841f6","type":"text/javascript","exec":[""]}}],"_postman_id":"d9e66074-7120-43ce-9c3d-3a78b02100ab"},{"name":"Teardown","item":[{"name":"Delete user","event":[{"listen":"test","script":{"id":"95defde9-6a9e-4d34-a671-954af6d91b1f","exec":["const response = pm.response.json();","","pm.environment.set(\"jwt_token\", response.access_token);"],"type":"text/javascript"}}],"id":"400c5727-76b1-4b98-b860-2b1e8fe7e0c0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"username\": \"user\",\n\t\"password\": \"password\",\n\t\"extra\": \"blerg\"\n}"},"url":"http://localhost:3001/users","description":"<p>The body must have <code>username</code>, <code>password</code> and <code>extra</code>. It returns <code>id_token</code> and <code>access_token</code> which are signed with the secret located at the <code>config.json</code> file. The <code>id_token</code> will contain the <code>username</code> and the <code>extra</code> information sent, while the <code>access_token</code> will contain the <code>audience</code>, <code>jti</code>, <code>issuer</code> and <code>scope</code>.</p>\n","urlObject":{"protocol":"http","port":"3001","path":["users"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"1e3b3e32-405f-45d7-8479-456ae1c7a84c","name":"Successful response","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"username\": \"user\",\n\t\"password\": \"password\",\n\t\"extra\": \"blerg\"\n}"},"url":"http://localhost:3001/users"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Access-Control-Allow-Origin","value":"*","name":"Access-Control-Allow-Origin","description":"Specifies a URI that may access the resource. For requests without credentials, the server may specify '*' as a wildcard, thereby allowing any origin to access the resource."},{"key":"Connection","value":"keep-alive","name":"Connection","description":"Options that are desired for the connection"},{"key":"Content-Length","value":"523","name":"Content-Length","description":"The length of the response body in octets (8-bit bytes)"},{"key":"Content-Type","value":"application/json; charset=utf-8","name":"Content-Type","description":"The mime type of this content"},{"key":"Date","value":"Thu, 13 Sep 2018 20:42:22 GMT","name":"Date","description":"The date and time that the message was sent"},{"key":"ETag","value":"W/\"20b-/ULiXCB/BjV9XztkCrB50vUZugI\"","name":"ETag","description":"An identifier for a specific version of a resource, often a message digest"},{"key":"X-Powered-By","value":"Express","name":"X-Powered-By","description":"Specifies the technology (ASP.NET, PHP, JBoss, e.g.) supporting the web application (version details are often in X-Runtime, X-Version, or X-AspNet-Version)"}],"cookie":[],"responseTime":null,"body":"{\"id_token\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InVzZXIiLCJleHRyYSI6ImJsZXJnIiwiaWQiOjIsImlhdCI6MTUzNjg3MTM0MiwiZXhwIjoxNTM2ODg5MzQyfQ.OWx1l_oDyuC7Oi0uO-iglA9quxxZ2ksX-BT2lqYjojY\",\"access_token\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2dvbnRvLmNvbSIsImF1ZCI6Im5vZGVqcy1qd3QtYXV0aCIsImV4cCI6MTUzNjg3NDk0Miwic2NvcGUiOiJmdWxsX2FjY2VzcyIsInN1YiI6ImxhbGFsYW5kfGdvbnRvIiwianRpIjoiazJ4QXBOVVExWm1tQWdtcSIsImFsZyI6IkhTMjU2IiwiaWF0IjoxNTM2ODcxMzQyfQ.RTNmeyb-6mZpFEqQz0V194nKax91qJk5GN01u3hpA-Q\"}"}],"_postman_id":"400c5727-76b1-4b98-b860-2b1e8fe7e0c0"},{"name":"Delete session","event":[{"listen":"test","script":{"id":"6e5ff1d0-38e9-4978-8632-2a7fd49757db","exec":["const response = pm.response.json();","","pm.environment.set(\"jwt_token\", response.access_token);"],"type":"text/javascript"}}],"id":"3c414f28-db57-4ef8-95f6-4e1e11000f25","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"username\": \"user\",\n\t\"password\": \"password\"\n}"},"url":"http://localhost:3001/sessions/create","description":"<p>The body must have <code>username</code> and <code>password</code>. It returns <code>id_token</code> and <code>access_token</code> are signed with the secret located at the <code>config.json</code> file. The <code>id_token</code> will contain the <code>username</code> and the <code>extra</code> information sent, while the <code>access_token</code> will contain the <code>audience</code>, <code>jti</code>, <code>issuer</code> and <code>scope</code>.</p>\n","urlObject":{"protocol":"http","port":"3001","path":["sessions","create"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"2235ec24-9fac-430a-b1fe-0310590531a7","name":"Successful response","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"username\": \"user\",\n\t\"password\": \"password\"\n}"},"url":"http://localhost:3001/sessions/create"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Access-Control-Allow-Origin","value":"*","name":"Access-Control-Allow-Origin","description":"Specifies a URI that may access the resource. For requests without credentials, the server may specify '*' as a wildcard, thereby allowing any origin to access the resource."},{"key":"Connection","value":"keep-alive","name":"Connection","description":"Options that are desired for the connection"},{"key":"Content-Length","value":"523","name":"Content-Length","description":"The length of the response body in octets (8-bit bytes)"},{"key":"Content-Type","value":"application/json; charset=utf-8","name":"Content-Type","description":"The mime type of this content"},{"key":"Date","value":"Thu, 13 Sep 2018 20:44:42 GMT","name":"Date","description":"The date and time that the message was sent"},{"key":"ETag","value":"W/\"20b-OddoFD1q11lfCJ55kXMN6jd5YHE\"","name":"ETag","description":"An identifier for a specific version of a resource, often a message digest"},{"key":"X-Powered-By","value":"Express","name":"X-Powered-By","description":"Specifies the technology (ASP.NET, PHP, JBoss, e.g.) supporting the web application (version details are often in X-Runtime, X-Version, or X-AspNet-Version)"}],"cookie":[],"responseTime":null,"body":"{\"id_token\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InVzZXIiLCJleHRyYSI6ImJsZXJnIiwiaWQiOjIsImlhdCI6MTUzNjg3MTQ4MiwiZXhwIjoxNTM2ODg5NDgyfQ.ssLIBEyAF73iQQH7byi6OiXfa1r467wKx_VmfhjJSeY\",\"access_token\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2dvbnRvLmNvbSIsImF1ZCI6Im5vZGVqcy1qd3QtYXV0aCIsImV4cCI6MTUzNjg3NTA4Miwic2NvcGUiOiJmdWxsX2FjY2VzcyIsInN1YiI6ImxhbGFsYW5kfGdvbnRvIiwianRpIjoiRVJmSVVoR2hmaUxNbDFFUyIsImFsZyI6IkhTMjU2IiwiaWF0IjoxNTM2ODcxNDgyfQ.isN1Pl40xa8Ml_8Alh6kcrqO6JvXCkXdCBx0IFeFzCc\"}"}],"_postman_id":"3c414f28-db57-4ef8-95f6-4e1e11000f25"}],"id":"0ee8ac01-944c-45df-8591-aaccfa8cc109","description":"<p>After your tests run, you may need to clean up the test conditions, so that you're not littering new users, records, and other side effects throughout your test environment.</p>\n<p>The requests in this folder are just examples of cleaning up your test environment. You can't actually delete users or sessions in this example.</p>\n","event":[{"listen":"prerequest","script":{"id":"901c934f-d195-416a-a0dd-3b6bbb1ba9dc","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"32e431d3-2c88-4724-9db5-36b2d601acfb","type":"text/javascript","exec":[""]}}],"_postman_id":"0ee8ac01-944c-45df-8591-aaccfa8cc109"}],"id":"f6befa6b-3c81-46d0-90a7-946e9a875a7e","description":"<p>The requests in this folder are from a <a href=\"https://github.com/auth0-blog/nodejs-jwt-authentication-sample\">NodeJS API</a> that supports username and password authentication with JWTs and has APIs that return Chuck Norris phrases. </p>\n<hr />\n<p>Naming a collection or folder with <code>#contract</code> or <code>#integration</code> allows you to programmatically parse the tests that should be run in different circumstances, when used in conjunction with the <a href=\"https://docs.api.getpostman.com/\">Postman API</a>.</p>\n<h1 id=\"using-workspaces-for-automation\">Using workspaces for automation</h1>\n<p>Use workspaces to organize your services, and also to group together collections of tests that must be passed when deploying new code to the next server environment. Use the <a href=\"https://docs.api.getpostman.com/\">Postman API</a> to fetch a workspace along with all the collections and environments associated with that workspace and create a programmatic solution. </p>\n<p>Here's one way the Postman team uses collections and workspaces for automation:</p>\n<ol>\n<li>Create a collection of validation tests for the provider service. This can include contract validation tests driven by the consumers who are dependent on this service. This can also include integration tests to ensure more complex scenarios involving other components aren't broken when deploying new code.</li>\n<li>The name of the collection can include a tag indicating when these tests should be executed (e.g. #contract or #integration). The collection can be shared to the workspace of the provider service. Alternatively, a new workspace can be created (e.g. Continuous Integration) containing all the collections of tests that you care about in the specified circumstances.</li>\n<li>Use the <a href=\"https://docs.api.getpostman.com/\">Postman API</a> to <code>GET</code> all the collections and environments associated with your workspace. Parse the entities to discern which collections should be run in the specified circumstances.</li>\n</ol>\n<h1 id=\"setup-and-teardown\">Setup and teardown</h1>\n<p>Notice the nested folders are organized according to Setup, Tests, and Teardown. Automating the setup and teardown steps allows you to quickly re-create your test conditions in a consistent way so that you can repeat your tests quickly and easily.</p>\n","event":[{"listen":"prerequest","script":{"id":"f1a41636-4fe3-454d-8451-d393da512651","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"1f65ab5a-18e1-40f4-8c2f-421f0bcacab6","type":"text/javascript","exec":[""]}}],"_postman_id":"f6befa6b-3c81-46d0-90a7-946e9a875a7e"},{"name":"Using mocks","item":[{"name":"Mocked endpoint","event":[{"listen":"test","script":{"id":"1cf84f82-adc0-4e81-ab39-368789d40e53","exec":["let jsonData = pm.response.json();","pm.environment.set(\"bitcoinRate\", jsonData.bpi.USD.rate);",""],"type":"text/javascript"}}],"id":"81e82ed4-eb3e-4e28-bbd0-8dbcfcf7cc09","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://c54c22f8-1b5e-4f00-8865-684319b1105b.mock.pstmn.io/bitcoin","description":"<p>Instead of making a request to the <a href=\"https://www.coindesk.com/api/\">Coindesk API</a>, this request relies on a <a href=\"https://www.getpostman.com/docs/v6/postman/mock_servers/intro_to_mock_servers\">Postman mock endpoint</a> to return a predictable response.</p>\n<p>Send a request to this endpoint to view the mocked response, or view an example response under the <strong>Examples</strong> link.</p>\n","urlObject":{"protocol":"https","path":["bitcoin"],"host":["c54c22f8-1b5e-4f00-8865-684319b1105b","mock","pstmn","io"],"query":[],"variable":[]}},"response":[{"id":"3c8e39fe-4d3c-471f-bab6-d66dfccab32e","name":"Mocked endpoint","originalRequest":{"method":"GET","header":[],"url":"{{url}}/bitcoin"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Access-Control-Allow-Credentials","value":""},{"key":"Access-Control-Allow-Headers","value":""},{"key":"Access-Control-Allow-Methods","value":""},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Access-Control-Expose-Headers","value":""},{"key":"Content-Encoding","value":"gzip"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Mon, 19 Nov 2018 20:27:01 GMT"},{"key":"ETag","value":"W/\"a7-kIxN5L9H0YwilUQPUUio9A\""},{"key":"Server","value":"nginx"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Content-Length","value":"152"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"time\": {\n        \"updated\": \"Nov 19, 2018 20:25:00 UTC\",\n        \"updatedISO\": \"2018-11-19T20:25:00+00:00\",\n        \"updateduk\": \"Nov 19, 2018 at 20:25 GMT\"\n    },\n    \"disclaimer\": \"This data was produced from the CoinDesk Bitcoin Price Index (USD). Non-USD currency data converted using hourly conversion rate from openexchangerates.org\",\n    \"chartName\": \"Bitcoin\",\n    \"bpi\": {\n        \"USD\": {\n            \"code\": \"USD\",\n            \"symbol\": \"&#36;\",\n            \"rate\": \"5,003.4550\",\n            \"description\": \"United States Dollar\",\n            \"rate_float\": 5003.455\n        },\n        \"GBP\": {\n            \"code\": \"GBP\",\n            \"symbol\": \"&pound;\",\n            \"rate\": \"3,892.1176\",\n            \"description\": \"British Pound Sterling\",\n            \"rate_float\": 3892.1176\n        },\n        \"EUR\": {\n            \"code\": \"EUR\",\n            \"symbol\": \"&euro;\",\n            \"rate\": \"4,368.2164\",\n            \"description\": \"Euro\",\n            \"rate_float\": 4368.2164\n        }\n    }\n}"}],"_postman_id":"81e82ed4-eb3e-4e28-bbd0-8dbcfcf7cc09"},{"name":"Echo the exchange rate","event":[{"listen":"test","script":{"id":"7fe7a173-1a36-43a1-bbe8-20e3cf555bc2","exec":["pm.test(\"response is ok\", function () {","    pm.response.to.have.status(200);","});",""],"type":"text/javascript"}}],"id":"0ee518a6-6386-4cff-8a6c-ad5f87e70351","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://postman-echo.com/get?foo1={{bitcoinRate}}","description":"<p>This request will use information saved to a variable in a previous request.</p>\n","urlObject":{"protocol":"https","path":["get"],"host":["postman-echo","com"],"query":[{"description":{"content":"<p>Set this variable in the previous request</p>\n","type":"text/plain"},"key":"foo1","value":"{{bitcoinRate}}"}],"variable":[]}},"response":[{"id":"3869b23d-3e22-4a68-8172-1157a4e7d335","name":"Status","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://postman-echo.com/get?foo1=bar1&foo2=bar2","protocol":"https","host":["postman-echo","com"],"path":["get"],"query":[{"key":"foo1","value":"bar1"},{"key":"foo2","value":"bar2"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Encoding","value":"gzip"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Thu, 15 Nov 2018 22:21:20 GMT"},{"key":"ETag","value":"W/\"1cd-LkUKVugbVYQuMcTU7OTzmp77cMo\""},{"key":"Server","value":"nginx"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Content-Length","value":"348"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"args\": {\n        \"foo1\": \"bar1\",\n        \"foo2\": \"bar2\"\n    },\n    \"headers\": {\n        \"x-forwarded-proto\": \"https\",\n        \"host\": \"postman-echo.com\",\n        \"accept\": \"*/*\",\n        \"accept-encoding\": \"gzip, deflate\",\n        \"cache-control\": \"no-cache\",\n        \"cookie\": \"sails.sid=s%3AK8csWt5VZ3Oalv85HiBtffDcrSOJ-RiP.V14RjjJqkOv8%2BLXuHRmZ9l50G8S6eU16yLU%2F3N%2F0dKU\",\n        \"postman-token\": \"c6b9bca5-7369-4da8-a539-6c906d1133f2\",\n        \"user-agent\": \"PostmanRuntime/7.3.0\",\n        \"x-forwarded-port\": \"443\"\n    },\n    \"url\": \"https://postman-echo.com/get?foo1=bar1&foo2=bar2\"\n}"}],"_postman_id":"0ee518a6-6386-4cff-8a6c-ad5f87e70351"}],"id":"8700a7f8-3bfa-4c06-ba49-9581a7bbbae0","description":"<p><a href=\"https://medium.com/postman-engineering/https-medium-com-postman-engineering-fake-it-till-you-make-it-mocks-for-agile-development-f4d050cad694\">Mocking an endpoint</a> allows you to simulate external or internal dependencies so that you can isolate the system under test. It also allows you to mock certeain error conditions that may be difficult or problematic to re-create in a production environment</p>\n<p>The first request in this folder mocks an external endpoint. We previously reviewed an example using the <a href=\"https://www.coindesk.com/api/\">Coindesk API</a>. Instead of making a request to the Coindesk API, we will rely on a mock response from the Postman cloud.</p>\n","event":[{"listen":"prerequest","script":{"id":"b96ef6c3-eae2-4da9-9ed8-0800485b0b11","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"bc877c3a-ae77-4058-a0dd-59650816c0cd","type":"text/javascript","exec":[""]}}],"_postman_id":"8700a7f8-3bfa-4c06-ba49-9581a7bbbae0"}],"id":"8721fb9e-19ec-4476-a9a7-c6552374efee","description":"<p>Knowing how your endpoints interact with other systems is an important part of testing.</p>\n<h1 id=\"automating-your-tests-in-postman\">Automating your tests in Postman</h1>\n<p>Now that you've written automated tests, there's a few ways to execute your tests.</p>\n<ul>\n<li>From the Postman app with <a href=\"https://www.getpostman.com/docs/v6/postman/collection_runs/starting_a_collection_run\">the collection runner</a></li>\n<li>From the Postman cloud with <a href=\"https://www.getpostman.com/docs/v6/postman/monitors/intro_monitors\">a scheduled monitor</a></li>\n<li>From the command line or as part of a CI/CD pipeline <a href=\"http://blog.getpostman.com/2018/06/21/newman-run-and-test-your-collections-from-the-command-line/\">with Newman</a></li>\n</ul>\n<p><img src=\"https://s3.amazonaws.com/postman-static-getpostman-com/postman-docs/newmanEcho.gif\" alt=\"[newman gif](https://s3.amazonaws.com/postman-static-getpostman-com/postman-docs/newmanEcho.gif)\" /></p>\n<h1 id=\"other-helpful-tools\">Other helpful tools</h1>\n<p>There are a number of tools for visualizing your test results. When a test fails, you can drill down to debug and isolate the issues.</p>\n<ul>\n<li>Console <a href=\"https://www.getpostman.com/docs/v6/postman/sending_api_requests/debugging_and_logs#network-calls-with-postman-console\">to visualize network calls and log statements</a></li>\n<li>Similar <a href=\"https://www.getpostman.com/docs/v6/postman/monitors/troubleshooting_monitors\">console for monitors</a></li>\n<li><a href=\"https://www.getpostman.com/docs/v6/postman/monitors/viewing_monitor_results\">Viewing monitor results</a> and <a href=\"https://www.getpostman.com/docs/v6/postman/monitors/integrations_for_alerts\">receiving alerts for failures</a></li>\n<li>Common <a href=\"https://github.com/postmanlabs/newman#reporters\">reporters for Newman output</a></li>\n<li><a href=\"https://medium.com/postman-engineering/https-medium-com-postman-engineering-fake-it-till-you-make-it-mocks-for-agile-development-f4d050cad694\">Mock services</a> for isolating dependencies</li>\n</ul>\n","event":[{"listen":"prerequest","script":{"id":"3aa52219-faa5-4dd2-9415-ff026847c5c3","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"4cb520ef-ff26-47a3-b707-a4beaa8d4252","type":"text/javascript","exec":[""]}}],"_postman_id":"8721fb9e-19ec-4476-a9a7-c6552374efee"}],"event":[{"listen":"prerequest","script":{"id":"12da26a7-df4d-402b-8134-de23a7a40c58","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"c2294604-fd81-4973-803f-222898bc38d5","type":"text/javascript","exec":[""]}}]}