imh.curate(activeIntegrationIds);
@Test public void testDeletedIntegrationsCurator() throws IOException, ParseException { String integrationId = "intId1"; Set<String> livePodIds = new HashSet<String>( Arrays.asList("pod1", "pod2")); Map<String,RawMetrics> metrics = jsondbRM.getRawMetrics(integrationId); IntegrationMetricsSummary summary = intMH.compute(integrationId, metrics, livePodIds); dataManager.create(summary); assertThat(metrics.size()).isEqualTo(3); assertThat(dataManager.fetchAll(IntegrationMetricsSummary.class).getTotalCount()).isEqualTo(1); //Now pretend to delete the integration itself and //run the curator with no active integrations jsondbRM.curate(new HashSet<String>()); intMH.curate(new HashSet<String>()); //expect all metrics to be deleted Map<String,RawMetrics> metricsAfter = jsondbRM.getRawMetrics(integrationId); assertThat(metricsAfter.size()).isEqualTo(0); assertThat(dataManager.fetchAll(IntegrationMetricsSummary.class).getTotalCount()).isEqualTo(0); } }