diff options
Diffstat (limited to 'controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/ResourceDatabaseClientMock.java')
-rw-r--r-- | controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/ResourceDatabaseClientMock.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/ResourceDatabaseClientMock.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/ResourceDatabaseClientMock.java index e9bfc4fe78c..e2003e24332 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/ResourceDatabaseClientMock.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/ResourceDatabaseClientMock.java @@ -1,9 +1,12 @@ // Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.api.integration.resource; +import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.TenantName; +import com.yahoo.vespa.hosted.controller.api.identifiers.ClusterId; import com.yahoo.vespa.hosted.controller.api.integration.billing.Plan; import com.yahoo.vespa.hosted.controller.api.integration.billing.PlanRegistry; +import com.yahoo.vespa.hosted.controller.api.integration.configserver.Cluster; import java.math.BigDecimal; import java.time.Duration; @@ -30,6 +33,7 @@ public class ResourceDatabaseClientMock implements ResourceDatabaseClient { PlanRegistry planRegistry; Map<TenantName, Plan> planMap = new HashMap<>(); List<ResourceSnapshot> resourceSnapshots = new ArrayList<>(); + Map<ClusterId, List<Cluster.ScalingEvent>> scalingEvents = new HashMap<>(); private boolean hasRefreshedMaterializedView = false; public ResourceDatabaseClientMock(PlanRegistry planRegistry) { @@ -121,6 +125,16 @@ public class ResourceDatabaseClientMock implements ResourceDatabaseClient { hasRefreshedMaterializedView = true; } + @Override + public void writeScalingEvents(ClusterId clusterId, Collection<Cluster.ScalingEvent> scalingEvents) { + this.scalingEvents.put(clusterId, List.copyOf(scalingEvents)); + } + + @Override + public List<Cluster.ScalingEvent> scalingEvents(Instant from, Instant to, Optional<ApplicationId> application) { + return List.of(); + } + public void setPlan(TenantName tenant, Plan plan) { planMap.put(tenant, plan); } |