MailNotifier implements RepositoryChangeListener { protected String formatSubject(final String subject, final long revision, final RepositoryName repositoryName) { String result = subject; result = result.replace(REVISION_TOKEN, String.valueOf(revision)); result = result.replace(NAME_TOKEN, repositoryName.toString()); return result; }  @PostConstruct void init(); @Override void update(final RevisionUpdate revisionUpdate); void setBaseURL(final String baseURL); void setDateFormat(final String dateFormat); void setHost(final String host); void setPort(final int port); void setFrom(final String from); void setSubject(final String subject); void setReceivers(final List<String> receivers); void setAuth(final boolean auth); void setSsl(final boolean ssl); void setUser(final String user); void setPassword(final String password); void setRevisionCountThreshold(final int revisionCountThreshold); void setApplication(final Application application);  }
@Test public void testFormatSubject() throws Exception { final MailNotifier mailNotifier = new MailNotifier(); assertEquals("testRepos - revision 123", mailNotifier.formatSubject( "@@repositoryName@@ - revision @@revision@@", 123, new RepositoryName("testRepos"))); }