Add mock HTTP server for integration tests#11
Merged
jonathan-kosgei merged 1 commit intoclaude/update-ipdata-api-AXInjfrom Feb 23, 2026
Merged
Add mock HTTP server for integration tests#11jonathan-kosgei merged 1 commit intoclaude/update-ipdata-api-AXInjfrom
jonathan-kosgei merged 1 commit intoclaude/update-ipdata-api-AXInjfrom
Conversation
Replace live API calls with a local MockIpdataServer using JDK's HttpServer. Tests now use fixture JSON data instead of requiring an IPDATACO_KEY env var and network access to api.ipdata.co. - Add MockIpdataServer with fixture-based HTTP responses - Add JSON fixture files for all IPs used in tests - Update all 7 integration test classes to use mock server - Disable nexus-staging-maven-plugin extension (deploy-only) https://claude.ai/code/session_01KxvyXRVVZaLrgTZshvsZY6
jonathan-kosgei
added a commit
that referenced
this pull request
Feb 23, 2026
Merge pull request #11 from ipdata/claude/verify-all-tests-G2MNU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a mock HTTP server for testing the ipdata client library, eliminating the need for external API calls during test execution.
Key Changes
New MockIpdataServer class: A singleton HTTP server that handles GET and POST requests, mimicking the ipdata.co API behavior
Test fixtures: Added 5 JSON fixture files representing real ipdata API responses for:
Updated test classes: Modified all integration tests (AsnTest, CurrencyTest, FullModelTest, ThreatTest, TimeZoneTest, BulkTest, MultipleFieldsSelectionTest) to use the mock server instead of the live API endpoint
Build configuration: Changed nexus-staging-maven-plugin extension setting from true to false
Implementation Details
HttpServerand dynamically binds to an available porthttps://claude.ai/code/session_01KxvyXRVVZaLrgTZshvsZY6