ProtonMetricsRetriever { public ProtonMetricsResponse getMetrics(Application application) { var hosts = getHostsOfApplication(application); var clusterMetrics = metricsRetriever.requestMetricsGroupedByCluster(hosts); return new ProtonMetricsResponse(200, application.getId(), clusterMetrics); } ProtonMetricsRetriever();  ProtonMetricsRetriever(ClusterProtonMetricsRetriever metricsRetriever); ProtonMetricsResponse getMetrics(Application application);  }
@Test public void getMetrics() { ProtonMetricsRetrieverTest.MockModel mockModel = new MockModel(mockHosts()); ProtonMetricsRetrieverTest.MockProtonMetricsRetriever mockMetricsRetriever = new MockProtonMetricsRetriever(); Application application = new Application(mockModel, null, 0, false, null, null, ApplicationId.fromSerializedForm("tenant:app:instance")); ProtonMetricsRetriever clusterMetricsRetriever = new ProtonMetricsRetriever(mockMetricsRetriever); clusterMetricsRetriever.getMetrics(application); assertEquals(1, mockMetricsRetriever.hosts.size()); }