Producer producer = endpoint.createProducer();
assertNotNull("Producer", producer);
assertThat("Producer class", producer, instanceOf(BeanstalkProducer.class));
assertThat("Processor class", ((BeanstalkProducer) producer).getCommand(), instanceOf(PutCommand.class));
final Exchange exchange = template.send(endpoint, ExchangePattern.InOnly, new Processor() { // TODO: SetBodyProcessor(?)
public void process(Exchange exchange) {
exchange.getIn().setHeader(Headers.PRIORITY, priority);
exchange.getIn().setHeader(Headers.DELAY, delay);
exchange.getIn().setHeader(Headers.TIME_TO_RUN, timeToRun);
exchange.getIn().setBody(testMessage);
}
});
assertEquals("Job ID in exchange", Long.valueOf(jobId), exchange.getIn().getHeader(Headers.JOB_ID, Long.class));
verify(client).put(priority, delay, timeToRun, payload);
}