Skip to content

Commit f0cde3b

Browse files
committed
Fix tests
1 parent 75f2c7a commit f0cde3b

File tree

4 files changed

+10
-41
lines changed

4 files changed

+10
-41
lines changed

library/src/main/java/com/pengrad/telegrambot/model/WriteAccessAllowed.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.pengrad.telegrambot.model;
22

33
import java.io.Serializable;
4+
import java.util.Objects;
45

56
public class WriteAccessAllowed implements Serializable {
67
private final static long serialVersionUID = 0L;
@@ -14,11 +15,18 @@ public String webAppName() {
1415
@Override
1516
public boolean equals(Object o) {
1617
if (this == o) return true;
17-
return o != null && getClass() == o.getClass();
18+
if (o == null || getClass() != o.getClass()) return false;
19+
WriteAccessAllowed that = (WriteAccessAllowed) o;
20+
return Objects.equals(web_app_name, that.web_app_name);
1821
}
1922

2023
@Override
2124
public int hashCode() {
22-
return 1;
25+
return Objects.hash(web_app_name);
26+
}
27+
28+
@Override
29+
public String toString() {
30+
return "WriteAccessAllowed{" + "web_app_name='" + web_app_name + '\'' + '}';
2331
}
2432
}

library/src/main/java/com/pengrad/telegrambot/model/request/InlineQueryResultsButton.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,4 @@ public String startParameter() {
3535
return start_parameter;
3636
}
3737

38-
@Override
39-
public int hashCode() {
40-
return Objects.hash(text,
41-
web_app,
42-
start_parameter);
43-
}
44-
45-
@Override
46-
public String toString() {
47-
return "InlineQueryResultsButton{" +
48-
"text='" + text + '\'' +
49-
", web_app=" + web_app +
50-
", start_parameter='" + start_parameter + '\'' +
51-
'}';
52-
}
53-
5438
}

library/src/main/java/com/pengrad/telegrambot/model/request/SwitchInlineQueryChosenChat.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,4 @@ public SwitchInlineQueryChosenChat allowChannelChats(Boolean allowChannelChats)
3636
this.allow_channel_chats = allowChannelChats;
3737
return this;
3838
}
39-
40-
@Override
41-
public int hashCode() {
42-
return Objects.hash(query,
43-
allow_user_chats,
44-
allow_bot_chats,
45-
allow_group_chats,
46-
allow_channel_chats
47-
);
48-
}
49-
50-
@Override
51-
public String toString() {
52-
return "SwitchInlineQueryChosenChat{" +
53-
"query='" + query + '\'' +
54-
", allow_user_chats=" + allow_user_chats +
55-
", allow_bot_chats=" + allow_bot_chats +
56-
", allow_group_chats=" + allow_group_chats +
57-
", allow_channel_chats='" + allow_channel_chats + '\'' +
58-
'}';
59-
}
60-
6139
}

library/src/test/java/com/pengrad/telegrambot/ModelTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ public void testEquals() throws ReflectiveOperationException {
8585
verifierApi.withIgnoredFields("forum_topic_reopened");
8686
verifierApi.withIgnoredFields("general_forum_topic_hidden");
8787
verifierApi.withIgnoredFields("general_forum_topic_unhidden");
88-
verifierApi.withIgnoredFields("write_access_allowed");
8988
}
9089

9190
verifierApi.verify();

0 commit comments

Comments
 (0)