-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(FTM): avoid executing ftm logic for immediate publish date in liv…
…e mode #31442 (#31448) This pull request includes changes to the `PageResource` class and updates to the Future Time Machine (FTM) tests. The most important changes include importing additional utility classes, adding a new method to handle the FTM grace window logic, and updating the test scenarios to validate the new logic. ### Enhancements to Time Machine Functionality: * [`dotCMS/src/main/java/com/dotcms/rest/api/v1/page/PageResource.java`](diffhunk://#diff-225a703de3d295e7f6f361bd33455f27f09021c58403adbda9569399eef95da0R29): Added `TimeMachineUtil` to handle time machine date parsing and validation. * [`dotCMS/src/main/java/com/dotcms/util/TimeMachineUtil.java`](diffhunk://#diff-d8f93700798e41883a5646a31a10a707d7832eaf17a8419196d5743eefd585e7R6-R23): Introduced methods `parseTimeMachineDate` and `isOlderThanGraceWindow` to validate and parse ISO 8601 date strings, ensuring dates are older than a configurable grace window. ### Test Coverage Improvements: * [`dotcms-integration/src/test/java/com/dotcms/util/TimeMachineUtilTest.java`](diffhunk://#diff-9d38338bff66501965ab2d3ce3abad7acd7a88b962384e9e17e1a5898d6743a9R4-R28): Added test cases for `parseTimeMachineDate` and `isOlderThanGraceWindow` methods, covering scenarios with null, invalid, valid within grace window, and valid outside grace window dates. ### Test Scenario Updates: * [`test-karate/src/test/java/graphql/ftm/setup.feature`](diffhunk://#diff-37f0b51013b66c2d7cf33fbd083df1c5ef5e71f805299725e33f0bd1de57b97cL41-R63): Updated the setup to include a new content piece and its version within the grace window. This ensures the test environment is correctly configured for the new Time Machine scenarios. * [`test-karate/src/test/java/tests/graphql/ftm/CheckingTimeMachine.feature`](diffhunk://#diff-644e56e9ca92e212f8d0926f9788c1c35088eea4e1a6b2db75d6be1060523692R8-R10): Added a new test scenario to verify that content with a publish date within the grace window is not displayed by the Time Machine functionality.
- Loading branch information
1 parent
df7c06c
commit 9d69c74
Showing
6 changed files
with
190 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Feature: Create a Page | ||
Feature: Upload FileAsset | ||
Background: | ||
|
||
* def fileName = __arg.fileName | ||
|
This file contains 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
This file contains 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