diff options
author | Martin Polden <mpolden@mpolden.no> | 2019-09-10 11:16:26 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2019-09-10 11:24:18 +0200 |
commit | fe7475d74b15c32a32d0f3e7be7df6c872e27eb5 (patch) | |
tree | 11596d2feb10321e35022427cf746ea4097a67a1 /controller-server | |
parent | e906d38cd418490f0d18854d296977833bf7a8c2 (diff) |
Move CostReportConsumerMock to controller-api
Diffstat (limited to 'controller-server')
3 files changed, 2 insertions, 40 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/cost/CostReportConsumerMock.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/cost/CostReportConsumerMock.java deleted file mode 100644 index 5c16560b509..00000000000 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/cost/CostReportConsumerMock.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.yahoo.vespa.hosted.controller.restapi.cost; - -import com.yahoo.vespa.hosted.controller.api.identifiers.Property; -import com.yahoo.vespa.hosted.controller.api.integration.resource.CostReportConsumer; -import com.yahoo.vespa.hosted.controller.api.integration.resource.ResourceAllocation; - -import java.util.Map; -import java.util.function.Consumer; - -/** - * @author ldalves - */ -public class CostReportConsumerMock implements CostReportConsumer { - - private final Consumer<String> csvConsumer; - private final Map<Property, ResourceAllocation> fixedAllocations; - - public CostReportConsumerMock() { - this.csvConsumer = (ignored) -> {}; - this.fixedAllocations = Map.of(); - } - - public CostReportConsumerMock(Consumer<String> csvConsumer, Map<Property, ResourceAllocation> fixedAllocations) { - this.csvConsumer = csvConsumer; - this.fixedAllocations = Map.copyOf(fixedAllocations); - } - - @Override - public void consume(String csv) { - csvConsumer.accept(csv); - } - - @Override - public Map<Property, ResourceAllocation> fixedAllocations() { - return fixedAllocations; - } - -} diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ServiceRegistryMock.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ServiceRegistryMock.java index 691d3a7bf30..1c4aeb49971 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ServiceRegistryMock.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ServiceRegistryMock.java @@ -38,7 +38,7 @@ import com.yahoo.vespa.hosted.controller.api.integration.stubs.MockMailer; import com.yahoo.vespa.hosted.controller.api.integration.stubs.MockMeteringClient; import com.yahoo.vespa.hosted.controller.api.integration.stubs.MockRunDataStore; import com.yahoo.vespa.hosted.controller.api.integration.stubs.MockTesterCloud; -import com.yahoo.vespa.hosted.controller.restapi.cost.CostReportConsumerMock; +import com.yahoo.vespa.hosted.controller.api.integration.resource.CostReportConsumerMock; /** * A mock implementation of a {@link ServiceRegistry} for testing purposes. diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/CostReportMaintainerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/CostReportMaintainerTest.java index bc68491d8dd..9867ea4bdc2 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/CostReportMaintainerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/CostReportMaintainerTest.java @@ -4,7 +4,7 @@ import com.yahoo.vespa.hosted.controller.ControllerTester; import com.yahoo.vespa.hosted.controller.api.identifiers.Property; import com.yahoo.vespa.hosted.controller.api.integration.resource.ResourceAllocation; import com.yahoo.vespa.hosted.controller.integration.ZoneApiMock; -import com.yahoo.vespa.hosted.controller.restapi.cost.CostReportConsumerMock; +import com.yahoo.vespa.hosted.controller.api.integration.resource.CostReportConsumerMock; import org.junit.Test; import java.time.Duration; |