@@ -0,0 +1,2810 @@
+package org.telegram.abilitybots.api.bot;%0A%0Aimport org.junit.jupiter.api.AfterEach;%0Aimport org.junit.jupiter.api.BeforeEach;%0Aimport org.junit.jupiter.api.Test;%0Aimport org.telegram.abilitybots.api.db.DBContext;%0Aimport org.telegram.abilitybots.api.objects.Ability;%0Aimport org.telegram.abilitybots.api.sender.SilentSender;%0Aimport org.telegram.telegrambots.meta.api.objects.Update;%0Aimport org.telegram.telegrambots.meta.api.objects.User;%0A%0Aimport java.io.IOException;%0A%0Aimport static org.apache.commons.lang3.StringUtils.EMPTY;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.internal.verification.VerificationModeFactory.times;%0Aimport static org.telegram.abilitybots.api.bot.TestUtils.mockFullUpdate;%0Aimport static org.telegram.abilitybots.api.db.MapDBContext.offlineInstance;%0Aimport static org.telegram.abilitybots.api.objects.Ability.builder;%0Aimport static org.telegram.abilitybots.api.objects.Locality.ALL;%0Aimport static org.telegram.abilitybots.api.objects.Privacy.PUBLIC;%0A%0Apublic class ContinuousTextTest %7B%0A  private static final User USER = new User(1, %22first%22, false, %22last%22, %22username%22, null);%0A%0A  private DBContext db;%0A%0A  private SilentSender silent;%0A  private ContinuousTextBot bot;%0A%0A  @BeforeEach%0A  void setUp() %7B%0A    db = offlineInstance(%22db%22);%0A    bot = new ContinuousTextBot(EMPTY, EMPTY, db);%0A    silent = mock(SilentSender.class);%0A    bot.silent = silent;%0A  %7D%0A%0A  @AfterEach%0A  void tearDown() throws IOException %7B%0A    db.clear();%0A    db.close();%0A  %7D%0A%0A  @Test%0A  void processesContinuousText() %7B%0A    Update update = mockFullUpdate(bot, USER, %22/do2%22);%0A%0A    bot.onUpdateReceived(update);%0A%0A    verify(silent, times(1))%0A        .send(%222%22, USER.getId());%0A  %7D%0A%0A  @Test%0A  void matchesLongestAbilityName() %7B%0A    Update update = mockFullUpdate(bot, USER, %22/do1%22);%0A%0A    bot.onUpdateReceived(update);%0A%0A    verify(silent, times(1))%0A        .send(%22longer ability name%22, USER.getId());%0A  %7D%0A%0A  public static class ContinuousTextBot extends AbilityBot %7B%0A%0A    public ContinuousTextBot(String token, String username, DBContext db) %7B%0A      super(token, username, db);%0A    %7D%0A%0A    @Override%0A    public int creatorId() %7B%0A      return 1337;%0A    %7D%0A%0A    @Override%0A    protected boolean allowContinuousText() %7B%0A      return true;%0A    %7D%0A%0A    public Ability continuousTextAbility() %7B%0A      return builder()%0A          .name(%22do%22)%0A          .privacy(PUBLIC)%0A          .locality(ALL)%0A          .input(0)%0A          .action(ctx -%3E silent.send(ctx.firstArg(), ctx.chatId()))%0A          .build();%0A    %7D%0A%0A    public Ability continuousTextSimilarAbility() %7B%0A      return builder()%0A          .name(%22do1%22)%0A          .privacy(PUBLIC)%0A          .locality(ALL)%0A          .input(0)%0A          .action(ctx -%3E silent.send(%22longer ability name%22, ctx.chatId()))%0A          .build();%0A    %7D%0A  %7D%0A%7D

Add test