@Test void testStore() { List<L10nString> toAdd = singletonList(newString1); List<L10nString> toUpdate = singletonList(enPlusNl); localizationService.store(toUpdate, toAdd); verify(dataService).add(eq(L10N_STRING), addCaptor.capture()); verify(dataService).update(eq(L10N_STRING), updateCaptor.capture()); assertEquals(toAdd, addCaptor.getValue().collect(toList())); assertEquals(toUpdate, updateCaptor.getValue().collect(toList())); }
public void store(Collection<L10nString> toUpdate, Collection<L10nString> toAdd) { dataService.update(L10N_STRING, toUpdate.stream()); dataService.add(L10N_STRING, toAdd.stream()); }
LocalizationService implements MessageResolution { public void store(Collection<L10nString> toUpdate, Collection<L10nString> toAdd) { dataService.update(L10N_STRING, toUpdate.stream()); dataService.add(L10N_STRING, toAdd.stream()); } }
LocalizationService implements MessageResolution { public void store(Collection<L10nString> toUpdate, Collection<L10nString> toAdd) { dataService.update(L10N_STRING, toUpdate.stream()); dataService.add(L10N_STRING, toAdd.stream()); } LocalizationService(DataService dataService, L10nStringFactory l10nStringFactory); }
LocalizationService implements MessageResolution { public void store(Collection<L10nString> toUpdate, Collection<L10nString> toAdd) { dataService.update(L10N_STRING, toUpdate.stream()); dataService.add(L10N_STRING, toAdd.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 { public void store(Collection<L10nString> toUpdate, Collection<L10nString> toAdd) { dataService.update(L10N_STRING, toUpdate.stream()); dataService.add(L10N_STRING, toAdd.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);  }