Skip to content

Commit 25fff95

Browse files
committed
Fixed issues after rebase
1 parent b9cd9cf commit 25fff95

File tree

4 files changed

+41
-431
lines changed

4 files changed

+41
-431
lines changed

application/src/test/java/org/togetherjava/tjbot/commands/reminder/RemindCommandTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.togetherjava.tjbot.commands.reminder;
22

33
import net.dv8tion.jda.api.entities.Member;
4-
import net.dv8tion.jda.api.events.interaction.SlashCommandEvent;
4+
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
55
import org.jetbrains.annotations.NotNull;
66
import org.junit.jupiter.api.Assertions;
77
import org.junit.jupiter.api.BeforeEach;
@@ -35,14 +35,14 @@ void setUp() {
3535
rawReminders = new RawReminderTestHelper(database, jdaTester);
3636
}
3737

38-
private @NotNull SlashCommandEvent triggerSlashCommand(int timeAmount, @NotNull String timeUnit,
39-
@NotNull String content) {
38+
private @NotNull SlashCommandInteractionEvent triggerSlashCommand(int timeAmount,
39+
@NotNull String timeUnit, @NotNull String content) {
4040
return triggerSlashCommand(timeAmount, timeUnit, content, jdaTester.getMemberSpy());
4141
}
4242

43-
private @NotNull SlashCommandEvent triggerSlashCommand(int timeAmount, @NotNull String timeUnit,
44-
@NotNull String content, @NotNull Member author) {
45-
SlashCommandEvent event = jdaTester.createSlashCommandEvent(command)
43+
private @NotNull SlashCommandInteractionEvent triggerSlashCommand(int timeAmount,
44+
@NotNull String timeUnit, @NotNull String content, @NotNull Member author) {
45+
SlashCommandInteractionEvent event = jdaTester.createSlashCommandInteractionEvent(command)
4646
.setOption(RemindCommand.TIME_AMOUNT_OPTION, timeAmount)
4747
.setOption(RemindCommand.TIME_UNIT_OPTION, timeUnit)
4848
.setOption(RemindCommand.CONTENT_OPTION, content)
@@ -70,7 +70,7 @@ void throwsWhenGivenUnsupportedUnit() {
7070
void doesNotSupportDatesTooFarInFuture() {
7171
// GIVEN
7272
// WHEN triggering /remind too far in the future
73-
SlashCommandEvent event = triggerSlashCommand(10, "years", "foo");
73+
SlashCommandInteractionEvent event = triggerSlashCommand(10, "years", "foo");
7474

7575
// THEN rejects and responds accordingly, no reminder was created
7676
verify(event).reply(startsWith("The reminder is set too far in the future"));
@@ -87,7 +87,7 @@ void userIsLimitedIfTooManyPendingReminders() {
8787
}
8888

8989
// WHEN triggering another reminder
90-
SlashCommandEvent event = triggerSlashCommand(5, "minutes", "foo");
90+
SlashCommandInteractionEvent event = triggerSlashCommand(5, "minutes", "foo");
9191

9292
// THEN rejects and responds accordingly, no new reminder was created
9393
verify(event)
@@ -110,7 +110,7 @@ void userIsNotLimitedIfOtherUserHasTooManyPendingReminders() {
110110
Member secondUser = jdaTester.createMemberSpy(2);
111111

112112
// WHEN the second user triggers another reminder
113-
SlashCommandEvent event = triggerSlashCommand(5, "minutes", "foo", secondUser);
113+
SlashCommandInteractionEvent event = triggerSlashCommand(5, "minutes", "foo", secondUser);
114114

115115
// THEN accepts the reminder and responds accordingly
116116
verify(event).reply("Will remind you about 'foo' in 5 minutes.");
@@ -125,7 +125,7 @@ void userIsNotLimitedIfOtherUserHasTooManyPendingReminders() {
125125
void canCreateReminders() {
126126
// GIVEN
127127
// WHEN triggering the /remind command
128-
SlashCommandEvent event = triggerSlashCommand(5, "minutes", "foo");
128+
SlashCommandInteractionEvent event = triggerSlashCommand(5, "minutes", "foo");
129129

130130
// THEN accepts the reminder and responds accordingly
131131
verify(event).reply("Will remind you about 'foo' in 5 minutes.");

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ public JdaTester() {
278278
/**
279279
* Gets the member spy used as universal member by all mocks created by this tester instance.
280280
* <p>
281-
* For example the events created by {@link #createSlashCommandEvent(SlashCommand)} will return
282-
* this spy on several of their methods.
281+
* For example the events created by {@link #createSlashCommandInteractionEvent(SlashCommand)}
282+
* will return this spy on several of their methods.
283283
* <p>
284284
* See {@link #createMemberSpy(long)} to create other members.
285285
*

0 commit comments

Comments
 (0)