@Test public void shouldOnlySetBundleOnI18nMessagesThatHasNotBeenSetBefore() throws Exception { I18nMessage message = mock(I18nMessage.class); when(message.hasBundle()).thenReturn(true); validator.add(message); verify(message, never()).setBundle(any(ResourceBundle.class)); }
public void add(Message message) { if (message instanceof I18nMessage && !((I18nMessage) message).hasBundle()) { ((I18nMessage) message).setLazyBundle(new LocalizationSupplier()); } errors.add(message); }
DefaultValidator extends AbstractValidator { public void add(Message message) { if (message instanceof I18nMessage && !((I18nMessage) message).hasBundle()) { ((I18nMessage) message).setLazyBundle(new LocalizationSupplier()); } errors.add(message); } }
DefaultValidator extends AbstractValidator { public void add(Message message) { if (message instanceof I18nMessage && !((I18nMessage) message).hasBundle()) { ((I18nMessage) message).setLazyBundle(new LocalizationSupplier()); } errors.add(message); } DefaultValidator(); @Inject  DefaultValidator(Result result, ValidationViewsFactory factory, Outjector outjector, Proxifier proxifier, BeanValidator beanValidator, Localization localization); }
DefaultValidator extends AbstractValidator { public void add(Message message) { if (message instanceof I18nMessage && !((I18nMessage) message).hasBundle()) { ((I18nMessage) message).setLazyBundle(new LocalizationSupplier()); } errors.add(message); } DefaultValidator(); @Inject  DefaultValidator(Result result, ValidationViewsFactory factory, Outjector outjector, Proxifier proxifier, BeanValidator beanValidator, Localization localization); void checking(Validations validations); void validate(Object object, Class<?>... groups); void validateProperties(Object object, String... properties); void validateProperty(Object object, String property, Class<?>... groups); T onErrorUse(Class<T> view); void addAll(Collection<? extends Message> messages); void add(Message message); boolean hasErrors(); List<Message> getErrors(); }
DefaultValidator extends AbstractValidator { public void add(Message message) { if (message instanceof I18nMessage && !((I18nMessage) message).hasBundle()) { ((I18nMessage) message).setLazyBundle(new LocalizationSupplier()); } errors.add(message); } DefaultValidator(); @Inject  DefaultValidator(Result result, ValidationViewsFactory factory, Outjector outjector, Proxifier proxifier, BeanValidator beanValidator, Localization localization); void checking(Validations validations); void validate(Object object, Class<?>... groups); void validateProperties(Object object, String... properties); void validateProperty(Object object, String property, Class<?>... groups); T onErrorUse(Class<T> view); void addAll(Collection<? extends Message> messages); void add(Message message); boolean hasErrors(); List<Message> getErrors();  }