RelaxedFtpProducer extends ProduceOnlyProducerImp { @Override public void prepare() throws CoreException { logWarningIfNotNull(destWarning, () -> destWarning = true, getDestination(), "{} uses destination, use 'ftp-url' instead", LoggingHelper.friendlyName(this)); mustHaveEither(getFtpEndpoint(), getDestination()); registerEncoderMessageFactory(); } RelaxedFtpProducer(); @Override void doProduce(AdaptrisMessage msg, String endpoint); @Override void prepare(); @Override String endpoint(AdaptrisMessage msg);  }
@Test public void testProduce() throws Exception { EmbeddedFtpServer helper = new EmbeddedFtpServer(); FileSystem filesystem = helper.createFilesystem_DirsOnly(); FakeFtpServer server = helper.createAndStart(filesystem); try { RelaxedFtpProducer ftpProducer = createForTests(new ConfiguredProduceDestination(DESTINATION_URL + SLASH + DEFAULT_WORK_DIR_NAME)); FtpConnection produceConnection = create(server); StandaloneProducer sp = new StandaloneProducer(produceConnection, ftpProducer); LifecycleHelper.prepare(sp); AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage(PAYLOAD); ExampleServiceCase.execute(sp, msg); assertEquals(1, filesystem.listFiles(DEFAULT_WORK_DIR_CANONICAL).size()); } finally { server.stop(); } }