Skip to content

Commit b2cd16d

Browse files
dependabot[bot]SquidXTV
authored andcommitted
Bump org.mockito:mockito-core from 5.3.1 to 5.10.0 (#1015)
* 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] <support@github.com> * Fix tests failing with new version --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Connor Schweighoefer <squidxtv@gmail.com>
1 parent 41ec947 commit b2cd16d

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

application/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ dependencies {
7777

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

80-
testImplementation 'org.mockito:mockito-core:5.3.1'
80+
testImplementation 'org.mockito:mockito-core:5.10.0'
8181
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
8282
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.0'
8383
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

application/src/test/java/org/togetherjava/tjbot/jda/JdaTester.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import org.mockito.ArgumentMatcher;
4343
import org.mockito.ArgumentMatchers;
4444
import org.mockito.MockingDetails;
45+
import org.mockito.internal.util.MockUtil;
4546
import org.mockito.stubbing.Answer;
4647

4748
import org.togetherjava.tjbot.features.SlashCommand;
@@ -248,9 +249,11 @@ public JdaTester() {
248249
public SlashCommandInteractionEventBuilder createSlashCommandInteractionEvent(
249250
SlashCommand command) {
250251
UnaryOperator<SlashCommandInteractionEvent> mockOperator = event -> {
251-
SlashCommandInteractionEvent SlashCommandInteractionEvent = spy(event);
252-
mockInteraction(SlashCommandInteractionEvent);
253-
return SlashCommandInteractionEvent;
252+
if (!MockUtil.isMock(event)) {
253+
event = spy(event);
254+
}
255+
mockInteraction(event);
256+
return event;
254257
};
255258

256259
return new SlashCommandInteractionEventBuilder(jda, mockOperator).setCommand(command)

0 commit comments

Comments
 (0)