FormattedFilenameCreator implements FileNameCreator { @Override public String createName(AdaptrisMessage msg) { return String.format(msg.resolve(getFilenameFormat()), msg.getUniqueId(), new Date()); } FormattedFilenameCreator(); @Override String createName(AdaptrisMessage msg); String getFilenameFormat(); void setFilenameFormat(String s);  }
@Test public void testPlain() throws Exception { FormattedFilenameCreator creator = new FormattedFilenameCreator(); AdaptrisMessage msg = new DefaultMessageFactory().newMessage(""); String expectedName = msg.getUniqueId(); String fileName = creator.createName(msg); assertEquals(fileName, expectedName); }