@Test public void createMessageWhenNullParametersPassed() throws Exception { try { this.mocker.getComponentUnderTest().createMessage(Collections.<String, Object>emptyMap(), null); fail("Should have thrown an exception"); } catch (MessagingException expected) { assertEquals("You must pass parameters for this Mime Message Factory to work!", expected.getMessage()); } }
@Override public Iterator<MimeMessage> createMessage(Object sourceObject, Map<String, Object> parameters) throws MessagingException { Map<String, Object> source = getTypedSource(sourceObject, Map.class); validateParameters(parameters, HINT, SOURCE); String factoryHint = (String) parameters.get(HINT); MimeMessageFactory factory = getInternalMimeMessageFactory(factoryHint); UsersAndGroupsMimeMessageIterator iterator = new UsersAndGroupsMimeMessageIterator(source, factory, parameters, this.explicitDocumentReferenceResolver, this.execution); return iterator; }
UsersAndGroupsMimeMessageFactory extends AbstractIteratorMimeMessageFactory { @Override public Iterator<MimeMessage> createMessage(Object sourceObject, Map<String, Object> parameters) throws MessagingException { Map<String, Object> source = getTypedSource(sourceObject, Map.class); validateParameters(parameters, HINT, SOURCE); String factoryHint = (String) parameters.get(HINT); MimeMessageFactory factory = getInternalMimeMessageFactory(factoryHint); UsersAndGroupsMimeMessageIterator iterator = new UsersAndGroupsMimeMessageIterator(source, factory, parameters, this.explicitDocumentReferenceResolver, this.execution); return iterator; } }
UsersAndGroupsMimeMessageFactory extends AbstractIteratorMimeMessageFactory { @Override public Iterator<MimeMessage> createMessage(Object sourceObject, Map<String, Object> parameters) throws MessagingException { Map<String, Object> source = getTypedSource(sourceObject, Map.class); validateParameters(parameters, HINT, SOURCE); String factoryHint = (String) parameters.get(HINT); MimeMessageFactory factory = getInternalMimeMessageFactory(factoryHint); UsersAndGroupsMimeMessageIterator iterator = new UsersAndGroupsMimeMessageIterator(source, factory, parameters, this.explicitDocumentReferenceResolver, this.execution); return iterator; }  }
UsersAndGroupsMimeMessageFactory extends AbstractIteratorMimeMessageFactory { @Override public Iterator<MimeMessage> createMessage(Object sourceObject, Map<String, Object> parameters) throws MessagingException { Map<String, Object> source = getTypedSource(sourceObject, Map.class); validateParameters(parameters, HINT, SOURCE); String factoryHint = (String) parameters.get(HINT); MimeMessageFactory factory = getInternalMimeMessageFactory(factoryHint); UsersAndGroupsMimeMessageIterator iterator = new UsersAndGroupsMimeMessageIterator(source, factory, parameters, this.explicitDocumentReferenceResolver, this.execution); return iterator; }  @Override Iterator<MimeMessage> createMessage(Object sourceObject, Map<String, Object> parameters); }
UsersAndGroupsMimeMessageFactory extends AbstractIteratorMimeMessageFactory { @Override public Iterator<MimeMessage> createMessage(Object sourceObject, Map<String, Object> parameters) throws MessagingException { Map<String, Object> source = getTypedSource(sourceObject, Map.class); validateParameters(parameters, HINT, SOURCE); String factoryHint = (String) parameters.get(HINT); MimeMessageFactory factory = getInternalMimeMessageFactory(factoryHint); UsersAndGroupsMimeMessageIterator iterator = new UsersAndGroupsMimeMessageIterator(source, factory, parameters, this.explicitDocumentReferenceResolver, this.execution); return iterator; }  @Override Iterator<MimeMessage> createMessage(Object sourceObject, Map<String, Object> parameters);  }