@Test public void generateFileName() { String filename = generator.generateFileName(MessageBuilder.withPayload( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+ "<products import-id=\"partner1-1\">"+ "<product>"+ "<id>1</id>"+ "<title>some phone</title>"+ "</product>"+ "</products>" ).build()); Assert.assertEquals("partner1-1.xml",filename); }
@Override public String generateFileName(Message<?> message) { Assert.notNull(message.getPayload()); Assert.isInstanceOf(String.class, message.getPayload()); String payload = (String) message.getPayload(); return ProductImportUtils.extractImportId(payload)+".xml"; }
ProductImportFileNameGenerator implements FileNameGenerator { @Override public String generateFileName(Message<?> message) { Assert.notNull(message.getPayload()); Assert.isInstanceOf(String.class, message.getPayload()); String payload = (String) message.getPayload(); return ProductImportUtils.extractImportId(payload)+".xml"; } }
ProductImportFileNameGenerator implements FileNameGenerator { @Override public String generateFileName(Message<?> message) { Assert.notNull(message.getPayload()); Assert.isInstanceOf(String.class, message.getPayload()); String payload = (String) message.getPayload(); return ProductImportUtils.extractImportId(payload)+".xml"; }  }
ProductImportFileNameGenerator implements FileNameGenerator { @Override public String generateFileName(Message<?> message) { Assert.notNull(message.getPayload()); Assert.isInstanceOf(String.class, message.getPayload()); String payload = (String) message.getPayload(); return ProductImportUtils.extractImportId(payload)+".xml"; }  @Override String generateFileName(Message<?> message); }
ProductImportFileNameGenerator implements FileNameGenerator { @Override public String generateFileName(Message<?> message) { Assert.notNull(message.getPayload()); Assert.isInstanceOf(String.class, message.getPayload()); String payload = (String) message.getPayload(); return ProductImportUtils.extractImportId(payload)+".xml"; }  @Override String generateFileName(Message<?> message);  }