@Test void testDeleteById() { String pluginId = "myPluginId"; String menu = "{\"type\":\"menu\",\"id\":\"main\",\"items\":[{\"type\":\"plugin\",\"id\":\"myPluginId\"}]}"; when(appSettings.getMenu()).thenReturn(menu); pluginRepositoryDecorator.deleteById(pluginId); verify(delegateRepository).deleteById(pluginId); verify(appSettings).setMenu("{\"type\":\"menu\",\"id\":\"main\",\"items\":[]}"); }
@Override public void deleteById(Object id) { super.deleteById(id); deleteMenuEntriesById(id); }
PluginRepositoryDecorator extends AbstractRepositoryDecorator<Plugin> { @Override public void deleteById(Object id) { super.deleteById(id); deleteMenuEntriesById(id); } }
PluginRepositoryDecorator extends AbstractRepositoryDecorator<Plugin> { @Override public void deleteById(Object id) { super.deleteById(id); deleteMenuEntriesById(id); } PluginRepositoryDecorator(Repository<Plugin> delegateRepository, AppSettings appSettings); }
PluginRepositoryDecorator extends AbstractRepositoryDecorator<Plugin> { @Override public void deleteById(Object id) { super.deleteById(id); deleteMenuEntriesById(id); } PluginRepositoryDecorator(Repository<Plugin> delegateRepository, AppSettings appSettings); @Override void delete(Plugin plugin); @Override void deleteById(Object id); @Override void deleteAll(); @Override void delete(Stream<Plugin> pluginStream); @Override void deleteAll(Stream<Object> ids); }
PluginRepositoryDecorator extends AbstractRepositoryDecorator<Plugin> { @Override public void deleteById(Object id) { super.deleteById(id); deleteMenuEntriesById(id); } PluginRepositoryDecorator(Repository<Plugin> delegateRepository, AppSettings appSettings); @Override void delete(Plugin plugin); @Override void deleteById(Object id); @Override void deleteAll(); @Override void delete(Stream<Plugin> pluginStream); @Override void deleteAll(Stream<Object> ids);  }