From e869c92849c187e84765c93d37c52ae72ba130dc Mon Sep 17 00:00:00 2001 From: junya koyama Date: Fri, 31 Oct 2025 22:39:34 +0900 Subject: [PATCH] Migrate ExtensionContext.Store.CloseableResource to AutoCloseable Signed-off-by: junya koyama --- .../microsoft/playwright/impl/junit/PlaywrightExtension.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/junit/PlaywrightExtension.java b/playwright/src/main/java/com/microsoft/playwright/impl/junit/PlaywrightExtension.java index f25ecc18d..d1873bb61 100644 --- a/playwright/src/main/java/com/microsoft/playwright/impl/junit/PlaywrightExtension.java +++ b/playwright/src/main/java/com/microsoft/playwright/impl/junit/PlaywrightExtension.java @@ -36,7 +36,7 @@ public class PlaywrightExtension implements ParameterResolver { // There should be at most one instance of PlaywrightRegistry per test run, it keeps // track of all created Playwright instances and calls `close()` on each of them after // the tests finished. - static class PlaywrightRegistry implements ExtensionContext.Store.CloseableResource { + static class PlaywrightRegistry implements AutoCloseable { private final List playwrightList = Collections.synchronizedList(new ArrayList<>()); static synchronized PlaywrightRegistry getOrCreateFor(ExtensionContext extensionContext) { @@ -59,7 +59,7 @@ Playwright createPlaywright(Playwright.CreateOptions options) { // This is a workaround for JUnit's lack of an "AfterTestRun" hook // This will be called once after all tests have completed. @Override - public void close() throws Throwable { + public void close() { for (Playwright playwright : playwrightList) { playwright.close(); }