AppFormerJsActivityLoader implements PlaceManagerImpl.AppFormerActivityLoader { protected void finishLoadingMatchingEditors(final List<Promise<Void>> loadingMatchingEditors, final Runnable successCallback) { this.promises.resolve().then(i -> promises.all(loadingMatchingEditors, identity()).then(s -> { successCallback.run(); return this.promises.resolve(); })).catch_(e -> { return this.promises.resolve(); }); } @Inject  AppFormerJsActivityLoader(final Promises promises,
                                     final ActivityManager activityManager,
                                     final ActivityBeansCache activityBeansCache,
                                     final PlaceManager placeManager,
                                     final LazyLoadingScreen lazyLoadingScreen,
                                     final Event<ActivityLazyLoaded> activityLazyLoadedEvent,
                                     final @Shadowed Instance<JsWorkbenchEditorActivity> jsWorkbenchEditorActivityInstance,
                                     final AppFormerComponentsRegistry appFormerComponentsRegistry); void init(final String gwtModuleName); void onComponentLoaded(final Object jsObject); native String extractComponentId(final Object object); boolean triggerLoadOfMatchingEditors(final Path path,
                                                final Runnable successCallback);  }
@Test public void finishLoadingMatchingEditors_success() { final List<Promise<Void>> ps = asList(promises.resolve(), promises.resolve()); final AtomicBoolean pass = new AtomicBoolean(false); appFormerJsActivityLoader.finishLoadingMatchingEditors(ps, () -> pass.set(true)); assertTrue(pass.get()); }
@Test public void finishLoadingMatchingEditors_failure() { final List<Promise<Void>> ps = asList(promises.resolve(), promises.reject(null)); appFormerJsActivityLoader.finishLoadingMatchingEditors(ps, Assert::fail); }