Add testing telegram for java and tests in kotlin
This commit is contained in:
parent
28b4988e6f
commit
31d68fbdbb
@ -24,6 +24,7 @@ class TelegramProvider : MessageProvider, Loggable {
|
|||||||
this._chatId = chatId
|
this._chatId = chatId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JvmOverloads
|
||||||
fun setMessage(message: String, parseMode: TelegramParseMode? = null) = apply {
|
fun setMessage(message: String, parseMode: TelegramParseMode? = null) = apply {
|
||||||
this._message = object : TelegramMessage {
|
this._message = object : TelegramMessage {
|
||||||
override fun getText(): String {
|
override fun getText(): String {
|
||||||
|
@ -47,4 +47,14 @@ public final class TelegramExampleJavaTests {
|
|||||||
token
|
token
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void sendMessageViaBuilder() {
|
||||||
|
String text = "Hello, Sambo with Provider!";
|
||||||
|
TelegramProvider
|
||||||
|
.init("")
|
||||||
|
.sendToChatId("")
|
||||||
|
.setMessage(text)
|
||||||
|
.send();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,4 +77,14 @@ class TelegramExampleKotlinTests {
|
|||||||
.sendToChatId(chatId)
|
.sendToChatId(chatId)
|
||||||
.send()
|
.send()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun sendTextViaBuilder() {
|
||||||
|
val text = "*Hello World* from Provider with MARKDOWN parse mode!"
|
||||||
|
TelegramProvider
|
||||||
|
.init("")
|
||||||
|
.sendToChatId("")
|
||||||
|
.setMessage(text)
|
||||||
|
.send()
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user