@Test public void testCreateRegistry() { final CommandRegistryHolder registryHolder = mock(CommandRegistryHolder.class); final Registry registry = mock(Registry.class); when(registryHolders.get()).thenReturn(registryHolder); when(registryHolder.getRegistry()).thenReturn(registry); final Registry createdRegistry = provider.createRegistry(); assertEquals(registry, createdRegistry); verify(createdRegistry, never()).setRegistryChangeListener(any()); }
Registry<Command<AbstractCanvasHandler, CanvasViolation>> createRegistry() { final Registry<Command<AbstractCanvasHandler, CanvasViolation>> commandRegistry = registryHolders.get().getRegistry(); if (!Objects.isNull(registryChangeListener)) { commandRegistry.setRegistryChangeListener(registryChangeListener); } return commandRegistry; }
RegistryProvider { Registry<Command<AbstractCanvasHandler, CanvasViolation>> createRegistry() { final Registry<Command<AbstractCanvasHandler, CanvasViolation>> commandRegistry = registryHolders.get().getRegistry(); if (!Objects.isNull(registryChangeListener)) { commandRegistry.setRegistryChangeListener(registryChangeListener); } return commandRegistry; } }
RegistryProvider { Registry<Command<AbstractCanvasHandler, CanvasViolation>> createRegistry() { final Registry<Command<AbstractCanvasHandler, CanvasViolation>> commandRegistry = registryHolders.get().getRegistry(); if (!Objects.isNull(registryChangeListener)) { commandRegistry.setRegistryChangeListener(registryChangeListener); } return commandRegistry; } @Inject  RegistryProvider(final ManagedInstance<CommandRegistryHolder> registryHolders,
                            final GraphsProvider graphsProvider); }
RegistryProvider { Registry<Command<AbstractCanvasHandler, CanvasViolation>> createRegistry() { final Registry<Command<AbstractCanvasHandler, CanvasViolation>> commandRegistry = registryHolders.get().getRegistry(); if (!Objects.isNull(registryChangeListener)) { commandRegistry.setRegistryChangeListener(registryChangeListener); } return commandRegistry; } @Inject  RegistryProvider(final ManagedInstance<CommandRegistryHolder> registryHolders,
                            final GraphsProvider graphsProvider); Registry<Command<AbstractCanvasHandler, CanvasViolation>> getCurrentCommandRegistry(); void setRegistryChangeListener(final RegistryChangeListener registryChangeListener); }
RegistryProvider { Registry<Command<AbstractCanvasHandler, CanvasViolation>> createRegistry() { final Registry<Command<AbstractCanvasHandler, CanvasViolation>> commandRegistry = registryHolders.get().getRegistry(); if (!Objects.isNull(registryChangeListener)) { commandRegistry.setRegistryChangeListener(registryChangeListener); } return commandRegistry; } @Inject  RegistryProvider(final ManagedInstance<CommandRegistryHolder> registryHolders,
                            final GraphsProvider graphsProvider); Registry<Command<AbstractCanvasHandler, CanvasViolation>> getCurrentCommandRegistry(); void setRegistryChangeListener(final RegistryChangeListener registryChangeListener);  }