summaryrefslogtreecommitdiffstats
path: root/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/CloudTrialExpirerTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/CloudTrialExpirerTest.java')
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/CloudTrialExpirerTest.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/CloudTrialExpirerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/CloudTrialExpirerTest.java
index f37a5a6893d..f768ab5e61b 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/CloudTrialExpirerTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/CloudTrialExpirerTest.java
@@ -18,6 +18,7 @@ import java.time.Duration;
import java.util.List;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
/**
* @author ogronnesby
@@ -72,6 +73,16 @@ public class CloudTrialExpirerTest {
assertPlan("with-deployments", "trial");
}
+ @Test
+ public void delete_tenants_with_applications_with_no_deployments() {
+ registerTenant("with-apps", "trial", Duration.ofDays(30));
+ tester.createApplication("with-apps", "app1", "instance1");
+ expirer.maintain();
+ assertPlan("with-apps", "none");
+ expirer.maintain();
+ assertTrue(tester.controller().tenants().get("with-apps").isEmpty());
+ }
+
private void registerTenant(String tenantName, String plan, Duration timeSinceLastLogin) {
var name = TenantName.from(tenantName);
tester.createTenant(tenantName, Tenant.Type.cloud);