public class GenericTestContainerProvider extends java.lang.Object implements TestResourcesResolver
smtp.port
, then it is
possible to expose a test container which will resolve that property using
the following configuration:
test-resources: containers: fakesmtp: image-name: ghusta/fakesmtp:2.0 hostnames: - smtp.host exposed-ports: - smtp.port: 25The mapped port from test containers will then be automatically be assigned to the
smtp.port
property, and the host name of the running
test container will automatically be assigned to the smtp.host
property.TEST_RESOURCES_PROPERTY
Constructor and Description |
---|
GenericTestContainerProvider() |
Modifier and Type | Method and Description |
---|---|
int |
getOrder() |
java.util.List<java.lang.String> |
getResolvableProperties(java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> propertyEntries,
java.util.Map<java.lang.String,java.lang.Object> testResourcesConfig)
Returns the list of properties that this resolver
is able to support.
|
java.util.Optional<java.lang.String> |
resolve(java.lang.String propertyName,
java.util.Map<java.lang.String,java.lang.Object> properties,
java.util.Map<java.lang.String,java.lang.Object> testResourcesConfiguration)
Resolves the given property.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRequiredProperties, getRequiredPropertyEntries
public int getOrder()
getOrder
in interface io.micronaut.core.order.Ordered
public java.util.List<java.lang.String> getResolvableProperties(java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> propertyEntries, java.util.Map<java.lang.String,java.lang.Object> testResourcesConfig)
TestResourcesResolver
TestResourcesResolver.getRequiredPropertyEntries()
and
values are those property entries resolved.getResolvableProperties
in interface TestResourcesResolver
propertyEntries
- the property entriestestResourcesConfig
- the test resources configurationpublic java.util.Optional<java.lang.String> resolve(java.lang.String propertyName, java.util.Map<java.lang.String,java.lang.Object> properties, java.util.Map<java.lang.String,java.lang.Object> testResourcesConfiguration)
TestResourcesResolver
resolve
in interface TestResourcesResolver
propertyName
- the property to resolveproperties
- the resolved required propertiestestResourcesConfiguration
- the test resources configuration