Skip to content

Rewrite tests#5

Merged
eggy03 merged 3 commits into
masterfrom
rewrite-tests
Apr 22, 2026
Merged

Rewrite tests#5
eggy03 merged 3 commits into
masterfrom
rewrite-tests

Conversation

@eggy03
Copy link
Copy Markdown
Owner

@eggy03 eggy03 commented Apr 22, 2026

Description

This PR contains a complete overhaul of the service and terminal tests

Type of Change

Tests

  • TerminalUtilityTest has been renamed to TerminalServiceTest and individual test cases have been updated to test the current contract of TerminalService methods
  • Introduce @Mock for TerminalService and DMI[Entity]Mapper to mock dependencies.
  • Use @InjectMocks for DMI[Entity]Service to automatically inject mocked dependencies.
  • Remove static mocking of TerminalUtility and instead mock TerminalService and mappers, and refactor the tests to verify service contract, orders, instead of verifying the output of mapped data.
  • Previously, service tests would only mock TerminalUtility (now TerminalService) and the mapper would not be stubbed. With this overhaul, both mappers and terminal are stubbed and verification is performed based on what got executed instead, and not what was returned, since that is already tested in the mapping layer.

eggy03 added 3 commits April 22, 2026 10:32
- TerminalUtilityTest has been renamed to TerminalServiceTest and individual test cases have been updated to test the current contract of TerminalService methods
- Add `mockito-junit-jupiter` dependency to `pom.xml` for injecting mocks

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Introduce `@Mock` for `TerminalService` and `DMI[Entity]Mapper` to mock dependencies.
- Use `@InjectMocks` for `DMI[Entity]Service` to automatically inject mocked dependencies.
- Remove static mocking of `TerminalUtility` and instead mock `TerminalService` and mappers, and refactor the tests to verify service contract, orders, instead of verifying the output of mapped data.

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
@eggy03 eggy03 merged commit 8a55517 into master Apr 22, 2026
1 check passed
@eggy03 eggy03 deleted the rewrite-tests branch April 22, 2026 17:27
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.

1 participant