Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8411501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:26:08+00:00 2026-06-10T00:26:08+00:00

Let say your website need to call Twitter API to perform some tasks, you

  • 0

Let say your website need to call Twitter API to perform some tasks, you have several options:

  1. Only use mock
  2. Use mock in unit test, but use production api in integration test
  3. Only call production api, never use mock

Which one is the best approach if your services depends on the external api?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:26:09+00:00Added an answer on June 10, 2026 at 12:26 am

    I would step back and ask yourself what you are trying to test.

    If you are trying to test your other code in isolation, use a mock (that’s the purpose of a mock after all).

    If you are trying to really test end-to-end, use the production API (or a live test API if they have one).

    So my answer is pretty close to your #2 choice, with the caveat that you should consider whether you need to test an API from a third party. Sometimes it makes sense to do so or is necessary, sometimes it doesn’t make sense (they are known to be reliable or it’s very inconvenient to do so).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say several external sites are scraping/harvesting your content and posting it as their
Let's say you need to rewrite a university website, the key feature being the
I'm wondering let's say if i signup in a website and they have a
Let's start by example. There's a website, say it's a clone of Twitter named
Let's say you're implementing your own version of stackoverflow (once again, yes) You have
So let's say user did something on my website, for example uploaded some images
Let's say i have a form <form action=delete_post.php method=post>...</form> on my website: http://mysite.com and
I would need to have two different projects, let's say internal and external, which
Let's say you have a website contest programmed in PHP, and the user must
Let's say your creating an application that needs to send you an email monthly.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.