-
-
Notifications
You must be signed in to change notification settings - Fork 734
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
ScheduledEvent::getJumpUrl
(#2736)
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/test/java/net/dv8tion/jda/test/entities/scheduledevent/ScheduledEventTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package net.dv8tion.jda.test.entities.scheduledevent; | ||
|
||
import net.dv8tion.jda.api.entities.Guild; | ||
import net.dv8tion.jda.api.entities.ScheduledEvent; | ||
import net.dv8tion.jda.internal.JDAImpl; | ||
import net.dv8tion.jda.internal.entities.GuildImpl; | ||
import net.dv8tion.jda.internal.entities.ScheduledEventImpl; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class ScheduledEventTest{ | ||
|
||
@Test | ||
void testGetJumpUrl(){ | ||
|
||
long guildId = 7777777; | ||
long eventId = 333; | ||
|
||
String expected = "https://discord.com/events/" + guildId + "/" + eventId; | ||
|
||
Guild guild = new GuildImpl(new JDAImpl(null), guildId); | ||
|
||
ScheduledEvent scheduledEvent = new ScheduledEventImpl(eventId, guild); | ||
|
||
Assertions.assertEquals(expected, scheduledEvent.getJumpUrl()); | ||
|
||
} | ||
|
||
} |