java-stellar-sdk icon indicating copy to clipboard operation
java-stellar-sdk copied to clipboard

Tests shouldn't make requests to real servers.

Open paulbellamy opened this issue 4 years ago • 3 comments

What version are you using?

OpenJDK 8

What did you do?

Ran the tests.

What did you expect to see?

No http requests to the outside world while running tests.

What did you see instead?

That there are network requests to horizon.stellar.org and others.

More Info

See: https://github.com/stellar/java-stellar-sdk/pull/339/commits/04a113a960aebd41d713510b3f0b10e0fb2a056e

paulbellamy avatar Apr 12 '21 18:04 paulbellamy

Are you sure there were network requests in the commit you added here? That's true that the mocked responses contains real horizon URLs but I think it's just a mocked string.

bartekn avatar Apr 13 '21 10:04 bartekn

Well.. Before the linked commit the test was failing with a 503. Once I replaced the urls in the next page link, it started succeeding with the expected 200. So it's talking to somewhere unexpected. Needs a bit more digging to say for sure whether that's a real network or an unexpected stub.

paulbellamy avatar Apr 14 '21 12:04 paulbellamy

Oh, it's about nextPage. I understand now 👍 .

bartekn avatar Apr 14 '21 14:04 bartekn