summaryrefslogtreecommitdiffstats
path: root/service-monitor/src/test/java/com/yahoo/vespa/service/monitor/internal/DuperModelTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'service-monitor/src/test/java/com/yahoo/vespa/service/monitor/internal/DuperModelTest.java')
-rw-r--r--service-monitor/src/test/java/com/yahoo/vespa/service/monitor/internal/DuperModelTest.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/service-monitor/src/test/java/com/yahoo/vespa/service/monitor/internal/DuperModelTest.java b/service-monitor/src/test/java/com/yahoo/vespa/service/monitor/internal/DuperModelTest.java
index 0a68b4b0ff7..2385cca8f25 100644
--- a/service-monitor/src/test/java/com/yahoo/vespa/service/monitor/internal/DuperModelTest.java
+++ b/service-monitor/src/test/java/com/yahoo/vespa/service/monitor/internal/DuperModelTest.java
@@ -27,7 +27,7 @@ public class DuperModelTest {
@Test
public void toApplicationInstance() {
when(statusProvider.getStatus(any(), any(), any(), any())).thenReturn(ServiceStatus.NOT_CHECKED);
- ConfigserverConfig config = ConfigserverUtil.createExampleConfigserverConfig(true);
+ ConfigserverConfig config = ConfigserverUtil.createExampleConfigserverConfig();
DuperModel duperModel = new DuperModel(config);
SuperModel superModel = mock(SuperModel.class);
ApplicationInfo superModelApplicationInfo = mock(ApplicationInfo.class);
@@ -37,4 +37,17 @@ public class DuperModelTest {
assertEquals(ConfigServerApplication.CONFIG_SERVER_APPLICATION.getApplicationId(), applicationInfos.get(0).getApplicationId());
assertSame(superModelApplicationInfo, applicationInfos.get(1));
}
+
+ @Test
+ public void toApplicationInstanceInSingleTenantMode() {
+ when(statusProvider.getStatus(any(), any(), any(), any())).thenReturn(ServiceStatus.NOT_CHECKED);
+ ConfigserverConfig config = ConfigserverUtil.createExampleConfigserverConfig();
+ DuperModel duperModel = new DuperModel(config);
+ SuperModel superModel = mock(SuperModel.class);
+ ApplicationInfo superModelApplicationInfo = mock(ApplicationInfo.class);
+ when(superModel.getAllApplicationInfos()).thenReturn(Collections.singletonList(superModelApplicationInfo));
+ List<ApplicationInfo> applicationInfos = duperModel.getApplicationInfos(superModel);
+ assertEquals(1, applicationInfos.size());
+ assertSame(superModelApplicationInfo, applicationInfos.get(0));
+ }
}