@Test public void testAnyExceptionConverted() { when(sc.collectFingerPrints(any(FingerprintRequest.class))).thenThrow(new RuntimeException("random")); assertThrows(CloudbreakOrchestratorFailedException.class, () -> underTest.collectFingerprintFromMinions(sc, List.of())); }
public FingerprintsResponse collectFingerprintFromMinions(SaltConnector sc, List<Minion> minionsToAccept) throws CloudbreakOrchestratorFailedException { FingerprintsResponse fingerprintsResponse; try { fingerprintsResponse = sc.collectFingerPrints(new FingerprintRequest(minionsToAccept)); } catch (Exception e) { LOGGER.error("Couldn't collect fingerprints for minions: {}", minionsToAccept, e); throw new CloudbreakOrchestratorFailedException("Couldn't collect fingerprints for minions", e); } validateFingerprintResponse(minionsToAccept, fingerprintsResponse); return fingerprintsResponse; }
FingerprintFromSbCollector implements FingerprintCollector { public FingerprintsResponse collectFingerprintFromMinions(SaltConnector sc, List<Minion> minionsToAccept) throws CloudbreakOrchestratorFailedException { FingerprintsResponse fingerprintsResponse; try { fingerprintsResponse = sc.collectFingerPrints(new FingerprintRequest(minionsToAccept)); } catch (Exception e) { LOGGER.error("Couldn't collect fingerprints for minions: {}", minionsToAccept, e); throw new CloudbreakOrchestratorFailedException("Couldn't collect fingerprints for minions", e); } validateFingerprintResponse(minionsToAccept, fingerprintsResponse); return fingerprintsResponse; } }
FingerprintFromSbCollector implements FingerprintCollector { public FingerprintsResponse collectFingerprintFromMinions(SaltConnector sc, List<Minion> minionsToAccept) throws CloudbreakOrchestratorFailedException { FingerprintsResponse fingerprintsResponse; try { fingerprintsResponse = sc.collectFingerPrints(new FingerprintRequest(minionsToAccept)); } catch (Exception e) { LOGGER.error("Couldn't collect fingerprints for minions: {}", minionsToAccept, e); throw new CloudbreakOrchestratorFailedException("Couldn't collect fingerprints for minions", e); } validateFingerprintResponse(minionsToAccept, fingerprintsResponse); return fingerprintsResponse; }  }
FingerprintFromSbCollector implements FingerprintCollector { public FingerprintsResponse collectFingerprintFromMinions(SaltConnector sc, List<Minion> minionsToAccept) throws CloudbreakOrchestratorFailedException { FingerprintsResponse fingerprintsResponse; try { fingerprintsResponse = sc.collectFingerPrints(new FingerprintRequest(minionsToAccept)); } catch (Exception e) { LOGGER.error("Couldn't collect fingerprints for minions: {}", minionsToAccept, e); throw new CloudbreakOrchestratorFailedException("Couldn't collect fingerprints for minions", e); } validateFingerprintResponse(minionsToAccept, fingerprintsResponse); return fingerprintsResponse; }  FingerprintsResponse collectFingerprintFromMinions(SaltConnector sc, List<Minion> minionsToAccept); }
FingerprintFromSbCollector implements FingerprintCollector { public FingerprintsResponse collectFingerprintFromMinions(SaltConnector sc, List<Minion> minionsToAccept) throws CloudbreakOrchestratorFailedException { FingerprintsResponse fingerprintsResponse; try { fingerprintsResponse = sc.collectFingerPrints(new FingerprintRequest(minionsToAccept)); } catch (Exception e) { LOGGER.error("Couldn't collect fingerprints for minions: {}", minionsToAccept, e); throw new CloudbreakOrchestratorFailedException("Couldn't collect fingerprints for minions", e); } validateFingerprintResponse(minionsToAccept, fingerprintsResponse); return fingerprintsResponse; }  FingerprintsResponse collectFingerprintFromMinions(SaltConnector sc, List<Minion> minionsToAccept);  }