Skip to content

Commit d25f1b0

Browse files
committed
Update document
Issue #4434
1 parent 056d060 commit d25f1b0

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

Diff for: documentation/src/docs/asciidoc/user-guide/extensions.adoc

+10-7
Original file line numberDiff line numberDiff line change
@@ -863,17 +863,20 @@ surrounding `ExtensionContext`. Since `ExtensionContexts` may be nested, the sco
863863
inner contexts may also be limited. Consult the corresponding Javadoc for details on the
864864
methods available for storing and retrieving values via the `{ExtensionContext_Store}`.
865865

866-
.`ExtensionContext.Store.CloseableResource`
866+
.`AutoCloseable`
867867
NOTE: An extension context store is bound to its extension context lifecycle. When an
868-
extension context lifecycle ends it closes its associated store. All stored values
869-
that are instances of `CloseableResource` are notified by an invocation of their `close()`
870-
method in the inverse order they were added in.
871-
872-
An example implementation of `CloseableResource` is shown below, using an `HttpServer`
868+
extension context lifecycle ends it closes its associated store. As of JUnit 5.13,
869+
all stored values that are instances of `AutoCloseable` are notified by an invocation of
870+
their `close()` method in the inverse order they were added in. (unless the
871+
`junit.jupiter.extensions.store.close.autocloseable.enabled` configuration parameter
872+
is set to false). Older versions supported `CloseableResource`, which is still
873+
available for backward compatibility but is no longer recommended.
874+
875+
An example implementation of `AutoCloseable` is shown below, using an `HttpServer`
873876
resource.
874877

875878
[source,java,indent=0]
876-
.`HttpServer` resource implementing `CloseableResource`
879+
.`HttpServer` resource implementing `AutoCloseable`
877880
----
878881
include::{testDir}/example/extensions/HttpServerResource.java[tags=user_guide]
879882
----

0 commit comments

Comments
 (0)