@Test public void testInit() { spyWatcher.init(); verify(spyWatcher, times(unattachedBinding.size())) .registerApplicationStopper(any(SpaceEnrollerConfig.class), anyString(), anyString()); verify(spyWatcher, times(serviceIds.size())).registerSpaceEnroller(any(SpaceEnrollerConfig.class)); }
@PostConstruct public void init() { log.debug("Initializer watchers for every app already enrolled (except if handle by another instance of " + "autosleep)"); bindingRepository.findAllByResourceType(Application).forEach(applicationBinding -> { SpaceEnrollerConfig spaceEnrollerConfig = spaceEnrollerConfigRepository.findOne(applicationBinding.getServiceInstanceId()); if (spaceEnrollerConfig != null) { registerApplicationStopper(spaceEnrollerConfig, applicationBinding.getResourceId(), applicationBinding.getServiceBindingId()); } }); spaceEnrollerConfigRepository.findAll().forEach(this::registerSpaceEnroller); }
WorkerManager implements WorkerManagerService { @PostConstruct public void init() { log.debug("Initializer watchers for every app already enrolled (except if handle by another instance of " + "autosleep)"); bindingRepository.findAllByResourceType(Application).forEach(applicationBinding -> { SpaceEnrollerConfig spaceEnrollerConfig = spaceEnrollerConfigRepository.findOne(applicationBinding.getServiceInstanceId()); if (spaceEnrollerConfig != null) { registerApplicationStopper(spaceEnrollerConfig, applicationBinding.getResourceId(), applicationBinding.getServiceBindingId()); } }); spaceEnrollerConfigRepository.findAll().forEach(this::registerSpaceEnroller); } }
WorkerManager implements WorkerManagerService { @PostConstruct public void init() { log.debug("Initializer watchers for every app already enrolled (except if handle by another instance of " + "autosleep)"); bindingRepository.findAllByResourceType(Application).forEach(applicationBinding -> { SpaceEnrollerConfig spaceEnrollerConfig = spaceEnrollerConfigRepository.findOne(applicationBinding.getServiceInstanceId()); if (spaceEnrollerConfig != null) { registerApplicationStopper(spaceEnrollerConfig, applicationBinding.getResourceId(), applicationBinding.getServiceBindingId()); } }); spaceEnrollerConfigRepository.findAll().forEach(this::registerSpaceEnroller); }  }
WorkerManager implements WorkerManagerService { @PostConstruct public void init() { log.debug("Initializer watchers for every app already enrolled (except if handle by another instance of " + "autosleep)"); bindingRepository.findAllByResourceType(Application).forEach(applicationBinding -> { SpaceEnrollerConfig spaceEnrollerConfig = spaceEnrollerConfigRepository.findOne(applicationBinding.getServiceInstanceId()); if (spaceEnrollerConfig != null) { registerApplicationStopper(spaceEnrollerConfig, applicationBinding.getResourceId(), applicationBinding.getServiceBindingId()); } }); spaceEnrollerConfigRepository.findAll().forEach(this::registerSpaceEnroller); }  @PostConstruct void init(); @Override void registerApplicationStopper(SpaceEnrollerConfig config, String applicationId, String appBindingId); @Override void registerSpaceEnroller(SpaceEnrollerConfig service); }
WorkerManager implements WorkerManagerService { @PostConstruct public void init() { log.debug("Initializer watchers for every app already enrolled (except if handle by another instance of " + "autosleep)"); bindingRepository.findAllByResourceType(Application).forEach(applicationBinding -> { SpaceEnrollerConfig spaceEnrollerConfig = spaceEnrollerConfigRepository.findOne(applicationBinding.getServiceInstanceId()); if (spaceEnrollerConfig != null) { registerApplicationStopper(spaceEnrollerConfig, applicationBinding.getResourceId(), applicationBinding.getServiceBindingId()); } }); spaceEnrollerConfigRepository.findAll().forEach(this::registerSpaceEnroller); }  @PostConstruct void init(); @Override void registerApplicationStopper(SpaceEnrollerConfig config, String applicationId, String appBindingId); @Override void registerSpaceEnroller(SpaceEnrollerConfig service);  }