Opened 7 years ago

Last modified 4 years ago

#16637 closed defect

Rework unit tests to not depend on external website — at Version 14

Reported by: Don-vip Owned by: team
Priority: normal Milestone: 20.11
Component: Unit tests Version:
Keywords: Cc: ris

Description (last modified by simon04)

We still have some unit tests making real network connections, failing when the website is slow or unreachable:

  1. ✔ org.openstreetmap.josm.gui.oauth.OsmOAuthAuthorizationClientTest.testCookieHandlingMock
  2. org.openstreetmap.josm.gui.oauth.OsmOAuthAuthorizationClientTest.testCookieHandlingCookieManager
  3. ✔ org.openstreetmap.josm.gui.preferences.server.ApiUrlTestTaskTest.testNominalUrl
  4. ✔ org.openstreetmap.josm.gui.preferences.server.ApiUrlTestTaskTest.testAlertInvalidServerResult
  5. ✔ org.openstreetmap.josm.io.OsmServerHistoryReaderTest.testWay
  6. ✔ org.openstreetmap.josm.io.OsmServerHistoryReaderTest.testNode
  7. ✔ org.openstreetmap.josm.tools.HttpClientTest.testOpenUrlBzip
  8. ✔ org.openstreetmap.josm.tools.HttpClientTest.testOpenUrlGzip
  9. ✔ org.openstreetmap.josm.tools.HttpClientTest.testTicket9660

Change History (14)

comment:1 by ris, 7 years ago

There also those that unintentionally make network requests, e.g. fetching the "start page" from the wiki.

comment:2 by Don-vip, 7 years ago

In 14191/josm:

see #16637 - javadoc

comment:3 by simon04, 5 years ago

Related: #15102

comment:4 by Don-vip, 5 years ago

In 17075/josm:

see #15102 - see #16637 - get rid of real HTTP calls to http://httpstat.us in unit tests, mock them

comment:5 by Don-vip, 5 years ago

In 17154/josm:

see #15102 - see #16637 - get rid of real HTTP calls to https://httpbin(go).org in unit tests, mock them

comment:6 by simon04, 5 years ago

In 17189/josm:

see #15102 - see #16637 - get rid of real HTTP calls to https://josm.openstreetmap.de/josmticket in unit tests, mock them

comment:7 by simon04, 5 years ago

Milestone: 20.10

comment:8 by simon04, 5 years ago

In 17192/josm:

see #15102 - see #16637 - get rid of real HTTP calls to https://api.openstreetmap.org in ApiUrlTestTaskTest, mock them

comment:9 by simon04, 5 years ago

In 17194/josm:

see #15102 - see #16637 - get rid of real HTTP calls to https://api.openstreetmap.org in OsmServerHistoryReaderTest, mock them

comment:10 by simon04, 5 years ago

In 17195/josm:

see #15102 - see #16637 - Use WireMockServer.url()

comment:11 by simon04, 5 years ago

In 17196/josm:

see #15102 - see #16637 - get rid of real HTTP calls to https://www.openstreetmap.org/login in OsmOAuthAuthorizationClientTest, mock them

comment:12 by simon04, 5 years ago

Description: modified (diff)

comment:13 by simon04, 5 years ago

In 17197/josm:

see #15102 - see #16637 - get rid of real HTTP calls to https://www.openstreetmap.org/trace in HttpClientTest, mock them

comment:14 by simon04, 5 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.