Class TestResourcesController

java.lang.Object
io.micronaut.testresources.server.TestResourcesController
All Implemented Interfaces:
io.micronaut.core.order.Ordered, TestResourcesResolver

@Controller("/") @ExecuteOn("blocking") public final class TestResourcesController extends Object implements TestResourcesResolver
A client responsible for connecting to a test resources server.
  • Constructor Details

  • Method Details

    • getResolvableProperties

      @Get("/list") public List<String> getResolvableProperties()
    • getResolvableProperties

      @Post("/list") 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.
      Specified by:
      getResolvableProperties in interface TestResourcesResolver
      Parameters:
      propertyEntries - the property entries
      testResourcesConfig - the test resources configuration
      Returns:
      the list of properties
    • getRequiredProperties

      @Get("/requirements/expr/{expression}") public List<String> getRequiredProperties(String expression)
      Description copied from interface: TestResourcesResolver
      Returns the list of properties which should be read before resolving an expression: this can be used if the resolver itself needs some configuration properties.
      Specified by:
      getRequiredProperties in interface TestResourcesResolver
      Parameters:
      expression - the expression which needs to be resolved.
      Returns:
      the list of configuration properties this resolver requires
    • getRequiredPropertyEntries

      @Get("/requirements/entries") public List<String> getRequiredPropertyEntries()
      Specified by:
      getRequiredPropertyEntries in interface TestResourcesResolver
    • resolve

      @Post("/resolve") public Optional<String> resolve(String name, Map<String,Object> properties, Map<String,Object> testResourcesConfig)
      Description copied from interface: TestResourcesResolver
      Resolves the given property.
      Specified by:
      resolve in interface TestResourcesResolver
      Parameters:
      name - the property to resolve
      properties - the resolved required properties
      testResourcesConfig - the test resources configuration
      Returns:
      the resolved property or empty if not found
    • closeAll

      @Get("/close/all") public boolean closeAll()
    • closeScope

      @Get("/close/{id}") public boolean closeScope(@Nullable @Nullable String id)
    • listContainers

      @Get("/testcontainers") public List<TestContainer> listContainers()
    • listContainersByScope

      @Get("/testcontainers/{scope}") public List<TestContainer> listContainersByScope(@Nullable @Nullable String scope)