Skip to content

Commit

Permalink
Fix ChatTests
Browse files Browse the repository at this point in the history
  • Loading branch information
mircoianese committed May 28, 2024
1 parent e958d4e commit 7686687
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ public void answerCallback() {

@Test
public void getChat() throws MalformedURLException, URISyntaxException {
Chat chat = bot.execute(new GetChat(groupId)).chat();
ChatFullInfo chat = bot.execute(new GetChat(groupId)).chat();
ChatTest.checkChat(chat, true);
assertEquals(Chat.Type.supergroup, chat.type());
assertTrue(chat.title().contains("Test Bot Group"));
Expand Down Expand Up @@ -1296,7 +1296,7 @@ public void setChatPermissions() {
.useIndependentChatPermissions(false));
assertTrue(response.isOk());

Chat chat = bot.execute(new GetChat(groupId)).chat();
ChatFullInfo chat = bot.execute(new GetChat(groupId)).chat();
ChatPermissions permissions = chat.permissions();
if (bool) {
assertTrue(permissions.canSendMessages());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.pengrad.telegrambot.checks;

import com.pengrad.telegrambot.model.Chat;
import com.pengrad.telegrambot.model.ChatFullInfo;

import static org.junit.Assert.assertNotNull;

Expand All @@ -10,11 +10,11 @@
*/
public class ChatTest {

public static void checkChat(Chat chat) {
public static void checkChat(ChatFullInfo chat) {
checkChat(chat, chat.photo() != null);
}

public static void checkChat(Chat chat, boolean photo) {
public static void checkChat(ChatFullInfo chat, boolean photo) {
assertNotNull(chat.id());
assertNotNull(chat.type());
if (photo) ChatPhotoTest.check(chat.photo());
Expand Down

0 comments on commit 7686687

Please sign in to comment.