Skip to content

Remove beforeEach and afterEach test methods#44

Open
MoonBow-1 wants to merge 3 commits into
teragrep:masterfrom
MoonBow-1:cfe-16-31
Open

Remove beforeEach and afterEach test methods#44
MoonBow-1 wants to merge 3 commits into
teragrep:masterfrom
MoonBow-1:cfe-16-31

Conversation

@MoonBow-1
Copy link
Copy Markdown
Contributor

@MoonBow-1 MoonBow-1 commented Aug 11, 2025

Closes #31

  • Removes the annotated methods from test files
  • Converts Spring Boot tests to normal unit tests

Configuration integration test is the only exception, where a SpringBootTest is testing the autowired values for the configuration

@MoonBow-1 MoonBow-1 self-assigned this Aug 11, 2025
- Removes @beforeeach, @AfterEach etc. annotations from tests
- Initializes the server in each of the test methods
- ConfigurationIT is the only test left which is a SpringBootTest, that checks the Spring Boot autowiring
- Most likely a Thread related problem
- Also fixes acks not being able to be acked due to Futures
- Needs confirming
@MoonBow-1 MoonBow-1 marked this pull request as ready for review May 20, 2026 07:44
@MoonBow-1 MoonBow-1 requested a review from Tiihott May 20, 2026 07:44
Copy link
Copy Markdown

@Tiihott Tiihott left a comment

Choose a reason for hiding this comment

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

Tests pass and beforeEach/afterEach removals look ok, but there is one removed assertion that looks like it should still be used.


assertEquals(expected, configuration.toString());
assertEquals(0, messageList.size());
assertEquals(1, openCount.get());
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why was the closeCount assertion removed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This accidentally deleted, and added back in commit c5a6b25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate possibility of removing JUnit @BeforeEach, @AfterEach etc. annotations

2 participants