### Question:
DefaultMailSenderConfiguration implements MailSenderConfiguration { @Override public String getFromAddress() { String from = this.currentWikiMailConfigSource.getProperty(FROM_PROPERTY, String.class); if (from == null && !isMainWiki()) { from = this.mainWikiMailConfigSource.getProperty(FROM_PROPERTY, String.class); } if (from == null) { from = this.xwikiPropertiesSource.getProperty(PREFIX + FROM_PROPERTY, String.class); } return from; }  @Override String getHost(); @Override int getPort(); @Override String getUsername(); @Override String getPassword(); @Override List<String> getBCCAddresses(); @Override String getFromAddress(); @Override Properties getAdditionalProperties(); @Override Properties getAllProperties(); @Override boolean usesAuthentication(); @Override String getScriptServicePermissionCheckerHint(); @Override long getSendWaitTime(); @Override int getPrepareQueueCapacity(); @Override int getSendQueueCapacity(); static final String JAVAMAIL_TRANSPORT_PROTOCOL; static final String JAVAMAIL_SMTP_HOST; static final String JAVAMAIL_SMTP_PORT; static final String JAVAMAIL_SMTP_USERNAME; static final String JAVAMAIL_SMTP_AUTH; }### Answer:
@Test public void getFromAddressWhenNotConfigured() { assertNull(this.configuration.getFromAddress()); }
@Test public void getFromAddressWhenDefinedInXWikiProperties() { when(this.xwikiPropertiesSource.getProperty("mail.sender.from", String.class)).thenReturn("john@doe.com"); assertEquals("john@doe.com", this.configuration.getFromAddress()); }
@Test public void getFromAddressFromMailConfigDocumentInMainWiki() { when(this.mailConfigDocumentSource.getProperty("from", String.class)).thenReturn("john@doe.com"); assertEquals("john@doe.com", this.configuration.getFromAddress()); }