Skip to content

Commit a6ac181

Browse files
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] <[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]>
1 parent 206f71c commit a6ac181

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
@@ -45,6 +45,7 @@
4545
import org.mockito.ArgumentMatcher;
4646
import org.mockito.ArgumentMatchers;
4747
import org.mockito.MockingDetails;
48+
import org.mockito.internal.util.MockUtil;
4849
import org.mockito.stubbing.Answer;
4950

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

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

0 commit comments

Comments
 (0)