refactor(license-test): rename installTestLicenseWithCaps -> installSyntheticUnsignedLicense

Makes the signature-bypass loud at every call site since T19-T25 will
copy this pattern 5+ more times. The helper still loads via
LicenseGate.load() directly (no signature check) — the new name
ensures any future caller has to acknowledge that.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-26 13:24:58 +02:00
parent 8a64a9e04c
commit 198811b752
3 changed files with 4 additions and 4 deletions

View File

@@ -44,7 +44,7 @@ public class TestSecurityHelper {
* supply the keys you want to lift. Use this from {@code @BeforeEach} in ITs that need to * supply the keys you want to lift. Use this from {@code @BeforeEach} in ITs that need to
* create more than the default-tier allowance of envs/apps/users/etc. * create more than the default-tier allowance of envs/apps/users/etc.
*/ */
public void installTestLicenseWithCaps(Map<String, Integer> caps) { public void installSyntheticUnsignedLicense(Map<String, Integer> caps) {
LicenseInfo info = new LicenseInfo( LicenseInfo info = new LicenseInfo(
UUID.randomUUID(), UUID.randomUUID(),
"default", "default",
@@ -56,7 +56,7 @@ public class TestSecurityHelper {
licenseGate.load(info); licenseGate.load(info);
} }
/** Clears any test license previously installed via {@link #installTestLicenseWithCaps}. */ /** Clears any test license previously installed via {@link #installSyntheticUnsignedLicense}. */
public void clearTestLicense() { public void clearTestLicense() {
licenseGate.clear(); licenseGate.clear();
} }

View File

@@ -47,7 +47,7 @@ class DeploymentControllerAuditIT extends AbstractPostgresIT {
adminJwt = securityHelper.adminToken(); adminJwt = securityHelper.adminToken();
// Lift default-tier caps so the promote-target env + apps can be created via the API. // Lift default-tier caps so the promote-target env + apps can be created via the API.
securityHelper.installTestLicenseWithCaps(Map.of( securityHelper.installSyntheticUnsignedLicense(Map.of(
"max_environments", 100, "max_environments", 100,
"max_apps", 100)); "max_apps", 100));

View File

@@ -44,7 +44,7 @@ class EnvironmentAdminControllerIT extends AbstractPostgresIT {
jdbcTemplate.update("DELETE FROM environments WHERE slug != 'default'"); jdbcTemplate.update("DELETE FROM environments WHERE slug != 'default'");
// Lift max_environments cap so existing IT scenarios that POST envs through the // Lift max_environments cap so existing IT scenarios that POST envs through the
// controller succeed; the cap itself is exercised by EnvironmentCapEnforcementIT. // controller succeed; the cap itself is exercised by EnvironmentCapEnforcementIT.
securityHelper.installTestLicenseWithCaps(java.util.Map.of("max_environments", 100)); securityHelper.installSyntheticUnsignedLicense(java.util.Map.of("max_environments", 100));
} }
@org.junit.jupiter.api.AfterEach @org.junit.jupiter.api.AfterEach