@Test void testDeleteNamespace() { @SuppressWarnings("unchecked") Query<L10nString> query = mock(Query.class, RETURNS_SELF); when(dataService.query(L10N_STRING, L10nString.class)).thenReturn(query); when(query.eq(NAMESPACE, "test").findAll()).thenReturn(Stream.of(enPlusNl, nlOnly)); localizationService.deleteNamespace("test"); verify(dataService).delete(eq(L10N_STRING), deleteCaptor.capture()); assertEquals(newArrayList(enPlusNl, nlOnly), deleteCaptor.getValue().collect(toList())); }
@Transactional public void deleteNamespace(String namespace) { List<L10nString> namespaceEntities = getL10nStrings(namespace); dataService.delete(L10N_STRING, namespaceEntities.stream()); }
LocalizationService implements MessageResolution { @Transactional public void deleteNamespace(String namespace) { List<L10nString> namespaceEntities = getL10nStrings(namespace); dataService.delete(L10N_STRING, namespaceEntities.stream()); } }
LocalizationService implements MessageResolution { @Transactional public void deleteNamespace(String namespace) { List<L10nString> namespaceEntities = getL10nStrings(namespace); dataService.delete(L10N_STRING, namespaceEntities.stream()); } LocalizationService(DataService dataService, L10nStringFactory l10nStringFactory); }
LocalizationService implements MessageResolution { @Transactional public void deleteNamespace(String namespace) { List<L10nString> namespaceEntities = getL10nStrings(namespace); dataService.delete(L10N_STRING, namespaceEntities.stream()); } LocalizationService(DataService dataService, L10nStringFactory l10nStringFactory); @Override @RunAsSystem String resolveCodeWithoutArguments(String code, Locale locale); @RunAsSystem Map<String, String> getMessages(String namespace, Locale locale); List<String> getAllMessageIds(); Stream<L10nString> getExistingMessages(String namespace, Set<String> messageIds); @Transactional void addMissingMessageIds(String namespace, Set<String> messageIDs); @Transactional void deleteNamespace(String namespace); void store(Collection<L10nString> toUpdate, Collection<L10nString> toAdd); }
LocalizationService implements MessageResolution { @Transactional public void deleteNamespace(String namespace) { List<L10nString> namespaceEntities = getL10nStrings(namespace); dataService.delete(L10N_STRING, namespaceEntities.stream()); } LocalizationService(DataService dataService, L10nStringFactory l10nStringFactory); @Override @RunAsSystem String resolveCodeWithoutArguments(String code, Locale locale); @RunAsSystem Map<String, String> getMessages(String namespace, Locale locale); List<String> getAllMessageIds(); Stream<L10nString> getExistingMessages(String namespace, Set<String> messageIds); @Transactional void addMissingMessageIds(String namespace, Set<String> messageIDs); @Transactional void deleteNamespace(String namespace); void store(Collection<L10nString> toUpdate, Collection<L10nString> toAdd);  }