DeploymentMetricsRetriever { public DeploymentMetricsResponse getMetrics(Application application) { var hosts = getHostsOfApplication(application); var clusterMetrics = metricsRetriever.requestMetricsGroupedByCluster(hosts); return new DeploymentMetricsResponse(200, application.getId(), clusterMetrics); } DeploymentMetricsRetriever();  DeploymentMetricsRetriever(ClusterDeploymentMetricsRetriever metricsRetriever); DeploymentMetricsResponse getMetrics(Application application);  }
@Test public void getMetrics() { MockModel mockModel = new MockModel(mockHosts()); MockDeploymentMetricsRetriever mockMetricsRetriever = new MockDeploymentMetricsRetriever(); Application application = new Application(mockModel, null, 0, false, null, null, ApplicationId.fromSerializedForm("tenant:app:instance")); DeploymentMetricsRetriever clusterMetricsRetriever = new DeploymentMetricsRetriever(mockMetricsRetriever); clusterMetricsRetriever.getMetrics(application); assertEquals(2, mockMetricsRetriever.hosts.size()); }