Package io.micronaut.testresources.mssql
Class MSSQLTestResourceProvider
java.lang.Object
io.micronaut.testresources.testcontainers.AbstractTestContainersProvider<T>
io.micronaut.testresources.jdbc.AbstractJdbcTestResourceProvider<org.testcontainers.containers.MSSQLServerContainer<?>>
io.micronaut.testresources.mssql.MSSQLTestResourceProvider
- All Implemented Interfaces:
io.micronaut.core.order.Ordered
,TestResourcesResolver
,ToggableTestResourcesResolver
public class MSSQLTestResourceProvider
extends AbstractJdbcTestResourceProvider<org.testcontainers.containers.MSSQLServerContainer<?>>
A test resource provider which will spawn a MS SQL test container.
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Fields inherited from interface io.micronaut.testresources.core.TestResourcesResolver
TEST_RESOURCES_PROPERTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected org.testcontainers.containers.MSSQLServerContainer<?>
createContainer
(org.testcontainers.utility.DockerImageName imageName, Map<String, Object> requestedProperties, Map<String, Object> testResourcesConfig) Creates the test container.static org.testcontainers.containers.MSSQLServerContainer<?>
createMSSQLContainer
(org.testcontainers.utility.DockerImageName imageName, String simpleName, Map<String, Object> testResourcesConfig) protected String
Returns the default image name.Returns a display name for a test resources resolver, used for debugging purposes.protected String
Returns the name of the resource resolver, for example "kafka" or "mysql".static boolean
shouldAcceptLicense
(String licenseKey, Map<String, Object> testResourcesConfig) Methods inherited from class io.micronaut.testresources.jdbc.AbstractJdbcTestResourceProvider
configureContainer, datasourceExpressionOf, datasourceNameFrom, datasourcePropertyFrom, getDbTypes, getRequiredProperties, getRequiredPropertyEntries, getResolvableProperties, isDatasourceExpression, resolveDbSpecificProperty, resolveProperty, shouldAnswer
Methods inherited from class io.micronaut.testresources.testcontainers.AbstractTestContainersProvider
getName, getOrder, resolve, resolveWithoutContainer, stringOrNull
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.testresources.core.TestResourcesResolver
getId
Methods inherited from interface io.micronaut.testresources.core.ToggableTestResourcesResolver
isEnabled
-
Field Details
-
DEFAULT_IMAGE_NAME
- See Also:
-
DISPLAY_NAME
- See Also:
-
-
Constructor Details
-
MSSQLTestResourceProvider
public MSSQLTestResourceProvider()
-
-
Method Details
-
getDisplayName
Description copied from interface:TestResourcesResolver
Returns a display name for a test resources resolver, used for debugging purposes.- Returns:
- the display name
-
getSimpleName
Description copied from class:AbstractTestContainersProvider
Returns the name of the resource resolver, for example "kafka" or "mysql".- Specified by:
getSimpleName
in classAbstractTestContainersProvider<org.testcontainers.containers.MSSQLServerContainer<?>>
- Returns:
- the name of the resolver
-
getDefaultImageName
Description copied from class:AbstractTestContainersProvider
Returns the default image name.- Specified by:
getDefaultImageName
in classAbstractTestContainersProvider<org.testcontainers.containers.MSSQLServerContainer<?>>
- Returns:
- the default image name.
-
createContainer
protected org.testcontainers.containers.MSSQLServerContainer<?> createContainer(org.testcontainers.utility.DockerImageName imageName, Map<String, Object> requestedProperties, Map<String, Object> testResourcesConfig) Description copied from class:AbstractTestContainersProvider
Creates the test container.- Specified by:
createContainer
in classAbstractTestContainersProvider<org.testcontainers.containers.MSSQLServerContainer<?>>
- Parameters:
imageName
- the docker image namerequestedProperties
- the resolved propertiestestResourcesConfig
- the test resources configuration- Returns:
- a container
-
createMSSQLContainer
-
shouldAcceptLicense
public static boolean shouldAcceptLicense(String licenseKey, Map<String, Object> testResourcesConfig) - Parameters:
licenseKey
- License KeytestResourcesConfig
- Test Resources Configuration- Returns:
false
if no value found in Test Resources Configuration for the license key, otherwise it returns the object if it is a boolean, or it parses the value to a boolean usingBoolean.parseBoolean(String)
.
-