@Test @SuppressWarnings("unchecked") public void testLoad() { ParameterizedCommand<StunnerPreferences> completeCallback = mock(ParameterizedCommand.class); ParameterizedCommand<Throwable> errorCallback = mock(ParameterizedCommand.class); sessionLoader.load(metadata, completeCallback, errorCallback); verify(initializerInstances, times(1)).select(eq(DefinitionManager.DEFAULT_QUALIFIER)); verify(initializerInstances, times(1)).select(eq(qualifier)); verify(initializer, times(1)).init(eq(metadata), any(Command.class)); }
public void load(final Metadata metadata, final ParameterizedCommand<StunnerPreferences> completeCallback, final ParameterizedCommand<Throwable> errorCallback) { final String definitionSetId = metadata.getDefinitionSetId(); final Annotation qualifier = definitionUtils.getQualifier(definitionSetId); preferencesRegistryLoader.load(metadata, prefs -> { loadInitializers(metadata, qualifier, () -> { completeCallback.execute(prefs); }); }, errorCallback); }
SessionLoader { public void load(final Metadata metadata, final ParameterizedCommand<StunnerPreferences> completeCallback, final ParameterizedCommand<Throwable> errorCallback) { final String definitionSetId = metadata.getDefinitionSetId(); final Annotation qualifier = definitionUtils.getQualifier(definitionSetId); preferencesRegistryLoader.load(metadata, prefs -> { loadInitializers(metadata, qualifier, () -> { completeCallback.execute(prefs); }); }, errorCallback); } }
SessionLoader { public void load(final Metadata metadata, final ParameterizedCommand<StunnerPreferences> completeCallback, final ParameterizedCommand<Throwable> errorCallback) { final String definitionSetId = metadata.getDefinitionSetId(); final Annotation qualifier = definitionUtils.getQualifier(definitionSetId); preferencesRegistryLoader.load(metadata, prefs -> { loadInitializers(metadata, qualifier, () -> { completeCallback.execute(prefs); }); }, errorCallback); } @Inject  SessionLoader(final DefinitionUtils definitionUtils,
                         final StunnerPreferencesRegistryLoader preferencesRegistryLoader,
                         final @Any ManagedInstance<SessionInitializer> beanInstances); }
SessionLoader { public void load(final Metadata metadata, final ParameterizedCommand<StunnerPreferences> completeCallback, final ParameterizedCommand<Throwable> errorCallback) { final String definitionSetId = metadata.getDefinitionSetId(); final Annotation qualifier = definitionUtils.getQualifier(definitionSetId); preferencesRegistryLoader.load(metadata, prefs -> { loadInitializers(metadata, qualifier, () -> { completeCallback.execute(prefs); }); }, errorCallback); } @Inject  SessionLoader(final DefinitionUtils definitionUtils,
                         final StunnerPreferencesRegistryLoader preferencesRegistryLoader,
                         final @Any ManagedInstance<SessionInitializer> beanInstances); void load(final Metadata metadata,
                     final ParameterizedCommand<StunnerPreferences> completeCallback,
                     final ParameterizedCommand<Throwable> errorCallback); void destroy(); }
SessionLoader { public void load(final Metadata metadata, final ParameterizedCommand<StunnerPreferences> completeCallback, final ParameterizedCommand<Throwable> errorCallback) { final String definitionSetId = metadata.getDefinitionSetId(); final Annotation qualifier = definitionUtils.getQualifier(definitionSetId); preferencesRegistryLoader.load(metadata, prefs -> { loadInitializers(metadata, qualifier, () -> { completeCallback.execute(prefs); }); }, errorCallback); } @Inject  SessionLoader(final DefinitionUtils definitionUtils,
                         final StunnerPreferencesRegistryLoader preferencesRegistryLoader,
                         final @Any ManagedInstance<SessionInitializer> beanInstances); void load(final Metadata metadata,
                     final ParameterizedCommand<StunnerPreferences> completeCallback,
                     final ParameterizedCommand<Throwable> errorCallback); void destroy();  }