Add getSuspendPostUri and getResumePostUri getters to HttpManagementPayload#264
Add getSuspendPostUri and getResumePostUri getters to HttpManagementPayload#264
Conversation
There was a problem hiding this comment.
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()andgetResumePostUri()getters toHttpManagementPayload. - Add
HttpManagementPayloadTestunit tests covering all URL getter methods (including suspend/resume). - Enable the JUnit Platform for the default
testtask inendtoendtests.
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.
YunchuWang
left a comment
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
[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:
- Running :azurefunctions:test will not execute these tests.
- Required the endtoendtests/build.gradle change to add excludeTags e2e -- unnecessary if tests were in the right module.
- 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()); | ||
| } | ||
| } |
There was a problem hiding this comment.
[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());
Issue describing the changes in this PR
Enhancements to HTTP management endpoints:
getSuspendPostUri()andgetResumePostUri()to theHttpManagementPayloadclass, providing URLs for suspending and resuming orchestration instances. This fixes feature parity between SDKs.Testing improvements:
HttpManagementPayloadTest.javawith unit tests covering all URL generation methods inHttpManagementPayload, including the new suspend and resume endpoints.Build and test configuration:
endtoendtests/build.gradleto enable the JUnit Platform for running tests, ensuring compatibility with JUnit 5.Pull request checklist
CHANGELOG.md