Class AbstractAwsTestResourceProvider<C extends org.testcontainers.containers.GenericContainer<? extends C>, S extends AwsEmulatorService<C>>

java.lang.Object
io.micronaut.testresources.testcontainers.AbstractTestContainersProvider<C>
io.micronaut.testresources.aws.AbstractAwsTestResourceProvider<C,S>
Type Parameters:
C - the container type
S - the service type
All Implemented Interfaces:
io.micronaut.core.order.Ordered, TestResourcesResolver, ToggableTestResourcesResolver
Direct Known Subclasses:
FlociTestResourceProvider, LocalStackTestResourceProvider

@Internal public abstract class AbstractAwsTestResourceProvider<C extends org.testcontainers.containers.GenericContainer<? extends C>, S extends AwsEmulatorService<C>> extends AbstractTestContainersProvider<C>
Base provider for AWS emulator test resources.
  • Constructor Details

    • AbstractAwsTestResourceProvider

      protected AbstractAwsTestResourceProvider(Class<S> serviceType)
    • AbstractAwsTestResourceProvider

      protected AbstractAwsTestResourceProvider(Class<S> serviceType, Collection<S> additionalServices)
  • Method Details

    • getResolvableProperties

      public List<String> getResolvableProperties(Map<String, Collection<String>> propertyEntries, Map<String,Object> testResourcesConfig)
      Description copied from interface: TestResourcesResolver
      Returns the list of properties that this resolver is able to support. The property entries map is a map which keys are the property entries retrieved from calling TestResourcesResolver.getRequiredPropertyEntries() and values are those property entries resolved.
      Parameters:
      propertyEntries - the property entries
      testResourcesConfig - the test resources configuration
      Returns:
      the list of properties
    • shouldAnswer

      protected boolean shouldAnswer(String propertyName, Map<String,Object> requestedProperties, Map<String,Object> testResourcesConfig)
      Description copied from class: AbstractTestContainersProvider
      Determines if this resolver can resolve the requested property. It is used in order to make sure that a "Postgres" resolver wouldn't provide a value if the requested container type is for MySQL, for example.
      Overrides:
      shouldAnswer in class AbstractTestContainersProvider<C extends org.testcontainers.containers.GenericContainer<? extends C>>
      Parameters:
      propertyName - the property to resolve
      requestedProperties - the resolved properties
      testResourcesConfig - the test resources configuration
      Returns:
      if this resolver should answer
    • resolveProperty

      protected Optional<String> resolveProperty(String propertyName, C container)
      Specified by:
      resolveProperty in class AbstractTestContainersProvider<C extends org.testcontainers.containers.GenericContainer<? extends C>>
    • getServices

      protected final List<S> getServices()
    • getServiceKinds

      protected final Set<String> getServiceKinds()
    • resolveAccessKey

      protected abstract String resolveAccessKey(C container)
    • resolveSecretKey

      protected abstract String resolveSecretKey(C container)
    • resolveRegion

      protected abstract String resolveRegion(C container)