Class TestResourcesClasspath
java.lang.Object
io.micronaut.testresources.buildtools.TestResourcesClasspath
- All Implemented Interfaces:
KnownModules
Utility class which deduces the server classpath from the user classpath.
For example, the application may use Micronaut Data + Mysql, in which
case we need to put on the test resources classpath the Micronaut
test resources modules for JDBC and the MySQL driver.
-
Field Summary
Fields inherited from interface io.micronaut.testresources.buildtools.KnownModules
BOM, CLIENT, CONTROL_PANEL, CORE, ELASTICSEARCH, EMBEDDED, EXTENSIONS_CORE, EXTENSIONS_JUNIT_PLATFORM, HASHICORP_CONSUL, HASHICORP_VAULT, HIBERNATE_REACTIVE_CORE, HIBERNATE_REACTIVE_MARIADB, HIBERNATE_REACTIVE_MSSQL, HIBERNATE_REACTIVE_MYSQL, HIBERNATE_REACTIVE_ORACLE_FREE, HIBERNATE_REACTIVE_ORACLE_XE, HIBERNATE_REACTIVE_POSTGRESQL, HIVEMQ, JDBC_CORE, JDBC_MARIADB, JDBC_MSSQL, JDBC_MYSQL, JDBC_ORACLE_FREE, JDBC_ORACLE_XE, JDBC_POSTGRESQL, KAFKA, LOCALSTACK_CORE, LOCALSTACK_DYNAMODB, LOCALSTACK_S3, LOCALSTACK_SNS, LOCALSTACK_SQS, MONGODB, NEO4J, OPENSEARCH, R2DBC_CORE, R2DBC_MARIADB, R2DBC_MSSQL, R2DBC_MYSQL, R2DBC_ORACLE_FREE, R2DBC_ORACLE_XE, R2DBC_POOL, R2DBC_POSTGRESQL, RABBITMQ, REDIS, SERVER, TESTCONTAINERS
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<MavenDependency>
Determines a list of dependencies which should be added to the test resources classpath, given a user supplied classpath.static List<MavenDependency>
inferTestResourcesClasspath
(List<MavenDependency> input, String testResourcesVersion) Determines a list of dependencies which should be added to the test resources classpath, given a user supplied classpath.static boolean
Tells if a dependency should be added to the server classpath.
-
Method Details
-
inferTestResourcesClasspath
Determines a list of dependencies which should be added to the test resources classpath, given a user supplied classpath. In general the result will consist of modules from the test-resources project, but it may consist of additional entries, for example database drivers.- Parameters:
input
- the user classpath- Returns:
- the inferred test resources classpath
-
inferTestResourcesClasspath
public static List<MavenDependency> inferTestResourcesClasspath(List<MavenDependency> input, String testResourcesVersion) Determines a list of dependencies which should be added to the test resources classpath, given a user supplied classpath. In general the result will consist of modules from the test-resources project, but it may consist of additional entries, for example database drivers.- Parameters:
input
- the user classpathtestResourcesVersion
- the version of the test resources libraries- Returns:
- the inferred test resources classpath
-
isDependencyAllowedOnServerClasspath
Tells if a dependency should be added to the server classpath. This is used to avoid dependency conflicts between what is embedded in the server and what additional modules can bring.- Returns:
- the filtered dependencies
-