diff options
Diffstat (limited to 'controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java')
-rw-r--r-- | controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java index 6f859ff3d15..5704af75cb9 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java @@ -12,6 +12,8 @@ import com.yahoo.config.provision.CloudAccount; import com.yahoo.config.provision.ClusterResources; import com.yahoo.config.provision.ClusterSpec; import com.yahoo.config.provision.DockerImage; +import com.yahoo.config.provision.EndpointsChecker.Availability; +import com.yahoo.config.provision.EndpointsChecker.Endpoint; import com.yahoo.config.provision.Environment; import com.yahoo.config.provision.HostName; import com.yahoo.config.provision.NodeResources; @@ -42,8 +44,10 @@ import com.yahoo.vespa.hosted.controller.api.integration.configserver.QuotaUsage import com.yahoo.vespa.hosted.controller.api.integration.configserver.ServiceConvergence; import com.yahoo.vespa.hosted.controller.api.integration.deployment.TestReport; import com.yahoo.vespa.hosted.controller.api.integration.deployment.TesterCloud; +import com.yahoo.vespa.hosted.controller.api.integration.dns.NameService; import com.yahoo.vespa.hosted.controller.api.integration.noderepository.RestartFilter; import com.yahoo.vespa.hosted.controller.api.integration.secrets.TenantSecretStore; +import com.yahoo.vespa.hosted.controller.api.integration.stubs.MockTesterCloud; import com.yahoo.vespa.hosted.controller.application.SystemApplication; import com.yahoo.vespa.hosted.controller.application.pkg.ApplicationPackage; @@ -82,6 +86,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; */ public class ConfigServerMock extends AbstractComponent implements ConfigServer { + private final MockTesterCloud mockTesterCloud; private final Map<DeploymentId, Application> applications = new LinkedHashMap<>(); private final Set<ZoneId> inactiveZones = new HashSet<>(); private final Map<DeploymentId, EndpointStatus> endpoints = new HashMap<>(); @@ -105,9 +110,9 @@ public class ConfigServerMock extends AbstractComponent implements ConfigServer private Consumer<ApplicationId> prepareException = null; private Supplier<String> log = () -> "INFO - All good"; - @Inject - public ConfigServerMock(ZoneRegistryMock zoneRegistry) { + public ConfigServerMock(ZoneRegistryMock zoneRegistry, NameService nameService) { bootstrap(zoneRegistry.zones().all().ids(), SystemApplication.notController()); + this.mockTesterCloud = new MockTesterCloud(nameService); } /** Assigns a reserved tenant node to the given deployment, with initial versions. */ @@ -370,8 +375,10 @@ public class ConfigServerMock extends AbstractComponent implements ConfigServer public Optional<TestReport> getTestReport(DeploymentId deployment) { return Optional.ofNullable(testReport.get(deployment)); } - public void setTestReport(DeploymentId deploymentId, TestReport report) { - testReport.put(deploymentId, report); + + @Override + public Availability verifyEndpoints(DeploymentId deploymentId, List<Endpoint> zoneEndpoints) { + return mockTesterCloud.verifyEndpoints(deploymentId, zoneEndpoints); // Wraps the same name service mock, which is updated by test harness. } /** Add any of given loadBalancers that do not already exist to the load balancers in zone */ @@ -419,7 +426,8 @@ public class ConfigServerMock extends AbstractComponent implements ConfigServer LoadBalancer.State.active, Optional.of("dns-zone-1"), Optional.empty(), - Optional.of(new PrivateServiceInfo("service", List.of(new AllowedUrn(AccessType.awsPrivateLink, "arne"))))))); + Optional.of(new PrivateServiceInfo("service", List.of(new AllowedUrn(AccessType.awsPrivateLink, "arne")))), + true))); } Application application = applications.get(id); |