@Test void testTerminateMultiple() { Set<DatabaseServerConfig> serverSet = Set.of(server, server2); when(databaseServerConfigService.getByCrns(any(Set.class))).thenReturn(serverSet); mockTerminationByCrn(SERVER_CRN_STRING, dbStack, server); mockTerminationByCrn(SERVER_2_CRN_STRING, dbStack2, server2); Set<DatabaseServerConfig> terminatingServerSet = underTest.terminateMultipleByCrn(Set.of(SERVER_CRN_STRING, SERVER_2_CRN_STRING), true); assertEquals(serverSet, terminatingServerSet); verifyTermination(1L); verifyTermination(2L); }
public Set<DatabaseServerConfig> terminateMultipleByCrn(Set<String> crns, boolean force) { Set<DatabaseServerConfig> resources = databaseServerConfigService.getByCrns(crns); return resources.stream() .map(server -> terminate(server, force)) .collect(Collectors.toSet()); }
RedbeamsTerminationService { public Set<DatabaseServerConfig> terminateMultipleByCrn(Set<String> crns, boolean force) { Set<DatabaseServerConfig> resources = databaseServerConfigService.getByCrns(crns); return resources.stream() .map(server -> terminate(server, force)) .collect(Collectors.toSet()); } }
RedbeamsTerminationService { public Set<DatabaseServerConfig> terminateMultipleByCrn(Set<String> crns, boolean force) { Set<DatabaseServerConfig> resources = databaseServerConfigService.getByCrns(crns); return resources.stream() .map(server -> terminate(server, force)) .collect(Collectors.toSet()); }  }
RedbeamsTerminationService { public Set<DatabaseServerConfig> terminateMultipleByCrn(Set<String> crns, boolean force) { Set<DatabaseServerConfig> resources = databaseServerConfigService.getByCrns(crns); return resources.stream() .map(server -> terminate(server, force)) .collect(Collectors.toSet()); }  DatabaseServerConfig terminateByCrn(String crn, boolean force); DatabaseServerConfig terminateByName(String environmentCrn, String name, boolean force); Set<DatabaseServerConfig> terminateMultipleByCrn(Set<String> crns, boolean force); }
RedbeamsTerminationService { public Set<DatabaseServerConfig> terminateMultipleByCrn(Set<String> crns, boolean force) { Set<DatabaseServerConfig> resources = databaseServerConfigService.getByCrns(crns); return resources.stream() .map(server -> terminate(server, force)) .collect(Collectors.toSet()); }  DatabaseServerConfig terminateByCrn(String crn, boolean force); DatabaseServerConfig terminateByName(String environmentCrn, String name, boolean force); Set<DatabaseServerConfig> terminateMultipleByCrn(Set<String> crns, boolean force);  }