RuntimeInfoServiceImpl implements RuntimeInfoService { @Override public Optional<DashboardInfo> dashboardInfo(String modelId) { return registry.get(modelId) .map(model -> new DashboardInfo(modelId, perspectives(model))); }  @Override DashbuilderRuntimeInfo info(); @Override Optional<DashboardInfo> dashboardInfo(String modelId);  }
@Test public void testDashboardInfoWithFoundModel() { Optional<DashboardInfo> dashboardInfoOp = runtimeInfoService.dashboardInfo(RUNTIME_MODEL_ID); DashboardInfo dashboardInfo = dashboardInfoOp.get(); assertEquals(1, dashboardInfo.getPages().size()); assertTrue(dashboardInfo.getPages().contains(LT_NAME)); assertEquals(RUNTIME_MODEL_ID, dashboardInfo.getRuntimeModelId()); }
@Test public void testDashboardInfoWithNotFoundModel() { Optional<DashboardInfo> dashboardInfoOp = runtimeInfoService.dashboardInfo(NOT_FOUND_ID); assertFalse(dashboardInfoOp.isPresent()); }