diff --git a/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/objects/EndUser.java b/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/objects/EndUser.java index 0c123434..0ea7919d 100644 --- a/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/objects/EndUser.java +++ b/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/objects/EndUser.java @@ -1,7 +1,6 @@ package org.telegram.abilitybots.api.objects; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.MoreObjects; import com.google.common.base.Strings; @@ -30,7 +29,7 @@ public final class EndUser implements Serializable { private final String lastName; @JsonProperty("username") private final String username; - @JsonIgnore + @JsonProperty("locale") private Locale locale; private EndUser(Integer id, String firstName, String lastName, String username, Locale locale) { @@ -45,8 +44,9 @@ public final class EndUser implements Serializable { public static EndUser endUser(@JsonProperty("id") Integer id, @JsonProperty("firstName") String firstName, @JsonProperty("lastName") String lastName, - @JsonProperty("username") String username) { - return new EndUser(id, firstName, lastName, username, null); + @JsonProperty("username") String username, + @JsonProperty("locale") Locale locale) { + return new EndUser(id, firstName, lastName, username, locale); } /** diff --git a/telegrambots-abilities/src/test/java/org/telegram/abilitybots/api/bot/AbilityBotTest.java b/telegrambots-abilities/src/test/java/org/telegram/abilitybots/api/bot/AbilityBotTest.java index ebcd4c54..689f1486 100644 --- a/telegrambots-abilities/src/test/java/org/telegram/abilitybots/api/bot/AbilityBotTest.java +++ b/telegrambots-abilities/src/test/java/org/telegram/abilitybots/api/bot/AbilityBotTest.java @@ -53,8 +53,8 @@ public class AbilityBotTest { private static final long GROUP_ID = 10L; private static final String TEST = "test"; private static final String[] TEXT = {TEST}; - public static final EndUser MUSER = endUser(1, "first", "last", "username"); - public static final EndUser CREATOR = endUser(1337, "creatorFirst", "creatorLast", "creatorUsername"); + public static final EndUser MUSER = endUser(1, "first", "last", "username", null); + public static final EndUser CREATOR = endUser(1337, "creatorFirst", "creatorLast", "creatorUsername", null); private DefaultBot bot; private DBContext db; @@ -293,7 +293,7 @@ public class AbilityBotTest { String newFirstName = MUSER.firstName() + "-test"; String newLastName = MUSER.lastName() + "-test"; int sameId = MUSER.id(); - EndUser changedUser = endUser(sameId, newFirstName, newLastName, newUsername); + EndUser changedUser = endUser(sameId, newFirstName, newLastName, newUsername, null); mockAlternateUser(update, message, user, changedUser);