Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@
<version>${testcontainers.annotations.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package dev.vality.alerting.tg.bot;

import dev.vality.alerting.tg.bot.config.PostgresqlSpringBootITest;
import dev.vality.alerting.tg.bot.dao.ProviderTerminalThreadDao;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ActiveProfiles;

import static org.assertj.core.api.AssertionsForClassTypes.assertThat;

@PostgresqlSpringBootITest
@ActiveProfiles("test")
public class ApplicationContextTest {

@Autowired
private ApplicationContext applicationContext;

@Test
void startApplicationContextTest() {
assertThat(applicationContext).isNotNull();

assertThat(applicationContext.getBean(ProviderTerminalThreadDao.class)).isNotNull();
}
}
63 changes: 63 additions & 0 deletions src/test/resources/application-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
server:
port: 0
management:
server:
port: 0
metrics:
tags:
application: alerting-tg-bot-test
export:
prometheus:
enabled: true
endpoint:
health:
show-details: always
metrics:
enabled: true
prometheus:
enabled: true
endpoints:
web:
exposure:
include: health,info,prometheus

spring:
application:
name: alerting-tg-bot-test
output:
ansi:
enabled: always
main:
allow-bean-definition-overriding: true
cloud:
vault:
enabled: false
kv:
enabled: false
flyway:
enabled: true
create-schemas: true
schemas: alert_tg_bot
jooq:
sql-dialect: POSTGRES

spring.autoconfigure.exclude: org.telegram.telegrambots.longpolling.starter.TelegramBotStarterConfiguration

info:
version: test
stage: test

bot:
token: TEST_TOKEN_123456:AAAAAA
name: vality_alerting_bot
chatId: -11111111
threads:
commands: 1
errors5xx: 2
altpay-conversion: 3
failed-machines: 4
pending-payments: 5

alertmanager:
webhook:
url: http://localhost:8082/alertmanager/webhook
Loading