Skip to content

Add getSuspendPostUri and getResumePostUri getters to HttpManagementPayload#264

Open
bachuv wants to merge 4 commits intomainfrom
vabachu/http-urls
Open

Add getSuspendPostUri and getResumePostUri getters to HttpManagementPayload#264
bachuv wants to merge 4 commits intomainfrom
vabachu/http-urls

Conversation

@bachuv
Copy link
Contributor

@bachuv bachuv commented Feb 25, 2026

Issue describing the changes in this PR

Enhancements to HTTP management endpoints:

  • Added new methods getSuspendPostUri() and getResumePostUri() to the HttpManagementPayload class, providing URLs for suspending and resuming orchestration instances. This fixes feature parity between SDKs.

Testing improvements:

  • Added a new test class HttpManagementPayloadTest.java with unit tests covering all URL generation methods in HttpManagementPayload, including the new suspend and resume endpoints.

Build and test configuration:

  • Updated endtoendtests/build.gradle to enable the JUnit Platform for running tests, ensuring compatibility with JUnit 5.

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes are added to the CHANGELOG.md
  • I have added all required tests (Unit tests, E2E tests)

@bachuv bachuv requested a review from a team as a code owner February 25, 2026 16:59
Copilot AI review requested due to automatic review settings February 25, 2026 16:59
Copy link
Contributor

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 missing suspend/resume management endpoint getters to HttpManagementPayload (used by Azure Functions HTTP management payloads) and introduces a small unit test suite to validate URL generation, along with Gradle test configuration updates for the endtoendtests module.

Changes:

  • Add getSuspendPostUri() and getResumePostUri() getters to HttpManagementPayload.
  • Add HttpManagementPayloadTest unit tests covering all URL getter methods (including suspend/resume).
  • Enable the JUnit Platform for the default test task in endtoendtests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
azurefunctions/src/main/java/com/microsoft/durabletask/azurefunctions/HttpManagementPayload.java Exposes suspend/resume POST management URLs via new getters.
endtoendtests/src/test/java/com/functions/HttpManagementPayloadTest.java Adds unit tests to validate URL construction for all management endpoints.
endtoendtests/build.gradle Configures the default Gradle test task to run on JUnit Platform.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@YunchuWang YunchuWang left a comment

Choose a reason for hiding this comment

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

Code Review Summary

Overall Risk: Low
Merge Recommendation: Safe with fixes the core change is correct and simple, with two minor improvements suggested.

Findings

ID Severity Priority Title
F1 Medium P2 Unit tests placed in wrong module
F2 Low P3 Missing getRewindPostUri test coverage
F3 Nit P4 Inconsistent this. prefix in existing getters (pre-existing)

See inline comments for F1 and F2 details.


F3 (Nit, P4): The existing getRestartPostUri() (line 96) and getRewindPostUri() (line 123) use return restartPostUri / return rewindPostUri without this., while all other getters (including the two new ones in this PR) use return this.fieldName. This is a pre-existing inconsistency not introduced by this PR but could be fixed as a drive-by cleanup.

/**
* Unit tests for {@link HttpManagementPayload}.
*/
public class HttpManagementPayloadTest {
Copy link
Member

Choose a reason for hiding this comment

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

[F1] Unit tests placed in wrong module (Medium / P2)

HttpManagementPayload belongs to the azurefunctions module, but this test file is in endtoendtests. Since these are pure unit tests (no Functions host, no external dependencies), they should live in azurefunctions/src/test/java/com/microsoft/durabletask/azurefunctions/HttpManagementPayloadTest.java with package com.microsoft.durabletask.azurefunctions.

Consequences of current placement:

  1. Running :azurefunctions:test will not execute these tests.
  2. Required the endtoendtests/build.gradle change to add excludeTags e2e -- unnecessary if tests were in the right module.
  3. Package com.functions does not match the class under test.

Suggestion: Move this file to azurefunctions/src/test/ and revert the endtoendtests/build.gradle change.

HttpManagementPayload payload = createPayload();
assertEquals(INSTANCE_STATUS_URL + "/resume?reason={text}&" + QUERY_STRING, payload.getResumePostUri());
}
}
Copy link
Member

Choose a reason for hiding this comment

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

[F2] Missing getRewindPostUri test (Low / P3) -- This test class covers 8 of the 9 getters but is missing getRewindPostUri(). Adding it would complete full coverage. Suggested test: assertEquals(INSTANCE_STATUS_URL + /rewind?reason={text}& + QUERY_STRING, payload.getRewindPostUri());

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.

3 participants