### Question:
DefaultGeneralMailConfiguration implements GeneralMailConfiguration { @Override public boolean shouldObfuscate() { Boolean obfuscateEmailAddresses = this.currentWikiMailConfigSource.getProperty(OBFUSCATE_EMAIL_ADDRESSES, Boolean.class); if (obfuscateEmailAddresses == null && !isMainWiki()) { obfuscateEmailAddresses = this.mainWikiMailConfigSource.getProperty(OBFUSCATE_EMAIL_ADDRESSES, Boolean.class); } if (obfuscateEmailAddresses == null) { obfuscateEmailAddresses = this.xwikiPropertiesSource.getProperty(PREFIX + OBFUSCATE_EMAIL_ADDRESSES, DEFAULT_OBFUSCATE_EMAIL_ADDRESSES); } return obfuscateEmailAddresses; }  @Override boolean shouldObfuscate();  }### Answer:
@Test public void shouldObfuscateWhenNotConfigured() { when(this.xwikiPropertiesSource.getProperty("mail.general.obfuscate", false)).thenReturn(false); assertFalse(this.configuration.shouldObfuscate()); }
@Test public void shouldObfuscateWhenDefinedInXWikiProperties() { when(this.xwikiPropertiesSource.getProperty("mail.general.obfuscate", false)).thenReturn(true); assertTrue(this.configuration.shouldObfuscate()); }
@Test public void shouldObfuscateFromMailConfigDocumentInMainWiki() { when(this.currentWikiMailConfigDocumentSource.getProperty("obfuscate", Boolean.class)) .thenReturn(true); assertTrue(this.configuration.shouldObfuscate()); }