Skip to content

Commit 0f14588

Browse files
authored
Migrate ExtensionContext.Store.CloseableResource to AutoCloseable (#1860)
1 parent e417cad commit 0f14588

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

playwright/src/main/java/com/microsoft/playwright/impl/junit/PlaywrightExtension.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class PlaywrightExtension implements ParameterResolver {
3636
// There should be at most one instance of PlaywrightRegistry per test run, it keeps
3737
// track of all created Playwright instances and calls `close()` on each of them after
3838
// the tests finished.
39-
static class PlaywrightRegistry implements ExtensionContext.Store.CloseableResource {
39+
static class PlaywrightRegistry implements AutoCloseable {
4040
private final List<Playwright> playwrightList = Collections.synchronizedList(new ArrayList<>());
4141

4242
static synchronized PlaywrightRegistry getOrCreateFor(ExtensionContext extensionContext) {
@@ -59,7 +59,7 @@ Playwright createPlaywright(Playwright.CreateOptions options) {
5959
// This is a workaround for JUnit's lack of an "AfterTestRun" hook
6060
// This will be called once after all tests have completed.
6161
@Override
62-
public void close() throws Throwable {
62+
public void close() {
6363
for (Playwright playwright : playwrightList) {
6464
playwright.close();
6565
}

0 commit comments

Comments
 (0)