Skip to content

Commit

Permalink
Bump org.mockito:mockito-core from 5.3.1 to 5.10.0 (#1015)
Browse files Browse the repository at this point in the history
* Bump org.mockito:mockito-core from 5.3.1 to 5.10.0

Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.3.1 to 5.10.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v5.3.1...v5.10.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Fix tests failing with new version

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Connor Schweighoefer <[email protected]>
  • Loading branch information
dependabot[bot] and SquidXTV authored Mar 12, 2024
1 parent 206f71c commit a6ac181
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion application/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ dependencies {

implementation 'org.kohsuke:github-api:1.319'

testImplementation 'org.mockito:mockito-core:5.3.1'
testImplementation 'org.mockito:mockito-core:5.10.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.0'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import org.mockito.ArgumentMatcher;
import org.mockito.ArgumentMatchers;
import org.mockito.MockingDetails;
import org.mockito.internal.util.MockUtil;
import org.mockito.stubbing.Answer;

import org.togetherjava.tjbot.features.SlashCommand;
Expand Down Expand Up @@ -247,9 +248,11 @@ public JdaTester() {
public SlashCommandInteractionEventBuilder createSlashCommandInteractionEvent(
SlashCommand command) {
UnaryOperator<SlashCommandInteractionEvent> mockOperator = event -> {
SlashCommandInteractionEvent SlashCommandInteractionEvent = spy(event);
mockInteraction(SlashCommandInteractionEvent);
return SlashCommandInteractionEvent;
if (!MockUtil.isMock(event)) {
event = spy(event);
}
mockInteraction(event);
return event;
};

return new SlashCommandInteractionEventBuilder(jda, mockOperator).setCommand(command)
Expand Down

0 comments on commit a6ac181

Please sign in to comment.