ChangeFileNameGenerator implements FileNameGenerator { public String generateFileName(Message<?> message) { return Long.toString(System.currentTimeMillis()) + "_" + processId; } ChangeFileNameGenerator(String processId); String generateFileName(Message<?> message);  }
@Test public void filenameShouldContainProcessId() { Message<?> message = mock(Message.class); assertThat(generator.generateFileName(message), containsString(processId)); }
@Test public void filenameShouldContainTodaysDate() { Message<?> message = mock(Message.class); assertThat( generator.generateFileName(message), containsString(Long.toString(System.currentTimeMillis())) ); }