You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace @BeforeEach guard with @TestSetup in ClientApiV2AuthorizationTest #48362
ClientApiV2AuthorizationTest uses a manual guard flag pattern to avoid repeated admin client setup across 13 test methods:
@BeforeEach
public void setupClients() {
if (adminClients.isEmpty()) {
for (String currentUser : CURRENT_USERS) {
adminClients.put(currentUser, createAdminClient(currentUser));
}
}
}
The new test framework already provides @testsetup for exactly this purpose - it runs once per test class, after field injection, so injected fields like @InjectAdminClientFactory are available.
We should remove the manual workaround and use the framework's mechanism instead.
I did some test measurements as well - setup still runs exactly once, all 13 tests pass with identical timing. So no behaviour change compared to the workaround.
Activity
Replace @beforeeach guard with @testsetup in ClientApiV2Authorization…
Replace @beforeeach guard with @testsetup in ClientApiV2Authorization…