@Test public void createMessageWhenNoSourceParameterPassed() throws Exception { DocumentReference groupReference = new DocumentReference("wiki", "space", "page"); try { this.mocker.getComponentUnderTest().createMessage(groupReference, Collections.<String, Object>singletonMap("hint", "factoryHint")); fail("Should have thrown an exception"); } catch (MessagingException expected) { assertEquals("The parameter [source] is mandatory.", expected.getMessage()); } }
@Override public Iterator<MimeMessage> createMessage(Object groupReferenceObject, Map<String, Object> parameters) throws MessagingException { DocumentReference groupReference = getTypedSource(groupReferenceObject, DocumentReference.class); validateParameters(parameters, HINT, SOURCE); String factoryHint = (String) parameters.get(HINT); MimeMessageFactory factory = getInternalMimeMessageFactory(factoryHint); GroupMimeMessageIterator iterator = new GroupMimeMessageIterator(groupReference, factory, parameters, this.componentManagerProvider.get()); return iterator; }
GroupMimeMessageFactory extends AbstractIteratorMimeMessageFactory { @Override public Iterator<MimeMessage> createMessage(Object groupReferenceObject, Map<String, Object> parameters) throws MessagingException { DocumentReference groupReference = getTypedSource(groupReferenceObject, DocumentReference.class); validateParameters(parameters, HINT, SOURCE); String factoryHint = (String) parameters.get(HINT); MimeMessageFactory factory = getInternalMimeMessageFactory(factoryHint); GroupMimeMessageIterator iterator = new GroupMimeMessageIterator(groupReference, factory, parameters, this.componentManagerProvider.get()); return iterator; } }
GroupMimeMessageFactory extends AbstractIteratorMimeMessageFactory { @Override public Iterator<MimeMessage> createMessage(Object groupReferenceObject, Map<String, Object> parameters) throws MessagingException { DocumentReference groupReference = getTypedSource(groupReferenceObject, DocumentReference.class); validateParameters(parameters, HINT, SOURCE); String factoryHint = (String) parameters.get(HINT); MimeMessageFactory factory = getInternalMimeMessageFactory(factoryHint); GroupMimeMessageIterator iterator = new GroupMimeMessageIterator(groupReference, factory, parameters, this.componentManagerProvider.get()); return iterator; }  }
GroupMimeMessageFactory extends AbstractIteratorMimeMessageFactory { @Override public Iterator<MimeMessage> createMessage(Object groupReferenceObject, Map<String, Object> parameters) throws MessagingException { DocumentReference groupReference = getTypedSource(groupReferenceObject, DocumentReference.class); validateParameters(parameters, HINT, SOURCE); String factoryHint = (String) parameters.get(HINT); MimeMessageFactory factory = getInternalMimeMessageFactory(factoryHint); GroupMimeMessageIterator iterator = new GroupMimeMessageIterator(groupReference, factory, parameters, this.componentManagerProvider.get()); return iterator; }  @Override Iterator<MimeMessage> createMessage(Object groupReferenceObject, Map<String, Object> parameters); }
GroupMimeMessageFactory extends AbstractIteratorMimeMessageFactory { @Override public Iterator<MimeMessage> createMessage(Object groupReferenceObject, Map<String, Object> parameters) throws MessagingException { DocumentReference groupReference = getTypedSource(groupReferenceObject, DocumentReference.class); validateParameters(parameters, HINT, SOURCE); String factoryHint = (String) parameters.get(HINT); MimeMessageFactory factory = getInternalMimeMessageFactory(factoryHint); GroupMimeMessageIterator iterator = new GroupMimeMessageIterator(groupReference, factory, parameters, this.componentManagerProvider.get()); return iterator; }  @Override Iterator<MimeMessage> createMessage(Object groupReferenceObject, Map<String, Object> parameters);  }