feat: remove bootstrap_token from EnvironmentEntity — API keys managed separately
Remove bootstrapToken field/getter/setter from EnvironmentEntity and drop the RuntimeConfig dependency from EnvironmentService. DeploymentService and AgentStatusService now use a TODO-api-key placeholder until the ApiKeyService wiring is complete. All test references to setBootstrapToken removed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -83,7 +83,6 @@ class AppControllerTest {
|
||||
env.setTenantId(tenantId);
|
||||
env.setSlug("default");
|
||||
env.setDisplayName("Default");
|
||||
env.setBootstrapToken("test-bootstrap-token");
|
||||
var savedEnv = environmentRepository.save(env);
|
||||
environmentId = savedEnv.getId();
|
||||
}
|
||||
|
||||
@@ -84,7 +84,6 @@ class DeploymentControllerTest {
|
||||
env.setTenantId(tenantId);
|
||||
env.setSlug("default");
|
||||
env.setDisplayName("Default");
|
||||
env.setBootstrapToken("test-bootstrap-token");
|
||||
var savedEnv = environmentRepository.save(env);
|
||||
|
||||
var app = new AppEntity();
|
||||
|
||||
@@ -92,7 +92,6 @@ class DeploymentServiceTest {
|
||||
env.setId(envId);
|
||||
env.setTenantId(tenantId);
|
||||
env.setSlug("prod");
|
||||
env.setBootstrapToken("tok-abc");
|
||||
|
||||
tenant = new TenantEntity();
|
||||
tenant.setSlug("acme");
|
||||
|
||||
@@ -4,7 +4,6 @@ import net.siegeln.cameleer.saas.audit.AuditAction;
|
||||
import net.siegeln.cameleer.saas.audit.AuditService;
|
||||
import net.siegeln.cameleer.saas.license.LicenseEntity;
|
||||
import net.siegeln.cameleer.saas.license.LicenseRepository;
|
||||
import net.siegeln.cameleer.saas.runtime.RuntimeConfig;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
@@ -34,14 +33,11 @@ class EnvironmentServiceTest {
|
||||
@Mock
|
||||
private AuditService auditService;
|
||||
|
||||
@Mock
|
||||
private RuntimeConfig runtimeConfig;
|
||||
|
||||
private EnvironmentService environmentService;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
environmentService = new EnvironmentService(environmentRepository, licenseRepository, auditService, runtimeConfig);
|
||||
environmentService = new EnvironmentService(environmentRepository, licenseRepository, auditService);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -56,7 +52,6 @@ class EnvironmentServiceTest {
|
||||
when(licenseRepository.findFirstByTenantIdAndRevokedAtIsNullOrderByCreatedAtDesc(tenantId))
|
||||
.thenReturn(Optional.of(license));
|
||||
when(environmentRepository.countByTenantId(tenantId)).thenReturn(0L);
|
||||
when(runtimeConfig.getBootstrapToken()).thenReturn("test-token");
|
||||
when(environmentRepository.save(any(EnvironmentEntity.class))).thenAnswer(inv -> inv.getArgument(0));
|
||||
|
||||
var result = environmentService.create(tenantId, "prod", "Production", actorId);
|
||||
@@ -64,7 +59,6 @@ class EnvironmentServiceTest {
|
||||
assertThat(result.getSlug()).isEqualTo("prod");
|
||||
assertThat(result.getDisplayName()).isEqualTo("Production");
|
||||
assertThat(result.getTenantId()).isEqualTo(tenantId);
|
||||
assertThat(result.getBootstrapToken()).isEqualTo("test-token");
|
||||
|
||||
var actionCaptor = ArgumentCaptor.forClass(AuditAction.class);
|
||||
verify(auditService).log(any(), any(), any(), actionCaptor.capture(), any(), any(), any(), any(), any());
|
||||
@@ -175,7 +169,6 @@ class EnvironmentServiceTest {
|
||||
when(licenseRepository.findFirstByTenantIdAndRevokedAtIsNullOrderByCreatedAtDesc(tenantId))
|
||||
.thenReturn(Optional.of(license));
|
||||
when(environmentRepository.countByTenantId(tenantId)).thenReturn(0L);
|
||||
when(runtimeConfig.getBootstrapToken()).thenReturn("test-token");
|
||||
when(environmentRepository.save(any(EnvironmentEntity.class))).thenAnswer(inv -> inv.getArgument(0));
|
||||
|
||||
var result = environmentService.createDefaultForTenant(tenantId);
|
||||
|
||||
Reference in New Issue
Block a user