Skip to content

Commit

Permalink
Add cleanup to BaseAuthzTest used in backport of PR apache#22305
Browse files Browse the repository at this point in the history
(cherry picked from commit 91ee580)
  • Loading branch information
lhotari committed Mar 20, 2024
1 parent c1f4d0a commit 83d996b
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public abstract class BaseAuthZTest extends MockedPulsarServiceBaseTest {
protected PulsarAdmin superUserAdmin;
protected PulsarAdmin tenantManagerAdmin;

@BeforeClass
@BeforeClass(alwaysRun = true)
@Override
protected void setup() throws Exception {
conf.setSystemTopicEnabled(true);
Expand Down Expand Up @@ -102,9 +102,17 @@ protected void customizeNewPulsarAdminBuilder(PulsarAdminBuilder pulsarAdminBuil
pulsarAdminBuilder.authentication(new AuthenticationToken(SUPER_USER_TOKEN));
}

@AfterClass
@AfterClass(alwaysRun = true)
@Override
protected void cleanup() throws Exception {
if (superUserAdmin != null) {
superUserAdmin.close();
superUserAdmin = null;
}
if (tenantManagerAdmin != null) {
tenantManagerAdmin.close();
tenantManagerAdmin = null;
}
internalCleanup();
}
}

0 comments on commit 83d996b

Please sign in to comment.