Skip to content

Conversation

@tcheeric
Copy link
Collaborator

Summary

  • define error-port constants and inspect request URIs via AbstractOperation in lightning address and invoice request tests
  • expand operation tests to cover GET and PATCH constructors, header handling, and null HttpRequest arguments
  • assert underlying HTTP paths for GET/PATCH requests and validate PostRequest header parameters
  • allow header additions in PatchOperation tests

Testing

  • mvn -q verify

https://chatgpt.com/codex/tasks/task_b_68a68284e27c8331af7f0f50858da57a

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@tcheeric tcheeric requested a review from Copilot August 21, 2025 03:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds comprehensive testing coverage for the phoenixd-rest module, expanding test suites to validate HTTP operations, request handling, parameter validation, and error scenarios.

  • Enhances existing test classes with additional test methods and better documentation
  • Adds new comprehensive test suites for operations, requests, and AbstractRequest functionality
  • Introduces proper error handling tests and null argument validation across the codebase

Reviewed Changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
PayRequestFactoryTest.java (phoenixd-test) Added comprehensive comments and additional validation tests
PayLightningAddressTest.java Added error port constant and improved URI inspection via AbstractOperation
PayBolt11InvoiceRequestTest.java Added descriptive comment for constructor test
CreateBolt11InvoiceRequestTest.java Added error port constant and improved URI inspection
PatchOperationTest.java Modified to allow header additions instead of throwing exceptions
AddHeaderOperationTest.java Added setup method and test for PATCH operations
app.properties New configuration file for phoenixd-rest tests
PayRequestFactoryTest.java (phoenixd-rest) New comprehensive factory test with null validation
RequestTest.java New extensive test suite for request constructors and validation
AbstractRequestTest.java New test suite for JSON parsing and response handling
OperationsTest.java New comprehensive test suite for all HTTP operation types
AbstractOperationTest.java Enhanced with error handling and header management tests
Multiple model test files Added descriptive comments to existing test methods

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

errorServer.start();
try {
TestUtils.setBaseUrl("http://localhost:" + ERROR_PORT);
TestUtils.setBaseUrl("http://localhost:" + ERROR_SERVER_PORT);
Copy link

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line references ERROR_SERVER_PORT but the variable being used should be consistent with the declaration on line 27. The code shows ERROR_PORT was used in the original line but should be ERROR_SERVER_PORT to match the constant.

Copilot uses AI. Check for mistakes.
assertNotNull(request.getOperation().getHeader("Authorization"));
assertThrows(UnsupportedOperationException.class, () -> request.getOperation().addHeader("x", "y"));
assertDoesNotThrow(() -> request.getOperation().addHeader("x", "y"));
assertEquals("y", request.getOperation().getHeader("x"));
Copy link

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The change from throwing UnsupportedOperationException to allowing header additions represents a significant behavioral change in the PatchOperation. This should be documented in the commit message or PR description to explain why this operation is now supported.

Copilot uses AI. Check for mistakes.
@tcheeric tcheeric merged commit 1901ae8 into develop Aug 21, 2025
3 of 4 checks passed
@tcheeric tcheeric deleted the codex/add-missing-unit-tests-for-phoenixd-rest-46dcn8 branch August 21, 2025 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants