elbekD / kt-telegram-bot

Telegram Bot Library for Kotlin language
MIT License
104 stars 19 forks source link

Can't write unit tests for my bot logic #52

Open SonicNorg opened 2 years ago

SonicNorg commented 2 years ago

I'm trying to test my logic. I wanted to make Mockito spy(Bot.createPolling(...)) and then call TelegramBot#onUpdate method to simulate incoming Telegram update, but TelegramBot and all along classes are internal so I can't access their methods even via Reflections. Need to provide any acceptable way for unit testing bots built on this library.