Skip to content

Conversation

tnleeuw
Copy link
Contributor

@tnleeuw tnleeuw commented May 14, 2025

Scenario step numbers can now skip steps, so you can comment out a single step without having to renumber all following steps.

Step numbers can also start with a '0' to align step numbers nicely in the file.

@tnleeuw tnleeuw self-assigned this May 14, 2025
@tnleeuw tnleeuw added the Larva label May 14, 2025
@philipsens philipsens requested a review from Copilot May 14, 2025 14:23
Copy link
Contributor

@Copilot 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

A PR to allow scenario steps to be more flexible by supporting skipped step numbers and steps starting with a '0'. Key changes include:

  • Updating tests in ScenarioTest.java to expect an increased number of steps.
  • Refactoring Scenario.java#getSteps to filter, sort, and validate steps using a regex-based approach and a custom StepSorter.

Reviewed Changes

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

File Description
larva/src/test/java/org/frankframework/larva/ScenarioTest.java Updated test assertions to reflect flexible step numbering and support for a '0'-prefixed step.
larva/src/main/java/org/frankframework/larva/Scenario.java Refactored step filtering, sorting, and duplicate validation with regex matching and a custom comparator.

public int compare(String o1, String o2) {
int step1Nr = getStepNr(o1);
int step2Nr = getStepNr(o2);
return step1Nr - step2Nr;
Copy link
Preview

Copilot AI May 14, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider using Integer.compare(step1Nr, step2Nr) instead of subtraction for clarity and to avoid potential integer overflow in edge cases.

Suggested change
return step1Nr - step2Nr;
return Integer.compare(step1Nr, step2Nr);

Copilot uses AI. Check for mistakes.

@philipsens
Copy link
Member

Nice, this will make it a lot easier to write and test Larva scenarios!

@github-project-automation github-project-automation bot moved this to In Progress in Frank!Framework May 14, 2025
@philipsens philipsens moved this from In Progress to Review in Frank!Framework May 14, 2025
Copy link

@nielsm5 nielsm5 merged commit f97b41a into master May 15, 2025
28 checks passed
@nielsm5 nielsm5 deleted the larva/ImprovedReadingOfSteps branch May 15, 2025 12:38
@github-project-automation github-project-automation bot moved this from Review to Done in Frank!Framework May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants