Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of ProcessContextGitMock.outputMessages #944

Open
hohwille opened this issue Jan 16, 2025 · 0 comments
Open

Improve handling of ProcessContextGitMock.outputMessages #944

hohwille opened this issue Jan 16, 2025 · 0 comments
Labels
enhancement New feature or request test related to testing and QA

Comments

@hohwille
Copy link
Member

ProcessContextGitMock has an internal state from which it builds the ProcessResult.
Tests can add outputMessages to it that are accumulated.
The problem is that sub-sequent invocations with this approach lead to strange effects because the second invocation will additionally get output messages from the first invocation.

Therefore we should do the following:

  • When we create the ProcessResult we create a new List from outputMessages as a copy
  • At the end of the run method before we return the ProcessResult we do this.outputMessages.clear() to rest the state and avoid such ugly side-effects.
@hohwille hohwille added enhancement New feature or request test related to testing and QA labels Jan 16, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request test related to testing and QA
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant