简体   繁体   中英

Micronaut Test Resources: How to extend AbstractTestContainersProvider class

Micronaut documentation says:

For test resources which make use of Testcontainers, you may extend the base AbstractTestContainersProvider class.

My question is: how to add this class properly to the classpath of the test resources sourceset (I am using Gradle)

You will need to add the following dependencies to your build.gradle file:

dependencies {
    testResourcesImplementation platform("io.micronaut:micronaut-bom:3.6.1")
    testResourcesImplementation "io.micronaut.testresources:micronaut-test-resources-testcontainers"
}

(note that I'm importing the Micronaut BOM so that you don't have to specify the test resources version, but you could use it directly)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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