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 8551753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:15:52+00:00 2026-06-11T14:15:52+00:00

I often have to code against Twitter, and now against other Web Service APIs

  • 0

I often have to code against Twitter, and now against other Web Service APIs that I do not control.

I’ve tried to write test cases but it seems too difficult as:

  1. I am bound to the speed of something I cannot control (the web-service).
  2. I cannot control the state of the web service (cannot delete an account, tweet, and restart)

For folks facing similar situations, I’d like to find out the solutions they’ve devised.

PS: I’m familiar with mock objects but I’d like to get more specific lessons learned — for example I use a library to talk to Twitter (Twitter4J) which, when last I looked does not allow me to substitute a mock object for the Twitter Service.

Thanks.

  • 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-11T14:15:53+00:00Added an answer on June 11, 2026 at 2:15 pm

    In my projects (which rely on a variety of external web services) I’ve focused my testing on failure events. So when building a unit test for Facebook Connect I tried to pass junk data to my web service response processing methods to make sure that I could handle the service changing underneath me. Successful event testing wasn’t something I put into a unit test because it creates so much cruft (like events in a timeline). A possible work around to this are to create a test account in your intended service and point your unit tests to that ID. If you make sure that your web service posting code doesn’t include hard coded IDs (I like to create <Service>Config classes that are passed to <Service>Methods classes like FacebookMethods.auth(FacebookConfig config, String uid)) this lets me create a TestConfig for operations that will modify a service in a way that can’t be undone or shouldn’t be seen publicly).

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

Sidebar

Related Questions

I often see a pattern used in circumstances where we have look-up code that
I have an example of some code that I see often in websites that
I have a web service that needs to be protected from unauthorized users. I
Quite often I have unit tests using MSTest for code that is in a
I noticed that a lot of tutorial instructions often have this code: $sql=SELECT *
I quite often have rows of code like the following: UPDATE my_table SET name
I often have a situation in my Java code when I need to set
very often I like to have my movieclip code inside the movieclip (on a
I have the following line of code called very often: var configValue = System.Configuration.ConfigurationManager.AppSettings[ConfigValueKey];
I often have to deal with XML documents that contain namespaced elements, but doesn't

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.