feat/CUS-9870-Added class to subtract minutes#290
Conversation
📝 WalkthroughWalkthroughThe pull request updates the project version, upgrades dependencies (Lombok, adds commons-lang3), improves exception handling in AddMinutesToDateTime, and introduces a new SubtractMinutesToDateTime class that mirrors the add functionality. Additional changes to a Calculator class include a new method, updated method signature, and variable renaming. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
add_minutes_to_the_specific_date_time_and_store_the_output_in_specific_format/pom.xmladd_minutes_to_the_specific_date_time_and_store_the_output_in_specific_format/src/main/java/com/testsigma/addons/web/AddMinutesToDateTime.javaadd_minutes_to_the_specific_date_time_and_store_the_output_in_specific_format/src/main/java/com/testsigma/addons/web/SubtractMinutesToDateTime.java
🔇 Additional comments (2)
add_minutes_to_the_specific_date_time_and_store_the_output_in_specific_format/pom.xml (1)
9-9: LGTM!The version bump to 1.0.3 is appropriate for the new subtract minutes functionality being added.
add_minutes_to_the_specific_date_time_and_store_the_output_in_specific_format/src/main/java/com/testsigma/addons/web/AddMinutesToDateTime.java (1)
9-9: LGTM! Improved exception handling.The use of
ExceptionUtilsimproves error handling by providing more robust error message extraction and full stack trace logging. This is a good enhancement for debugging and error reporting.Also applies to: 78-82
| <testsigma.addon.maven.plugin>1.0.0</testsigma.addon.maven.plugin> | ||
| <maven.source.plugin.version>3.2.1</maven.source.plugin.version> | ||
| <lombok.version>1.18.20</lombok.version> | ||
| <lombok.version>1.18.30</lombok.version> |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Lombok version 1.18.30 latest stable release security advisories
💡 Result:
Short answer: There are no Lombok-specific security advisories or CVEs targeting lombok 1.18.30. Project Lombok states the tool is a build-time dependency and is "highly unlikely" to be a source of security vulnerabilities; the 1.18.30 release (Sept 20, 2023) contains only platform/bugfix changes. If you worry about transitive or test-only deps (e.g., Log4j), those are separate projects to track. [1][2][3][4]
Sources:
- Project Lombok — Security page. [1]
- Lombok changelog — v1.18.30 (Sept 20, 2023). [2]
- Maven Central listing for org.projectlombok:lombok:1.18.30. [3]
- Project Lombok GitHub — discussion: Log4j issue (lombok itself not affected). [4]
🌐 Web query:
Lombok latest version 2024 2025 current release
💡 Result:
As of Dec 24, 2025 the latest Project Lombok release is 1.18.42 (published Sept 18, 2025). [1][2]
Sources:
[1] Maven Central listing for org.projectlombok:lombok.
[2] lombok-annotations changelog / release notes.
Update Lombok to version 1.18.42.
Lombok 1.18.30 is secure with no known CVEs, but version 1.18.42 (released September 2025) is the current stable release. Update to the latest version for bug fixes and improvements.
🤖 Prompt for AI Agents
In
add_minutes_to_the_specific_date_time_and_store_the_output_in_specific_format/pom.xml
around line 20, the project is declaring Lombok version 1.18.30; update this
property to 1.18.42. Edit the <lombok.version> element to 1.18.42, save the pom,
and run a Maven build (or mvn -U) to refresh dependencies and verify there are
no compilation or test regressions.
| <dependency> | ||
| <groupId>org.apache.commons</groupId> | ||
| <artifactId>commons-lang3</artifactId> | ||
| <version>3.17.0</version> | ||
| </dependency> |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Apache Commons Lang 3 latest version 2025 security advisories
💡 Result:
Short answer
- Latest Commons Lang 3 release (as of Dec 24, 2025): 3.20.0 (released Nov 12, 2025). [1]
- Known recent security advisory: CVE-2025-48924 — uncontrolled recursion (StackOverflowError/DoS) in ClassUtils.getClass(...) affecting commons-lang3 >=3.0 and <3.18.0; fixed in 3.18.0. Upgrade to 3.18.0+ (recommended: 3.20.0). [2][3]
Sources
- Apache Commons Lang release notes (3.20.0). [1]
- NVD CVE-2025-48924 entry. [2]
- GitHub Advisory / vendor advisories about CVE-2025-48924 (notes that 3.18.0 contains the fix). [3]
Upgrade commons-lang3 to version 3.20.0 to address critical security vulnerability.
Version 3.17.0 is vulnerable to CVE-2025-48924 (uncontrolled recursion causing DoS in ClassUtils.getClass) affecting all versions < 3.18.0. Upgrade to 3.20.0 (latest stable, released Nov 12, 2025) or at minimum 3.18.0 where the vulnerability is fixed.
🤖 Prompt for AI Agents
In
add_minutes_to_the_specific_date_time_and_store_the_output_in_specific_format/pom.xml
around lines 64 to 68 the project depends on commons-lang3 version 3.17.0 which
is vulnerable; update the <version> from 3.17.0 to 3.20.0 (or at minimum 3.18.0)
for that dependency, run a Maven build (mvn -U clean verify) to refresh and
validate, and update any generated lock/CI config or dependency-management
entries that pin the older version to ensure the new version is used across the
build.
| @Data | ||
| @Action(actionText = "Subtract minute minutes to the input-datetime with input-datetime-format, convert to output-datetime-format format, and store it in a runtime variable variable-name", | ||
| description = "Subtracts specified minutes to a given input datetime, converts the resulting datetime to a specified date-time format, and stores it in a runtime variable", | ||
| applicationType = ApplicationType.WEB, | ||
| useCustomScreenshot = false) |
There was a problem hiding this comment.
Fix grammatical errors in the action text and description.
The annotation contains grammatical errors:
- Line 17: "Subtract minute minutes to" should be "Subtract minutes from"
- Line 18: "Subtracts specified minutes to" should be "Subtracts specified minutes from"
These are user-facing strings that affect clarity and professionalism.
🔎 Proposed fix
-@Action(actionText = "Subtract minute minutes to the input-datetime with input-datetime-format, convert to output-datetime-format format, and store it in a runtime variable variable-name",
- description = "Subtracts specified minutes to a given input datetime, converts the resulting datetime to a specified date-time format, and stores it in a runtime variable",
+@Action(actionText = "Subtract minutes from the input-datetime with input-datetime-format, convert to output-datetime-format format, and store it in a runtime variable variable-name",
+ description = "Subtracts specified minutes from a given input datetime, converts the resulting datetime to a specified date-time format, and stores it in a runtime variable",
applicationType = ApplicationType.WEB,
useCustomScreenshot = false)🤖 Prompt for AI Agents
In
add_minutes_to_the_specific_date_time_and_store_the_output_in_specific_format/src/main/java/com/testsigma/addons/web/SubtractMinutesToDateTime.java
around lines 16 to 20, the actionText and description contain incorrect
prepositions ("to" should be "from") and minor wording issues; update the
actionText to use "Subtract minutes from the input-datetime with
input-datetime-format, convert to output-datetime-format, and store it in a
runtime variable variable-name" and update the description to "Subtracts
specified minutes from a given input datetime, converts the resulting datetime
to a specified date-time format, and stores it in a runtime variable."
| @TestData(reference = "minute") | ||
| private com.testsigma.sdk.TestData minutesToAdd; |
There was a problem hiding this comment.
Rename variable for consistency with subtract operation.
The variable is named minutesToAdd but this class performs subtraction. For clarity and maintainability, rename it to minutesToSubtract.
🔎 Proposed fix
@TestData(reference = "minute")
- private com.testsigma.sdk.TestData minutesToAdd;
+ private com.testsigma.sdk.TestData minutesToSubtract;Note: This will also require updating references at lines 45 and 49.
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In
add_minutes_to_the_specific_date_time_and_store_the_output_in_specific_format/src/main/java/com/testsigma/addons/web/SubtractMinutesToDateTime.java
around lines 29-30, the TestData field is named minutesToAdd but this class
performs subtraction; rename the field to minutesToSubtract and update all
references accordingly (notably at lines 45 and 49) so getters/setters/usages
reflect the new name; ensure imports and serialization annotations (if any)
remain correct and run a build to catch any remaining references.
| setSuccessMessage(String.format("Added %s minutes to %s and stored the output in '%s' format. %s : %s", | ||
| minutes, dateTimeString, outputFormatString, variableNameString, newDateTime)); |
There was a problem hiding this comment.
CRITICAL: Success message incorrectly states "Added" instead of "Subtracted".
The success message says "Added %s minutes" but this class performs subtraction. This will mislead users about what operation was actually performed.
🔎 Proposed fix
- setSuccessMessage(String.format("Added %s minutes to %s and stored the output in '%s' format. %s : %s",
+ setSuccessMessage(String.format("Subtracted %s minutes from %s and stored the output in '%s' format. %s : %s",
minutes, dateTimeString, outputFormatString, variableNameString, newDateTime));📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| setSuccessMessage(String.format("Added %s minutes to %s and stored the output in '%s' format. %s : %s", | |
| minutes, dateTimeString, outputFormatString, variableNameString, newDateTime)); | |
| setSuccessMessage(String.format("Subtracted %s minutes from %s and stored the output in '%s' format. %s : %s", | |
| minutes, dateTimeString, outputFormatString, variableNameString, newDateTime)); |
🤖 Prompt for AI Agents
In
add_minutes_to_the_specific_date_time_and_store_the_output_in_specific_format/src/main/java/com/testsigma/addons/web/SubtractMinutesToDateTime.java
around lines 66 to 67, the success message wrongly says "Added %s minutes" even
though this class subtracts minutes; change the message to "Subtracted %s
minutes" (keep the rest of the format and variables the same) so the
String.format reflects the actual operation performed.
| result = com.testsigma.sdk.Result.FAILED; | ||
| setErrorMessage("Failed to add minutes. Please check the input datetime, input datetime format, and output datetime format."); | ||
| } |
There was a problem hiding this comment.
Update error message to reflect subtract operation.
The error message says "Failed to add minutes" but should say "Failed to subtract minutes" to match the operation.
🔎 Proposed fix
} else {
result = com.testsigma.sdk.Result.FAILED;
- setErrorMessage("Failed to add minutes. Please check the input datetime, input datetime format, and output datetime format.");
+ setErrorMessage("Failed to subtract minutes. Please check the input datetime, input datetime format, and output datetime format.");
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| result = com.testsigma.sdk.Result.FAILED; | |
| setErrorMessage("Failed to add minutes. Please check the input datetime, input datetime format, and output datetime format."); | |
| } | |
| result = com.testsigma.sdk.Result.FAILED; | |
| setErrorMessage("Failed to subtract minutes. Please check the input datetime, input datetime format, and output datetime format."); | |
| } |
🤖 Prompt for AI Agents
In
add_minutes_to_the_specific_date_time_and_store_the_output_in_specific_format/src/main/java/com/testsigma/addons/web/SubtractMinutesToDateTime.java
around lines 69 to 71, the error message incorrectly says "Failed to add
minutes"; change the text to "Failed to subtract minutes. Please check the input
datetime, input datetime format, and output datetime format." so the message
correctly reflects the subtract operation and keep the rest of the error
handling unchanged.
| public String subtractMinutesToDateTime(String dateTimeString, String inputFormatString, String outputFormatString, int minutesToSubtract) { | ||
| try { | ||
| DateTimeFormatter inputFormatter = DateTimeFormatter.ofPattern(inputFormatString); | ||
|
|
||
| //Determine if the input date time is Date or Time | ||
| if (inputFormatString.contains("HH") || inputFormatString.contains("mm") || inputFormatString.contains("ss")) { | ||
| DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern(outputFormatString); | ||
| LocalTime time = LocalTime.parse(dateTimeString, inputFormatter); | ||
| LocalTime newTime = time.minusMinutes(minutesToSubtract); | ||
| logger.info("Successfully added minutes to the input time"); | ||
|
|
||
| return newTime.format(outputFormatter); | ||
|
|
||
| } else { | ||
|
|
||
| DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern(outputFormatString); | ||
| LocalDateTime dateTime = LocalDateTime.parse(dateTimeString, inputFormatter); | ||
|
|
||
| LocalDateTime newDateTime = dateTime.minusMinutes(minutesToSubtract); | ||
| logger.info("Successfully added minutes to the input datetime"); | ||
|
|
||
| return newDateTime.format(outputFormatter); | ||
| } |
There was a problem hiding this comment.
Update log messages to reflect subtract operation.
The log messages at lines 95 and 105 say "Successfully added minutes" but should say "Successfully subtracted minutes" to match the operation being performed.
🔎 Proposed fix
if (inputFormatString.contains("HH") || inputFormatString.contains("mm") || inputFormatString.contains("ss")) {
DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern(outputFormatString);
LocalTime time = LocalTime.parse(dateTimeString, inputFormatter);
LocalTime newTime = time.minusMinutes(minutesToSubtract);
- logger.info("Successfully added minutes to the input time");
+ logger.info("Successfully subtracted minutes from the input time");
return newTime.format(outputFormatter);
} else {
DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern(outputFormatString);
LocalDateTime dateTime = LocalDateTime.parse(dateTimeString, inputFormatter);
LocalDateTime newDateTime = dateTime.minusMinutes(minutesToSubtract);
- logger.info("Successfully added minutes to the input datetime");
+ logger.info("Successfully subtracted minutes from the input datetime");
return newDateTime.format(outputFormatter);
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| public String subtractMinutesToDateTime(String dateTimeString, String inputFormatString, String outputFormatString, int minutesToSubtract) { | |
| try { | |
| DateTimeFormatter inputFormatter = DateTimeFormatter.ofPattern(inputFormatString); | |
| //Determine if the input date time is Date or Time | |
| if (inputFormatString.contains("HH") || inputFormatString.contains("mm") || inputFormatString.contains("ss")) { | |
| DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern(outputFormatString); | |
| LocalTime time = LocalTime.parse(dateTimeString, inputFormatter); | |
| LocalTime newTime = time.minusMinutes(minutesToSubtract); | |
| logger.info("Successfully added minutes to the input time"); | |
| return newTime.format(outputFormatter); | |
| } else { | |
| DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern(outputFormatString); | |
| LocalDateTime dateTime = LocalDateTime.parse(dateTimeString, inputFormatter); | |
| LocalDateTime newDateTime = dateTime.minusMinutes(minutesToSubtract); | |
| logger.info("Successfully added minutes to the input datetime"); | |
| return newDateTime.format(outputFormatter); | |
| } | |
| public String subtractMinutesToDateTime(String dateTimeString, String inputFormatString, String outputFormatString, int minutesToSubtract) { | |
| try { | |
| DateTimeFormatter inputFormatter = DateTimeFormatter.ofPattern(inputFormatString); | |
| //Determine if the input date time is Date or Time | |
| if (inputFormatString.contains("HH") || inputFormatString.contains("mm") || inputFormatString.contains("ss")) { | |
| DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern(outputFormatString); | |
| LocalTime time = LocalTime.parse(dateTimeString, inputFormatter); | |
| LocalTime newTime = time.minusMinutes(minutesToSubtract); | |
| logger.info("Successfully subtracted minutes from the input time"); | |
| return newTime.format(outputFormatter); | |
| } else { | |
| DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern(outputFormatString); | |
| LocalDateTime dateTime = LocalDateTime.parse(dateTimeString, inputFormatter); | |
| LocalDateTime newDateTime = dateTime.minusMinutes(minutesToSubtract); | |
| logger.info("Successfully subtracted minutes from the input datetime"); | |
| return newDateTime.format(outputFormatter); | |
| } |
🤖 Prompt for AI Agents
In
add_minutes_to_the_specific_date_time_and_store_the_output_in_specific_format/src/main/java/com/testsigma/addons/web/SubtractMinutesToDateTime.java
around lines 86 to 108, the logger messages incorrectly state "Successfully
added minutes..." while the method subtracts minutes; update the two log calls
to "Successfully subtracted minutes to the input time" and "Successfully
subtracted minutes to the input datetime" (or similar consistent phrasing) so
the logs reflect the subtract operation.
Publish this addon as public
Addon Name: Add minutes to the specific date time and store the output in specific format
Jarvis Link: https://jarvis.testsigma.com/ui/tenants/2817/addons
Jira : https://testsigma.atlassian.net/browse/CUS-9870
Added class to subtract minutes
Summary by CodeRabbit
New Features
Improvements
Chores
✏️ Tip: You can customize this high-level summary in your review settings.