Skip to content

feat: enhance OData observability and test utilities - #1265

Open
rudramadhab22 wants to merge 2 commits into
SAP:mainfrom
rudramadhab22:enhancement/v1
Open

feat: enhance OData observability and test utilities#1265
rudramadhab22 wants to merge 2 commits into
SAP:mainfrom
rudramadhab22:enhancement/v1

Conversation

@rudramadhab22

@rudramadhab22 rudramadhab22 commented Aug 29, 2026

Copy link
Copy Markdown

Description

This PR enhances the OData observability mechanism and extends the test utilities to support advanced connectivity testing.

Key Changes:

  • OData Observability:
    • Added listenOnResponse and listenOnExecutionFinished hooks to the ODataRequestListener interface.
    • Implemented performance tracking by measuring and reporting request execution duration via the new hooks.
    • Fixed a gap where error hooks (listenOnRequestError, listenOnParsingError) were defined but never actually invoked in the execution flow.
    • Ensured full lifecycle coverage for listeners, including handling of execution errors, buffering failures, and JSON mapping issues.
  • Test Utilities:
    • Introduced RequestHeaderContext to simplify the mocking and verification of RequestHeaderContainer in unit tests.
    • Updated TestContext to implement the new interface, allowing developers to set/clear request headers fluently in their test setups.

Context

SAP/cloud-sdk-java-backlog#ISSUENUMBER.

These changes were needed to provide better insights into OData request execution (performance and outcome) and to lower the barrier for writing tests that involve complex request header scenarios.

Feature scope:

  • Enhance ODataRequestListener with response and timing hooks
  • Implement execution duration measurement and notification
  • Ensure error hooks are triggered during request/parsing failures
  • Add RequestHeaderContext to testutil
  • Verify changes with new and updated unit tests

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Error handling created / updated & covered by the tests above
  • Documentation updated
  • Release notes updated

- Enhanced ODataRequestListener with hooks for HTTP responses and execution duration.
- Implemented performance tracking for OData requests.
- Ensured all listener hooks are invoked during the request and parsing lifecycle.
- Added RequestHeaderContext to test utilities for easier mocking of request headers.
- Updated TestContext to implement RequestHeaderContext.
- Added unit tests for new observability features and test utility extensions.
@cla-assistant

cla-assistant Bot commented Aug 29, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

- Enhanced ODataRequestListener with hooks for HTTP responses and execution duration.
- Implemented performance tracking for OData requests by measuring and reporting execution time.
- Ensured all listener hooks (request, response, error, parsing) are correctly invoked during the OData request lifecycle.
- Introduced RequestHeaderContext to test utilities to simplify mocking and verification of request headers.
- Updated TestContext to implement RequestHeaderContext for improved developer experience in unit tests.
- Added comprehensive unit tests for new observability features and test utility extensions.
- Fixed PMD static analysis violations regarding field declaration ordering.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant