Package io.micronaut.testresources.core
Class Scope
java.lang.Object
io.micronaut.testresources.core.Scope
A scope represents the lifecycle of a test resource.
The root scope is handled by the test resources provider,
and lives as long as the provider is alive, or that it is
explicitly closed.
The scope property is always implicitly requested.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreates a child scope with the given id.boolean
static Scope
Returns the scope id if found in the supplied properties.int
hashCode()
boolean
Determines if this scope is the supplied scope, or the parent of the supplied scope.static Scope
Returns a new scope with the given id.toString()
-
Field Details
-
ROOT
The default scope. -
PROPERTY_KEY
The property name, for when the scope is passed as a property string.- See Also:
-
-
Method Details
-
from
Returns the scope id if found in the supplied properties.- Parameters:
properties
- the properties where to look for the scope- Returns:
- the scope
-
child
Creates a child scope with the given id.- Parameters:
id
- the child id- Returns:
- the child scope
-
equals
-
hashCode
public int hashCode() -
toString
-
includes
Determines if this scope is the supplied scope, or the parent of the supplied scope.- Parameters:
scope
- the scope to check- Returns:
- true if this scope includes the supplied scope
-
of
Returns a new scope with the given id.- Parameters:
id
- the scope id- Returns:
- the scope
-