<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How should I test my REST API? in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-should-I-test-my-REST-API/m-p/78417#M49257</link>
    <description>&lt;DIV class="_3xX726aBn29LDbsDtzr_6E _1Ap4F5maDtT1E1YuCiaO0r D3IL3FD0RFy_mkKLPwL4"&gt;&lt;DIV class="_292iotee39Lmt0MkQZ2hPV RichTextJSON-root"&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;I couldn't find the answer to the questions I'm going to ask. Let's say I'm developing a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;REST API&lt;/STRONG&gt;.&lt;/P&gt;&lt;UL class="_33MEMislY0GAlB78wL1_CR"&gt;&lt;LI&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Should I test every endpoint?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Every endpoint interacts with the database. Should my tests include a database connection?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Where do&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;unit tests&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;fit in a REST API, apart from request validation?&lt;/P&gt;&lt;UL class="_33MEMislY0GAlB78wL1_CR"&gt;&lt;LI&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Every controller call goes like this:&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;OL class="_1eJr7K139jnMstd4HajqYP"&gt;&lt;LI&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Receive request &amp;lt;-- here, I see I could have unit tests for validating request body and HTTP headers&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Process &amp;lt;-- here, no matter how deep this level can go, there's going to be interaction with the database, so any test here would mean&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;integration&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;test&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Return response&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;UL class="_33MEMislY0GAlB78wL1_CR"&gt;&lt;LI&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Considering the above for every call, how can there be unit tests apart from validating request? When there's database / external service interaction in the test, it's an&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;integration&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;test, right? So I don't see where else could there be unit tests.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 06 Sep 2021 18:54:48 GMT</pubDate>
    <dc:creator>MaxiBelas</dc:creator>
    <dc:date>2021-09-06T18:54:48Z</dc:date>
    <item>
      <title>How should I test my REST API?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-should-I-test-my-REST-API/m-p/78417#M49257</link>
      <description>&lt;DIV class="_3xX726aBn29LDbsDtzr_6E _1Ap4F5maDtT1E1YuCiaO0r D3IL3FD0RFy_mkKLPwL4"&gt;&lt;DIV class="_292iotee39Lmt0MkQZ2hPV RichTextJSON-root"&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;I couldn't find the answer to the questions I'm going to ask. Let's say I'm developing a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;REST API&lt;/STRONG&gt;.&lt;/P&gt;&lt;UL class="_33MEMislY0GAlB78wL1_CR"&gt;&lt;LI&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Should I test every endpoint?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Every endpoint interacts with the database. Should my tests include a database connection?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Where do&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;unit tests&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;fit in a REST API, apart from request validation?&lt;/P&gt;&lt;UL class="_33MEMislY0GAlB78wL1_CR"&gt;&lt;LI&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Every controller call goes like this:&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;OL class="_1eJr7K139jnMstd4HajqYP"&gt;&lt;LI&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Receive request &amp;lt;-- here, I see I could have unit tests for validating request body and HTTP headers&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Process &amp;lt;-- here, no matter how deep this level can go, there's going to be interaction with the database, so any test here would mean&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;integration&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;test&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Return response&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;UL class="_33MEMislY0GAlB78wL1_CR"&gt;&lt;LI&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Considering the above for every call, how can there be unit tests apart from validating request? When there's database / external service interaction in the test, it's an&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;integration&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;test, right? So I don't see where else could there be unit tests.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 06 Sep 2021 18:54:48 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-should-I-test-my-REST-API/m-p/78417#M49257</guid>
      <dc:creator>MaxiBelas</dc:creator>
      <dc:date>2021-09-06T18:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: How should I test my REST API?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-should-I-test-my-REST-API/m-p/81058#M51089</link>
      <description>&lt;P class=""&gt;I checked the issue, it was a very simple fix.&lt;/P&gt;&lt;P class=""&gt;In my comment on the issue, I mentioned how I was new to open source contribution, and would like to solve this issue.&lt;/P&gt;&lt;P class=""&gt;The owner/top people for the repository didn't even say anything to my comment and just gave the issue to some other guy(possibly a person who has already contributed many times)&lt;/P&gt;&lt;P class=""&gt;How do you get started as oss contributor as a newbie if you find an issue you can solve but then the repository owner just problems you over and gives someone else the issue.&lt;/P&gt;&lt;P class=""&gt;Should I have not mentioned I was a newbie?&lt;/P&gt;&lt;P class=""&gt;Am I expected to chat around/introduce/make friends in their IRC,mailing list before I am allowed to do this?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 15:14:03 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-should-I-test-my-REST-API/m-p/81058#M51089</guid>
      <dc:creator>hype</dc:creator>
      <dc:date>2022-02-01T15:14:03Z</dc:date>
    </item>
  </channel>
</rss>

