Skip to content

Strengthen Title assertions in CheckPhaseTest with ArgumentCaptor#487

Merged
tastybento merged 3 commits intodevelopfrom
copilot/sub-pr-484
Apr 7, 2026
Merged

Strengthen Title assertions in CheckPhaseTest with ArgumentCaptor#487
tastybento merged 3 commits intodevelopfrom
copilot/sub-pr-484

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

The showTitle() calls in CheckPhaseTest were only verified for invocation (any(Title.class)), not for content — meaning a wrong phase name or empty title would pass undetected.

Changes

  • All 4 setNewPhase tests: Replace verify(mockPlayer).showTitle(any(Title.class)) with an ArgumentCaptor<Title> capture + assertion on the title component:
ArgumentCaptor<Title> titleCaptor = ArgumentCaptor.forClass(Title.class);
verify(mockPlayer).showTitle(titleCaptor.capture());
assertEquals(Component.text("Next Phase"), titleCaptor.getValue().title());
  • Imports: Added org.mockito.ArgumentCaptor and net.kyori.adventure.text.Component.

Copilot AI changed the title [WIP] Update version to 1.23.0 Strengthen Title assertions in CheckPhaseTest with ArgumentCaptor Apr 7, 2026
Copilot AI requested a review from tastybento April 7, 2026 10:16
@tastybento tastybento marked this pull request as ready for review April 7, 2026 17:00
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 7, 2026

@tastybento tastybento merged commit ee60d7c into develop Apr 7, 2026
3 checks passed
@tastybento tastybento deleted the copilot/sub-pr-484 branch April 7, 2026 17:02
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.

2 participants