From 6bb0192ee02a848df10b41e74b3a4b50cb6cab39 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jan 2024 00:21:08 +0000 Subject: [PATCH 1/2] 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](https://github.com/mockito/mockito/compare/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] --- application/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/build.gradle b/application/build.gradle index 87e2b1b1c4..728b8c56b9 100644 --- a/application/build.gradle +++ b/application/build.gradle @@ -76,7 +76,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' From faf14a31c8fc2bae969a15496cb6b3b28b5b61ab Mon Sep 17 00:00:00 2001 From: Connor Schweighoefer Date: Fri, 16 Feb 2024 00:07:06 +0100 Subject: [PATCH 2/2] Fix tests failing with new version --- .../test/java/org/togetherjava/tjbot/jda/JdaTester.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/application/src/test/java/org/togetherjava/tjbot/jda/JdaTester.java b/application/src/test/java/org/togetherjava/tjbot/jda/JdaTester.java index a634c93165..688b5c3287 100644 --- a/application/src/test/java/org/togetherjava/tjbot/jda/JdaTester.java +++ b/application/src/test/java/org/togetherjava/tjbot/jda/JdaTester.java @@ -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; @@ -245,9 +246,11 @@ public JdaTester() { public SlashCommandInteractionEventBuilder createSlashCommandInteractionEvent( SlashCommand command) { UnaryOperator 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)