Class TestResourcesController
java.lang.Object
io.micronaut.testresources.server.TestResourcesController
@Controller("/")
@Produces("application/x-test-resources+binary")
@ExecuteOn("blocking")
public class TestResourcesController
extends Object
The main test resources controller, which will answer requests performed by the
test resources client to resolve properties or close test resources.
-
Constructor Summary
ConstructorsConstructorDescriptionTestResourcesController(List<PropertyResolutionListener> propertyResolutionListeners, io.micronaut.runtime.server.EmbeddedServer embeddedServer, io.micronaut.context.ApplicationContext applicationContext, ResolverLoader loader, io.micronaut.scheduling.TaskScheduler taskScheduler) -
Method Summary
Modifier and TypeMethodDescriptioncloseAll()Closes all test resources.closeScope(@Nullable String id) Closes a test resource scope.getRequiredProperties(String expression) Lists all properties required to resolve a particular expression.Lists all properties required by all resolvers.Lists all resolvable properties.getResolvableProperties(Map<String, Collection<String>> propertyEntries, Map<String, Object> testResourcesConfig) Lists all resolvable properties for a particular configuration.Lists all test containers started by the server.listContainersByScope(@Nullable String scope) Lists all test containers started by the server for a particular scope.Resolves a property.Requests a test resources service shutdown.
-
Constructor Details
-
TestResourcesController
public TestResourcesController(List<PropertyResolutionListener> propertyResolutionListeners, io.micronaut.runtime.server.EmbeddedServer embeddedServer, io.micronaut.context.ApplicationContext applicationContext, ResolverLoader loader, io.micronaut.scheduling.TaskScheduler taskScheduler)
-
-
Method Details
-
getResolvableProperties
Lists all resolvable properties. PrefergetResolvableProperties(Map, Map)to list all properties which can be resolved for a particular configuration.- Returns:
- the list of resolvable properties which do not depend on the application configuration
-
getResolvableProperties
@Post("/list") @Consumes("application/x-test-resources+binary") public Result<List<String>> getResolvableProperties(Map<String, Collection<String>> propertyEntries, Map<String, Object> testResourcesConfig) Lists all resolvable properties for a particular configuration.- Parameters:
propertyEntries- the property entriestestResourcesConfig- the test resources configuration- Returns:
- the list of resolvable properties for the supplied configuration
-
getRequiredProperties
-
getRequiredPropertyEntries
-
resolve
@Post("/resolve") @Consumes("application/x-test-resources+binary") public Optional<Result<String>> resolve(String name, Map<String, Object> properties, Map<String, Object> testResourcesConfig) Resolves a property.- Parameters:
name- the property to resolveproperties- the resolved required propertiestestResourcesConfig- the test resources configuration- Returns:
- the resolved property, if any
-
closeAll
-
closeScope
-
listContainers
-
listContainersByScope
-
stopService
-