@Test public void testInvokeAllResultServices() throws Exception { assertEquals(BeanLoader.loadMultipleBeans(InitializingService.class).size(), 3); DatabaseInitializingServiceImpl databaseService = BeanLoader.loadBean(DatabaseInitializingServiceImpl.class); doNothing().when(databaseService).initTestSuite(); GearmanInitializingServiceImpl gearmanService = BeanLoader.loadBean(GearmanInitializingServiceImpl.class); doNothing().when(gearmanService).initTestSuite(); TestSuite testSuite = BeanLoader.loadBean(TestSuite.class); testSuite.setState(null); testSuite.setStartDate(null); InitializingServiceHelper.invokeInitializingServcies(); assertEquals(testSuite.getState(), TestSuiteState.RUNNING); assertTrue(testSuite.getStartDate().before(new DateTime().plusMillis(100).toDate())); verify(databaseService).initTestSuite(); verify(gearmanService).initTestSuite(); }
public static void invokeInitializingServcies() throws FileNotFoundException { BeanLoader.loadMultipleBeans(InitializingService.class).values().stream() .sorted(new PrioritizedServiceComparator<>()) .forEach(s -> { try { s.initTestSuite(); } catch (SakuliInitException e) { throw new SakuliRuntimeException(e); } }); }
InitializingServiceHelper { public static void invokeInitializingServcies() throws FileNotFoundException { BeanLoader.loadMultipleBeans(InitializingService.class).values().stream() .sorted(new PrioritizedServiceComparator<>()) .forEach(s -> { try { s.initTestSuite(); } catch (SakuliInitException e) { throw new SakuliRuntimeException(e); } }); } }
InitializingServiceHelper { public static void invokeInitializingServcies() throws FileNotFoundException { BeanLoader.loadMultipleBeans(InitializingService.class).values().stream() .sorted(new PrioritizedServiceComparator<>()) .forEach(s -> { try { s.initTestSuite(); } catch (SakuliInitException e) { throw new SakuliRuntimeException(e); } }); }  }
InitializingServiceHelper { public static void invokeInitializingServcies() throws FileNotFoundException { BeanLoader.loadMultipleBeans(InitializingService.class).values().stream() .sorted(new PrioritizedServiceComparator<>()) .forEach(s -> { try { s.initTestSuite(); } catch (SakuliInitException e) { throw new SakuliRuntimeException(e); } }); }  static void invokeInitializingServcies(); }
InitializingServiceHelper { public static void invokeInitializingServcies() throws FileNotFoundException { BeanLoader.loadMultipleBeans(InitializingService.class).values().stream() .sorted(new PrioritizedServiceComparator<>()) .forEach(s -> { try { s.initTestSuite(); } catch (SakuliInitException e) { throw new SakuliRuntimeException(e); } }); }  static void invokeInitializingServcies();  }