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 {
77
77
78
78
implementation ' org.kohsuke:github-api:1.319'
79
79
80
- testImplementation ' org.mockito:mockito-core:5.3.1 '
80
+ testImplementation ' org.mockito:mockito-core:5.10.0 '
81
81
testImplementation ' org.junit.jupiter:junit-jupiter-api:5.10.0'
82
82
testImplementation ' org.junit.jupiter:junit-jupiter-params:5.10.0'
83
83
testRuntimeOnly ' org.junit.platform:junit-platform-launcher'
Original file line number Diff line number Diff line change 45
45
import org .mockito .ArgumentMatcher ;
46
46
import org .mockito .ArgumentMatchers ;
47
47
import org .mockito .MockingDetails ;
48
+ import org .mockito .internal .util .MockUtil ;
48
49
import org .mockito .stubbing .Answer ;
49
50
50
51
import org .togetherjava .tjbot .features .SlashCommand ;
@@ -247,9 +248,11 @@ public JdaTester() {
247
248
public SlashCommandInteractionEventBuilder createSlashCommandInteractionEvent (
248
249
SlashCommand command ) {
249
250
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 ;
253
256
};
254
257
255
258
return new SlashCommandInteractionEventBuilder (jda , mockOperator ).setCommand (command )
You can’t perform that action at this time.
0 commit comments