@Test public void testEmptyUnacceptedMinionFromMaster() throws CloudbreakOrchestratorFailedException { MinionKeysOnMasterResponse response = mock(MinionKeysOnMasterResponse.class); Minion m1 = new Minion(); m1.setHostName("m1"); m1.setDomain("d"); Minion m2 = new Minion(); m2.setHostName("m2"); m2.setDomain("d"); when(response.getAllMinions()).thenReturn(List.of("m2.d", "m1.d")); when(response.getUnacceptedMinions()).thenReturn(List.of()); when(sc.wheel(eq("key.list_all"), isNull(), eq(MinionKeysOnMasterResponse.class))).thenReturn(response); MinionAcceptor underTest = new MinionAcceptor(sc, List.of(m1, m2), new EqualMinionFpMatcher(), new FingerprintFromSbCollector()); underTest.acceptMinions(); }
public void acceptMinions() throws CloudbreakOrchestratorFailedException { List<String> unacceptedMinions = fetchUnacceptedMinionsFromMaster(minions); if (!unacceptedMinions.isEmpty()) { proceedWithAcceptingMinions(unacceptedMinions); } else { LOGGER.info("No unaccepted minions found on master"); } }
MinionAcceptor { public void acceptMinions() throws CloudbreakOrchestratorFailedException { List<String> unacceptedMinions = fetchUnacceptedMinionsFromMaster(minions); if (!unacceptedMinions.isEmpty()) { proceedWithAcceptingMinions(unacceptedMinions); } else { LOGGER.info("No unaccepted minions found on master"); } } }
MinionAcceptor { public void acceptMinions() throws CloudbreakOrchestratorFailedException { List<String> unacceptedMinions = fetchUnacceptedMinionsFromMaster(minions); if (!unacceptedMinions.isEmpty()) { proceedWithAcceptingMinions(unacceptedMinions); } else { LOGGER.info("No unaccepted minions found on master"); } } MinionAcceptor(SaltConnector sc, List<Minion> minions, MinionFingerprintMatcher fingerprintMatcher, FingerprintCollector fingerprintCollector); }
MinionAcceptor { public void acceptMinions() throws CloudbreakOrchestratorFailedException { List<String> unacceptedMinions = fetchUnacceptedMinionsFromMaster(minions); if (!unacceptedMinions.isEmpty()) { proceedWithAcceptingMinions(unacceptedMinions); } else { LOGGER.info("No unaccepted minions found on master"); } } MinionAcceptor(SaltConnector sc, List<Minion> minions, MinionFingerprintMatcher fingerprintMatcher, FingerprintCollector fingerprintCollector); void acceptMinions(); }
MinionAcceptor { public void acceptMinions() throws CloudbreakOrchestratorFailedException { List<String> unacceptedMinions = fetchUnacceptedMinionsFromMaster(minions); if (!unacceptedMinions.isEmpty()) { proceedWithAcceptingMinions(unacceptedMinions); } else { LOGGER.info("No unaccepted minions found on master"); } } MinionAcceptor(SaltConnector sc, List<Minion> minions, MinionFingerprintMatcher fingerprintMatcher, FingerprintCollector fingerprintCollector); void acceptMinions();  }