-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#139 Add fake telegram bot for testing
- Loading branch information
Showing
3 changed files
with
27 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
spring: | ||
profiles: | ||
active: production | ||
application: | ||
name: botalka | ||
datasource: | ||
|
22 changes: 22 additions & 0 deletions
22
...lka/src/test/kotlin/ru/vityaman/lms/botalka/app/spring/client/telegram/FakeTelegramBot.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package ru.vityaman.lms.botalka.app.spring.client.telegram | ||
|
||
import org.slf4j.LoggerFactory | ||
import org.springframework.context.annotation.Primary | ||
import org.springframework.stereotype.Service | ||
import ru.vityaman.lms.botalka.core.external.telegram.TelegramBot | ||
import ru.vityaman.lms.botalka.core.external.telegram.TelegramChat | ||
import ru.vityaman.lms.botalka.core.external.telegram.TelegramMessage | ||
|
||
@Primary | ||
@Service | ||
class FakeTelegramBot : TelegramBot { | ||
private val log = LoggerFactory.getLogger("FakeTelegramBot") | ||
|
||
override suspend fun send(chat: TelegramChat, message: TelegramMessage) { | ||
log.debug("Received a {} from {}", message, chat) | ||
} | ||
|
||
override suspend fun start() { | ||
log.debug("Started") | ||
} | ||
} |