summaryrefslogtreecommitdiffstats
path: root/service-monitor
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@oath.com>2019-01-14 13:46:05 +0100
committerHåkon Hallingstad <hakon@oath.com>2019-01-14 13:46:05 +0100
commit9d8f687feb26c02f0c010c856d2e2506c451d9b1 (patch)
treeca0eee301abd53e0557a48892697d473ca0e2b36 /service-monitor
parent7f38b0d10b80fa67d83e36bc737573408de6c289 (diff)
Remove healthmonitor-monitorinfra, dupermodel-contains-infra, dupermodel-use-configserverconfig, proxyhost-uses-real-orchestrator, and confighost-uses-real-orchestrator flags
Diffstat (limited to 'service-monitor')
-rw-r--r--service-monitor/src/main/java/com/yahoo/vespa/service/duper/ConfigServerApplication.java14
-rw-r--r--service-monitor/src/main/java/com/yahoo/vespa/service/duper/DuperModelManager.java41
-rw-r--r--service-monitor/src/main/java/com/yahoo/vespa/service/health/HealthMonitorManager.java29
-rw-r--r--service-monitor/src/test/java/com/yahoo/vespa/service/duper/DuperModelManagerTest.java75
-rw-r--r--service-monitor/src/test/java/com/yahoo/vespa/service/health/HealthMonitorManagerTest.java31
-rw-r--r--service-monitor/src/test/java/com/yahoo/vespa/service/model/ApplicationInstanceGeneratorTest.java12
-rw-r--r--service-monitor/src/test/java/com/yahoo/vespa/service/model/ModelGeneratorTest.java2
-rw-r--r--service-monitor/src/test/java/com/yahoo/vespa/service/monitor/ConfigserverUtil.java13
8 files changed, 37 insertions, 180 deletions
diff --git a/service-monitor/src/main/java/com/yahoo/vespa/service/duper/ConfigServerApplication.java b/service-monitor/src/main/java/com/yahoo/vespa/service/duper/ConfigServerApplication.java
index 88c2c0d4469..91759b32086 100644
--- a/service-monitor/src/main/java/com/yahoo/vespa/service/duper/ConfigServerApplication.java
+++ b/service-monitor/src/main/java/com/yahoo/vespa/service/duper/ConfigServerApplication.java
@@ -1,16 +1,10 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.service.duper;
-import com.yahoo.cloud.config.ConfigserverConfig;
-import com.yahoo.config.model.api.ApplicationInfo;
import com.yahoo.config.provision.ClusterSpec;
-import com.yahoo.config.provision.HostName;
import com.yahoo.config.provision.NodeType;
import com.yahoo.vespa.applicationmodel.ServiceType;
-import java.util.List;
-import java.util.stream.Collectors;
-
/**
* A service/application model of the config server with health status.
*/
@@ -21,12 +15,4 @@ public class ConfigServerApplication extends ConfigServerLikeApplication {
public ConfigServerApplication() {
super("zone-config-servers", NodeType.config, ClusterSpec.Type.admin, ServiceType.CONFIG_SERVER);
}
-
- public ApplicationInfo makeApplicationInfoFromConfig(ConfigserverConfig config) {
- List<HostName> hostnames = config.zookeeperserver().stream()
- .map(ConfigserverConfig.Zookeeperserver::hostname)
- .map(HostName::from)
- .collect(Collectors.toList());
- return makeApplicationInfo(hostnames);
- }
}
diff --git a/service-monitor/src/main/java/com/yahoo/vespa/service/duper/DuperModelManager.java b/service-monitor/src/main/java/com/yahoo/vespa/service/duper/DuperModelManager.java
index 57c206ee570..ce99126c481 100644
--- a/service-monitor/src/main/java/com/yahoo/vespa/service/duper/DuperModelManager.java
+++ b/service-monitor/src/main/java/com/yahoo/vespa/service/duper/DuperModelManager.java
@@ -11,7 +11,6 @@ import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.HostName;
import com.yahoo.log.LogLevel;
import com.yahoo.vespa.flags.FlagSource;
-import com.yahoo.vespa.flags.Flags;
import com.yahoo.vespa.service.monitor.DuperModelInfraApi;
import com.yahoo.vespa.service.monitor.InfraApplicationApi;
@@ -36,8 +35,7 @@ public class DuperModelManager implements DuperModelInfraApi {
private final ProxyHostApplication proxyHostApplication = new ProxyHostApplication();
private final ControllerApplication controllerApplication = new ControllerApplication();
private final ControllerHostApplication controllerHostApplication = new ControllerHostApplication();
- // this must be static to be referenced in this(). Remove static once legacy config server from config is gone.
- private static final ConfigServerApplication configServerApplication = new ConfigServerApplication();
+ private final ConfigServerApplication configServerApplication = new ConfigServerApplication();
private final Map<ApplicationId, InfraApplication> supportedInfraApplications = Stream.of(
configServerApplication,
@@ -47,8 +45,6 @@ public class DuperModelManager implements DuperModelInfraApi {
controllerHostApplication)
.collect(Collectors.toMap(InfraApplication::getApplicationId, Function.identity()));
- private final boolean containsInfra;
- private final boolean useConfigserverConfig;
private final boolean multitenant;
private final Object monitor = new Object();
@@ -58,31 +54,14 @@ public class DuperModelManager implements DuperModelInfraApi {
@Inject
public DuperModelManager(ConfigserverConfig configServerConfig, FlagSource flagSource, SuperModelProvider superModelProvider) {
- this(
- Flags.DUPERMODEL_CONTAINS_INFRA.bindTo(flagSource).value(),
- Flags.DUPERMODEL_USE_CONFIGSERVERCONFIG.bindTo(flagSource).value(),
- configServerConfig.multitenant(),
- configServerApplication.makeApplicationInfoFromConfig(configServerConfig),
- superModelProvider,
- new DuperModel());
+ this(configServerConfig.multitenant(), superModelProvider, new DuperModel());
}
/** For testing */
- public DuperModelManager(boolean containsInfra,
- boolean useConfigserverConfig,
- boolean multitenant,
- ApplicationInfo configServerApplicationInfoFromConfig,
- SuperModelProvider superModelProvider,
- DuperModel duperModel) {
- this.containsInfra = containsInfra;
- this.useConfigserverConfig = useConfigserverConfig;
+ public DuperModelManager(boolean multitenant, SuperModelProvider superModelProvider, DuperModel duperModel) {
this.multitenant = multitenant;
this.duperModel = duperModel;
- if (isConfigServerFromConfigInDuperModel()) {
- duperModel.add(configServerApplicationInfoFromConfig);
- }
-
superModelProvider.registerListener(new SuperModelListener() {
@Override
public void applicationActivated(SuperModel superModel, ApplicationInfo application) {
@@ -183,22 +162,11 @@ public class DuperModelManager implements DuperModelInfraApi {
}
}
- private boolean isConfigServerFromConfigInDuperModel() {
- return multitenant && useConfigserverConfig;
- }
-
private boolean infraApplicationBelongsInDuperModel(ApplicationId applicationId) {
- // At most 1 of the following 3 applications can be in the duper model:
- // - config server built from ConfigserverConfig (legacy on both controller and config server)
- // - config server
- // - controller
+ // At most 1 of the config server and controller applications can be in the duper model.
// The problem of allowing more than 1 is that orchestration will fail since hostname -> application lookup
// will not be unique.
- if (!containsInfra) {
- return false;
- }
if (applicationId.equals(controllerApplication.getApplicationId())) {
- if (isConfigServerFromConfigInDuperModel()) return false;
if (!multitenant) return false;
if (duperModel.contains(configServerApplication.getApplicationId())) {
logger.log(LogLevel.ERROR, "Refusing to add controller application to duper model " +
@@ -207,7 +175,6 @@ public class DuperModelManager implements DuperModelInfraApi {
}
return true;
} else if (applicationId.equals(configServerApplication.getApplicationId())) {
- if (isConfigServerFromConfigInDuperModel()) return false;
if (!multitenant) return false;
if (duperModel.contains(controllerApplication.getApplicationId())) {
logger.log(LogLevel.ERROR, "Refusing to add config server application to duper model " +
diff --git a/service-monitor/src/main/java/com/yahoo/vespa/service/health/HealthMonitorManager.java b/service-monitor/src/main/java/com/yahoo/vespa/service/health/HealthMonitorManager.java
index 682f677a626..71938a9f1dc 100644
--- a/service-monitor/src/main/java/com/yahoo/vespa/service/health/HealthMonitorManager.java
+++ b/service-monitor/src/main/java/com/yahoo/vespa/service/health/HealthMonitorManager.java
@@ -8,9 +8,7 @@ import com.yahoo.vespa.applicationmodel.ClusterId;
import com.yahoo.vespa.applicationmodel.ConfigId;
import com.yahoo.vespa.applicationmodel.ServiceStatus;
import com.yahoo.vespa.applicationmodel.ServiceType;
-import com.yahoo.vespa.flags.BooleanFlag;
import com.yahoo.vespa.flags.FlagSource;
-import com.yahoo.vespa.flags.Flags;
import com.yahoo.vespa.service.duper.DuperModelManager;
import com.yahoo.vespa.service.duper.ZoneApplication;
import com.yahoo.vespa.service.executor.RunletExecutorImpl;
@@ -50,26 +48,19 @@ public class HealthMonitorManager implements MonitorManager {
private final ConcurrentHashMap<ApplicationId, ApplicationHealthMonitor> healthMonitors = new ConcurrentHashMap<>();
private final DuperModelManager duperModel;
private final ApplicationHealthMonitorFactory applicationHealthMonitorFactory;
- private final BooleanFlag monitorInfra;
@Inject
public HealthMonitorManager(DuperModelManager duperModel, FlagSource flagSource) {
- this(duperModel,
- Flags.HEALTHMONITOR_MONITOR_INFRA.bindTo(flagSource),
- new StateV1HealthModel(TARGET_HEALTH_STALENESS, HEALTH_REQUEST_TIMEOUT, KEEP_ALIVE, new RunletExecutorImpl(THREAD_POOL_SIZE)));
+ this(duperModel, new StateV1HealthModel(
+ TARGET_HEALTH_STALENESS, HEALTH_REQUEST_TIMEOUT, KEEP_ALIVE, new RunletExecutorImpl(THREAD_POOL_SIZE)));
}
- private HealthMonitorManager(DuperModelManager duperModel,
- BooleanFlag monitorInfra,
- StateV1HealthModel healthModel) {
- this(duperModel, monitorInfra, id -> new ApplicationHealthMonitor(id, healthModel));
+ private HealthMonitorManager(DuperModelManager duperModel, StateV1HealthModel healthModel) {
+ this(duperModel, id -> new ApplicationHealthMonitor(id, healthModel));
}
- HealthMonitorManager(DuperModelManager duperModel,
- BooleanFlag monitorInfra,
- ApplicationHealthMonitorFactory applicationHealthMonitorFactory) {
+ HealthMonitorManager(DuperModelManager duperModel, ApplicationHealthMonitorFactory applicationHealthMonitorFactory) {
this.duperModel = duperModel;
- this.monitorInfra = monitorInfra;
this.applicationHealthMonitorFactory = applicationHealthMonitorFactory;
}
@@ -111,14 +102,6 @@ public class HealthMonitorManager implements MonitorManager {
@Override
public boolean wouldMonitor(ApplicationId id) {
- if (duperModel.isSupportedInfraApplication(id) && monitorInfra.value()) {
- return true;
- }
-
- if (id.equals(duperModel.getConfigServerApplication().getApplicationId())) {
- return true;
- }
-
- return false;
+ return duperModel.isSupportedInfraApplication(id);
}
}
diff --git a/service-monitor/src/test/java/com/yahoo/vespa/service/duper/DuperModelManagerTest.java b/service-monitor/src/test/java/com/yahoo/vespa/service/duper/DuperModelManagerTest.java
index ba38b99617b..4ab97d7e81e 100644
--- a/service-monitor/src/test/java/com/yahoo/vespa/service/duper/DuperModelManagerTest.java
+++ b/service-monitor/src/test/java/com/yahoo/vespa/service/duper/DuperModelManagerTest.java
@@ -1,14 +1,12 @@
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.service.duper;
-import com.yahoo.cloud.config.ConfigserverConfig;
import com.yahoo.config.model.api.ApplicationInfo;
import com.yahoo.config.model.api.SuperModel;
import com.yahoo.config.model.api.SuperModelListener;
import com.yahoo.config.model.api.SuperModelProvider;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.HostName;
-import com.yahoo.vespa.service.monitor.ConfigserverUtil;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
@@ -26,8 +24,6 @@ import static org.mockito.Mockito.when;
* @author hakonhall
*/
public class DuperModelManagerTest {
- private final ConfigserverConfig configserverConfig = ConfigserverUtil.createExampleConfigserverConfig();
- private final ApplicationInfo configServerApplicationFromConfig = new ConfigServerApplication().makeApplicationInfoFromConfig(configserverConfig);
private final SuperModelProvider superModelProvider = mock(SuperModelProvider.class);
private final SuperModel superModel = mock(SuperModel.class);
private final DuperModel duperModel = mock(DuperModel.class);
@@ -36,24 +32,10 @@ public class DuperModelManagerTest {
private SuperModelListener superModelListener;
private void makeManager() {
- makeManager(true);
- }
-
- private void makeManager(boolean containsInfra) {
- makeManager(containsInfra, true);
- }
-
- private void makeManager(boolean containsInfra, boolean useConfigServerConfig) {
- manager = new DuperModelManager(
- containsInfra,
- useConfigServerConfig,
- true,
- configServerApplicationFromConfig,
- superModelProvider,
- duperModel);
+ manager = new DuperModelManager(true, superModelProvider, duperModel);
when(superModelProvider.getSuperModel()).thenReturn(superModel);
- verify(duperModel, times(useConfigServerConfig ? 1 : 0)).add(any());
+ verify(duperModel, times(0)).add(any());
ArgumentCaptor<SuperModelListener> superModelListenerCaptor = ArgumentCaptor.forClass(SuperModelListener.class);
verify(superModelProvider, times(1)).registerListener(superModelListenerCaptor.capture());
@@ -64,8 +46,9 @@ public class DuperModelManagerTest {
public void testSuperModelAffectsDuperModel() {
makeManager();
+ verify(duperModel, times(0)).add(any());
superModelListener.applicationActivated(superModel, mock(ApplicationInfo.class));
- verify(duperModel, times(2)).add(any());
+ verify(duperModel, times(1)).add(any());
verify(duperModel, times(0)).remove(any());
superModelListener.applicationRemoved(superModel, ApplicationId.from("tenant", "app", "default"));
@@ -78,8 +61,9 @@ public class DuperModelManagerTest {
ApplicationId id = manager.getProxyHostApplication().getApplicationId();
List<HostName> proxyHostHosts = Stream.of("proxyhost1", "proxyhost2").map(HostName::from).collect(Collectors.toList());
+ verify(duperModel, times(0)).add(any());
manager.infraApplicationActivated(id, proxyHostHosts);
- verify(duperModel, times(2)).add(any());
+ verify(duperModel, times(1)).add(any());
when(duperModel.contains(id)).thenReturn(true);
verify(duperModel, times(0)).remove(any());
@@ -88,43 +72,8 @@ public class DuperModelManagerTest {
}
@Test
- public void testDisableInfraApplications() {
- makeManager(false);
-
- List<HostName> proxyHostHosts = Stream.of("proxyhost1", "proxyhost2").map(HostName::from).collect(Collectors.toList());
- manager.infraApplicationActivated(manager.getProxyHostApplication().getApplicationId(), proxyHostHosts);
- verify(duperModel, times(1)).add(any());
-
- verify(duperModel, times(0)).remove(any());
- manager.infraApplicationRemoved(manager.getProxyHostApplication().getApplicationId());
- verify(duperModel, times(0)).remove(any());
- }
-
- @Test
- public void testConfigServerInfraApplications() {
- makeManager();
- testConfigServerLikeInfraApplication(manager.getConfigServerApplication().getApplicationId());
- }
-
- @Test
- public void testControllerInfraApplications() {
- makeManager();
- testConfigServerLikeInfraApplication(manager.getControllerApplication().getApplicationId());
- }
-
- private void testConfigServerLikeInfraApplication(ApplicationId configServerLikeId) {
- List<HostName> hostnames = Stream.of("node1", "node2").map(HostName::from).collect(Collectors.toList());
- manager.infraApplicationActivated(configServerLikeId, hostnames);
- verify(duperModel, times(1)).add(any());
-
- verify(duperModel, times(0)).remove(any());
- manager.infraApplicationRemoved(configServerLikeId);
- verify(duperModel, times(0)).remove(any());
- }
-
- @Test
public void testEnabledConfigServerInfraApplications() {
- makeManager(true, false);
+ makeManager();
testEnabledConfigServerLikeInfraApplication(
manager.getConfigServerApplication().getApplicationId(),
manager.getControllerApplication().getApplicationId());
@@ -132,7 +81,7 @@ public class DuperModelManagerTest {
@Test
public void testEnabledControllerInfraApplications() {
- makeManager(true, false);
+ makeManager();
testEnabledConfigServerLikeInfraApplication(
manager.getControllerApplication().getApplicationId(),
manager.getConfigServerApplication().getApplicationId());
@@ -162,13 +111,7 @@ public class DuperModelManagerTest {
@Test
public void testSingleTenant() {
- manager = new DuperModelManager(
- true,
- true,
- false,
- configServerApplicationFromConfig,
- superModelProvider,
- duperModel);
+ manager = new DuperModelManager(false, superModelProvider, duperModel);
when(superModelProvider.getSuperModel()).thenReturn(superModel);
verify(duperModel, times(0)).add(any());
diff --git a/service-monitor/src/test/java/com/yahoo/vespa/service/health/HealthMonitorManagerTest.java b/service-monitor/src/test/java/com/yahoo/vespa/service/health/HealthMonitorManagerTest.java
index 78b0bed0e6f..061807ba76f 100644
--- a/service-monitor/src/test/java/com/yahoo/vespa/service/health/HealthMonitorManagerTest.java
+++ b/service-monitor/src/test/java/com/yahoo/vespa/service/health/HealthMonitorManagerTest.java
@@ -7,7 +7,6 @@ import com.yahoo.vespa.applicationmodel.ClusterId;
import com.yahoo.vespa.applicationmodel.ConfigId;
import com.yahoo.vespa.applicationmodel.ServiceStatus;
import com.yahoo.vespa.applicationmodel.ServiceType;
-import com.yahoo.vespa.flags.BooleanFlag;
import com.yahoo.vespa.service.duper.ConfigServerApplication;
import com.yahoo.vespa.service.duper.ControllerHostApplication;
import com.yahoo.vespa.service.duper.DuperModelManager;
@@ -25,7 +24,6 @@ import java.util.stream.Stream;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -33,10 +31,9 @@ import static org.mockito.Mockito.when;
public class HealthMonitorManagerTest {
private final ConfigServerApplication configServerApplication = new ConfigServerApplication();
private final DuperModelManager duperModel = mock(DuperModelManager.class);
- private final BooleanFlag monitorInfra = mock(BooleanFlag.class);
private final ApplicationHealthMonitor monitor = mock(ApplicationHealthMonitor.class);
private final ApplicationHealthMonitorFactory monitorFactory = mock(ApplicationHealthMonitorFactory.class);
- private final HealthMonitorManager manager = new HealthMonitorManager(duperModel, monitorInfra, monitorFactory);
+ private final HealthMonitorManager manager = new HealthMonitorManager(duperModel, monitorFactory);
@Before
public void setUp() {
@@ -45,18 +42,21 @@ public class HealthMonitorManagerTest {
}
@Test
- public void addRemove() {
- when(monitorInfra.value()).thenReturn(false);
+ public void addAndRemove() {
ApplicationInfo applicationInfo = ConfigserverUtil.makeExampleConfigServer();
+ when(duperModel.isSupportedInfraApplication(applicationInfo.getApplicationId())).thenReturn(true);
+
+ verify(monitor, times(0)).monitor(applicationInfo);
manager.applicationActivated(applicationInfo);
verify(monitor, times(1)).monitor(applicationInfo);
+
+ verify(monitor, times(0)).close();
manager.applicationRemoved(applicationInfo.getApplicationId());
verify(monitor, times(1)).close();
}
@Test
public void withHostAdmin() {
- when(monitorInfra.value()).thenReturn(false);
ServiceStatus status = manager.getStatus(
ZoneApplication.ZONE_APPLICATION_ID,
ClusterId.NODE_ADMIN,
@@ -67,23 +67,6 @@ public class HealthMonitorManagerTest {
@Test
public void infrastructureApplication() {
- when(monitorInfra.value()).thenReturn(false);
-
- ProxyHostApplication proxyHostApplication = new ProxyHostApplication();
- when(duperModel.isSupportedInfraApplication(proxyHostApplication.getApplicationId())).thenReturn(true);
- List<HostName> hostnames = Stream.of("proxyhost1", "proxyhost2").map(HostName::from).collect(Collectors.toList());
- ApplicationInfo proxyHostApplicationInfo = proxyHostApplication.makeApplicationInfo(hostnames);
-
- manager.applicationActivated(proxyHostApplicationInfo);
- verify(monitorFactory, never()).create(proxyHostApplicationInfo.getApplicationId());
-
- assertStatus(ServiceStatus.NOT_CHECKED, 0, proxyHostApplication, "proxyhost1");
- }
-
- @Test
- public void infrastructureApplicationWithMonitoring() {
- when(monitorInfra.value()).thenReturn(true);
-
ProxyHostApplication proxyHostApplication = new ProxyHostApplication();
when(duperModel.isSupportedInfraApplication(proxyHostApplication.getApplicationId())).thenReturn(true);
List<HostName> hostnames = Stream.of("proxyhost1", "proxyhost2").map(HostName::from).collect(Collectors.toList());
diff --git a/service-monitor/src/test/java/com/yahoo/vespa/service/model/ApplicationInstanceGeneratorTest.java b/service-monitor/src/test/java/com/yahoo/vespa/service/model/ApplicationInstanceGeneratorTest.java
index bf3f7017b01..68f5aa8c451 100644
--- a/service-monitor/src/test/java/com/yahoo/vespa/service/model/ApplicationInstanceGeneratorTest.java
+++ b/service-monitor/src/test/java/com/yahoo/vespa/service/model/ApplicationInstanceGeneratorTest.java
@@ -1,13 +1,12 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.service.model;
-import com.yahoo.cloud.config.ConfigserverConfig;
import com.yahoo.config.model.api.ApplicationInfo;
+import com.yahoo.config.provision.HostName;
import com.yahoo.config.provision.Zone;
import com.yahoo.vespa.applicationmodel.ApplicationInstance;
import com.yahoo.vespa.applicationmodel.ServiceStatus;
import com.yahoo.vespa.service.duper.ConfigServerApplication;
-import com.yahoo.vespa.service.monitor.ConfigserverUtil;
import com.yahoo.vespa.service.monitor.ServiceStatusProvider;
import org.junit.Test;
@@ -36,14 +35,9 @@ public class ApplicationInstanceGeneratorTest {
@Test
public void toApplicationInstance() {
when(statusProvider.getStatus(any(), any(), any(), any())).thenReturn(ServiceStatus.NOT_CHECKED);
- ConfigserverConfig config = ConfigserverUtil.create(
- true,
- true,
- configServer1,
- configServer2,
- configServer3);
Zone zone = mock(Zone.class);
- ApplicationInfo configServer = configServerApplication.makeApplicationInfoFromConfig(config);
+ ApplicationInfo configServer = configServerApplication.makeApplicationInfo(
+ configServerList.stream().map(HostName::from).collect(Collectors.toList()));
ApplicationInstance applicationInstance = new ApplicationInstanceGenerator(configServer, zone)
.makeApplicationInstance(statusProvider);
diff --git a/service-monitor/src/test/java/com/yahoo/vespa/service/model/ModelGeneratorTest.java b/service-monitor/src/test/java/com/yahoo/vespa/service/model/ModelGeneratorTest.java
index 30a49835f03..b77bdb4e54e 100644
--- a/service-monitor/src/test/java/com/yahoo/vespa/service/model/ModelGeneratorTest.java
+++ b/service-monitor/src/test/java/com/yahoo/vespa/service/model/ModelGeneratorTest.java
@@ -76,7 +76,7 @@ public class ModelGeneratorTest {
private List<ApplicationInfo> getExampleApplicationInfos() {
List<ApplicationInfo> applicationInfos = new ArrayList<>();
ConfigserverConfig config = ConfigserverUtil.createExampleConfigserverConfig();
- applicationInfos.add(new ConfigServerApplication().makeApplicationInfoFromConfig(config));
+ applicationInfos.add(ConfigserverUtil.makeExampleConfigServer());
applicationInfos.addAll(ExampleModel.createExampleSuperModelWithOneRpcPort(HOSTNAME, PORT).getAllApplicationInfos());
return applicationInfos;
}
diff --git a/service-monitor/src/test/java/com/yahoo/vespa/service/monitor/ConfigserverUtil.java b/service-monitor/src/test/java/com/yahoo/vespa/service/monitor/ConfigserverUtil.java
index 7f817a0f1e6..b2e49e7fc94 100644
--- a/service-monitor/src/test/java/com/yahoo/vespa/service/monitor/ConfigserverUtil.java
+++ b/service-monitor/src/test/java/com/yahoo/vespa/service/monitor/ConfigserverUtil.java
@@ -3,8 +3,12 @@ package com.yahoo.vespa.service.monitor;
import com.yahoo.cloud.config.ConfigserverConfig;
import com.yahoo.config.model.api.ApplicationInfo;
+import com.yahoo.config.provision.HostName;
import com.yahoo.vespa.service.duper.ConfigServerApplication;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
/**
* @author hakon
*/
@@ -33,12 +37,9 @@ public class ConfigserverUtil {
String configServerHostname1,
String configServerHostname2,
String configServerHostname3) {
- return new ConfigServerApplication().makeApplicationInfoFromConfig(create(
- true,
- true,
- configServerHostname1,
- configServerHostname2,
- configServerHostname3));
+ return new ConfigServerApplication().makeApplicationInfo(
+ Stream.of(configServerHostname1, configServerHostname2, configServerHostname3)
+ .map(HostName::from).collect(Collectors.toList()));
}
public static ApplicationInfo makeExampleConfigServer() {