File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
application/src/test/java/org/togetherjava/tjbot Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 88import org .junit .jupiter .api .DisplayName ;
99import org .junit .jupiter .api .Test ;
1010import org .mockito .ArgumentCaptor ;
11+ import org .mockito .ArgumentMatchers ;
1112import org .togetherjava .tjbot .commands .Routine ;
1213import org .togetherjava .tjbot .db .Database ;
1314import org .togetherjava .tjbot .jda .JdaTester ;
@@ -65,10 +66,12 @@ private void triggerRoutine() {
6566 }
6667
6768 private @ NotNull TextChannel createAndSetupUnknownChannel () {
68- int unknownChannelId = 2 ;
69+ long unknownChannelId = 2 ;
6970
7071 TextChannel channel = jdaTester .createTextChannelSpy (unknownChannelId );
71- when (jdaTester .getJdaMock ().getTextChannelById (unknownChannelId )).thenReturn (null );
72+ when (jdaTester .getJdaMock ()
73+ .getChannelById (ArgumentMatchers .<Class <MessageChannel >>any (), eq (unknownChannelId )))
74+ .thenReturn (null );
7275
7376 return channel ;
7477 }
Original file line number Diff line number Diff line change @@ -133,6 +133,8 @@ public JdaTester() {
133133 doReturn (selfUser ).when (jda ).getSelfUser ();
134134 when (jda .getGuildChannelById (anyLong ())).thenReturn (textChannel );
135135 when (jda .getTextChannelById (anyLong ())).thenReturn (textChannel );
136+ when (jda .getChannelById (ArgumentMatchers .<Class <MessageChannel >>any (), anyLong ()))
137+ .thenReturn (textChannel );
136138 when (jda .getPrivateChannelById (anyLong ())).thenReturn (privateChannel );
137139 when (jda .getGuildById (anyLong ())).thenReturn (guild );
138140 when (jda .getEntityBuilder ()).thenReturn (entityBuilder );
You can’t perform that action at this time.
0 commit comments