cost 64 ms
Spring启动时使用Kafka Testcontainer如何动态覆盖Bootstrap服务器的配置? - How Do I Override the Bootstrap Servers' Configuration Dynamically when Using Kafka Testcontainers in Spring Boot?

我正在使用 Kafka Testcontainers 进行集成测试。 容器启动,并读取在 application.yml 中设置的引导服务器配置。 由于 Testcontainers 端口是动态创建的,我使用kafkaContainer.getBootstrapServers()来获取由测试容器创 ...

如何将属性动态加载到应用程序测试容器? - How to load properties dynamically to application testcontainer?

我正在尝试对使用 jdbc postgres 连接的 Java 应用程序进行集成测试。 在集成测试中,我生成了两个测试容器,一个是应用程序容器,另一个是 postgres 容器。 我如何在应用程序中注入postgresDB.getJdbcUrl() ? 目前我有一个应用程序用于 jdbc 连接的d ...

集成正在编写测试时,我无法使用测试容器连接到 kafka - I cannot connect to kafka using a test container while the integration is writing a test

使用测试容器; 我正在尝试使用 kafka、postgreSql 和 elasticsearch 为我的项目编写集成测试,但是当我运行docker-compose_v2.yml文件并运行我的测试时,我的测试成功了,但是当我使用 testcontainer 时, 我的测试失败了,测试运行时我无法连接 ...

TestContainers - 创建 GenericContainer 并获取 uri/path - TestContainers - create GenericContainer and get the uri/path

我正在尝试使用TestContainers创建隔离的测试环境(用于数据库 - postgresql 和外部服务 - 例如授权服务)。 我的问题是,如何在application.yml / application.properties中设置这些外部服务的路径? 使用 db 很简单,我只需要使用"jd ...

TestContainer 不重用现有容器,而是创建新容器 - TestContainer doesn't reuse existing containers and creates new one instead

我正在使用测试容器 withReuse function in Groovy 在构建之间重用容器。 测试运行后,容器不再被删除。 但是,当我再次运行测试时,它不会重复使用现有的测试,而是创建一个重复的容器。 我希望它重用它在上次运行期间创建的容器。 这是我的GROOVY脚本中的代码。 我还在 my. ...

KafkaListener 未在 Spring 启动测试中触发 - KafkaListener Not triggered in Spring Boot test

我有一个 spring 启动测试来检查 kafka 消费者是否在特定主题中侦听消息。 使用@SpringBootTest时会触发 kafka 侦听器。 但我只是不想加载所有类,我只提供了像@SpringBootTest(classes={KafkaConsumerTest.class})这样的监听器 ...

如何使用 TestContainers 将文件从容器复制到另一个容器? - How to copy a file from a container to another container using TestContainers?

我使用 TestContainers 进行集成测试。 目前,我在启动测试容器时使用withCopyFileToContainer(MountableFile.forClassPathResource(...))将一些文件从主机复制到测试容器(因此测试所在的服务打包在一个jar中并在本地运行host ...

InternalServerErrorException:状态 500:不是带有 localstack 的目录 - InternalServerErrorException: Status 500: not a directory with localstack

我正在尝试运行一个 localstack 容器,作为 Spring Boot 测试中测试的一部分。 我使用initializr设置了一个新的spring boot应用程序,但是我不明白为什么在调用start时出现以下错误: @ActiveProfiles("it") @SpringBootTes ...

如何在 custom.network 中将 JUnit 5 与测试容器一起使用? - How do I use JUnit 5 with testcontainers in a custom network?

我似乎无法让以下场景正常工作。 我正在尝试创建一个场景,其中两个容器使用 JUnit 5 构造在 separate.network 上相互交谈。 我知道我可以使用@BeforeAll 和@AfterAll 自己简单地管理生命周期,但我正在寻找一种方法让它与现有注释一起工作。 ...

测试容器:在测试容器内构建 docker 图像 - Testcontainers: build docker image inside testcontainer

我正在使用testcontainers为我的 CI/CD 服务创建一些测试。 其中一项测试包含在测试容器内构建的 docker 个图像。 它失败,因为它无法访问 docker 守护进程。 问题是如何共享本地 docker 守护进程到 testcontainer 或者如何以最简单的方式在 testco ...

在 Spring 引导测试中注入 CassandraRepository 的实现 - Inject implementation of CassandraRepository in Spring Boot test

我在我的 webflux 应用程序中使用 Spring Boot 和 Spring Data Cassandra。 当我使用 testcontainer 对 docker 进行集成测试时遇到问题,Spring 不会在我的测试中注入我的 cassandra 存储库的实现,但它总是注入 Mockito ...

将我的 Oraclecontainer 连接到外部数据库(不是本地主机)以进行集成测试 Java/Springboot - Connect my Oraclecontainer to an external database (not localhost) for integration tests Java/ Springboot

我想通过使用testcontainers更改我的集成测试(使用 oracle 19c 数据库)。 所以在本地安装 docker 并运行 Docker 桌面。 在我使用图像 gvenzl/oracle-xe:18.4.0-slim 并在本地运行它之后。 在我的代码(java & spring ...

Springboot 无法使用 Jenkins CI/CD 管道上的测试容器连接到 postgresql - Springboot cannot connect to postgresql using testcontainers on Jenkins CI/CD pipeline

我正在使用内部使用 Hikari 连接池的 springboot。 我正在使用 testcontainers 运行我的数据库集成测试,并且在本地机器上运行良好。 但是当我在 Jenkins CI/CD 管道上运行相同的测试时,它失败并出现错误。 以下是详细信息。 pom.xml 测试容器初始化 ...

测试容器:在 PATH 上找不到 docker-machine 可执行文件 - Testcontainers: docker-machine executable was not found on PATH

我有两个 spring 引导项目,它们都具有相同的 JDK 并在同一台机器 (apple m1) 上运行。 第一个项目只是一个虚拟项目,其中只有 testcontainer 依赖项。 虽然第二个项目是一个遗留项目,我应该在其中集成 testcontainer。 但是当 testcontainer 在 ...


 
粤ICP备18138465号  © 2020-2025 STACKOOM.COM