File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
src/test/java/org/togetherjava/tjbot/jda Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff 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'
Original file line number Diff line number Diff line change 4545import org .mockito .ArgumentMatcher ;
4646import org .mockito .ArgumentMatchers ;
4747import org .mockito .MockingDetails ;
48+ import org .mockito .internal .util .MockUtil ;
4849import org .mockito .stubbing .Answer ;
4950
5051import 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 )
You can’t perform that action at this time.
0 commit comments