/
githubmirror
/
ydb-java-dialects
Обзор
Документация
Войти
/
githubmirror
/
ydb-java-dialects
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
spring-ydb-retry/src/test/java/tech/ydb/retry/integration/YdbDockerTest.java
41 строка
2 KB
Kirill Kurdyukov
dev: move module up level (#225)
09 июн 2026, 14:09
Не верифицирован
09 июн 2026, 14:09
1e41593
Код
Авторство
О чём код?
package tech.ydb.retry.integration; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; import org.springframework.test.context.DynamicPropertyRegistry; import org.springframework.test.context.DynamicPropertySource; import tech.ydb.test.junit5.YdbHelperExtension; /** * Integration tests use a single YDB environment and a deterministic error channel state, so they * must be performed sequentially one after the other. */ @YdbIntegrationTest @Execution(ExecutionMode.SAME_THREAD) public abstract class YdbDockerTest { public static final String INTEGRATION_TEST_LOCK = "ydb-integration-tests"; @RegisterExtension static final YdbHelperExtension ydb = new YdbHelperExtension(); @BeforeAll static void resetErrorChannel() { DeterministicErrorChannel.configure(); } @DynamicPropertySource static void propertySource(DynamicPropertyRegistry registry) { registry.add( "spring.datasource.url", () -> "jdbc:ydb:" + (ydb.useTls() ? "grpcs://" : "grpc://") + ydb.endpoint() + ydb.database() + "?channelInitializer=tech.ydb.retry.integration.DeterministicErrorChannel&" + (ydb.authToken() != null ? "token=" + ydb.authToken() : "")); } }