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

  • SEARCH
  • Home
  • 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 8179033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:54:44+00:00 2026-06-06T23:54:44+00:00

This is probably a stupid question; however, I am out of options and would

  • 0

This is probably a stupid question; however, I am out of options and would appreciate help. I am trying to mock file downloads using Robolectric. I am referring to the class HttpTest.java, and the Robolectric blog post.

My problem: Maven is unable to find the Http class referred to in the HttpTest.java code. I could manually bring it over as a class in the same package, but I ended up getting a NullPtrException in one of the methods of class Http.

I have searched on the net for a solution. I have also verified the modules configuration in the pom file. I do have com.pivotlabs present there.

Has anyone gotten this working? Please let me know what I am missing here.

  • 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-06T23:54:45+00:00Added an answer on June 6, 2026 at 11:54 pm

    I got this working.

    1. Http is a class internal to Robolectric’s sample code. It can be used outside; but you might not want to do that if your code is gonna be built non-locally.
    2. The clarification/mention in documentation that would have gone long way in helping me is: “Robolectric will give you the response you create using addPendingHttpResponse() for your HTTP request, no matter how you do the request. Robolectric will NOT do an actual HTTP request.” Once I understood this, rest was easy.
    3. I used Apache’s DefaultHttpClient for my request, and verified received response against the already created response.

    Hope this helps; I’d be happy to clarify further.

    Thanks for the help I received here.

    [I had asked this question on Robolectric’s google group as well.]

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

Sidebar

Related Questions

I'm new to network programming. This is probably a stupid question, would it be
This is probably a really stupid question but I can't figure this out. I
Hey, first of all thanks for helping me out with this (probably stupid) question
Well this is probably a stupid question with a simple answer but when using
This is probably a stupid question, but I still have no answer. I would
This is probably a stupid question, but I just can't figure out how to
This is probably a very stupid question, but I just cant figure it out.
I'm used to MSSQL, not Mysql, so sorry for this probably stupid question. I'm
this is probably a stupid question but I can't seem to find the answer.
This is probably a stupid question, but how much of a security risk is

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.