allowing(messageActivationSpec).getEnableBatchBooleanValue(); will (returnValue(Boolean.FALSE));
allowing(messageActivationSpec).isUseRAManagedTransactionEnabled(); will (returnValue(Boolean.TRUE));
allowing(messageEndpointFactory).createEndpoint(with (any(XAResource.class))); will (returnValue(messageEndpoint));
allowing(workManager).scheduleWork((Work) with(anything()), (long) with(any(long.class)), with(any(ExecutionContext.class)), with(any(WorkListener.class)));
will (new Action() {
@Override
public Object invoke(Invocation invocation) throws Throwable {
return null;
}
@Override
public void describeTo(Description description) {
}
});
allowing(messageEndpoint).beforeDelivery((Method) with(anything()));
allowing (messageEndpoint).onMessage(with (any(javax.jms.Message.class))); will(new Action(){
@Override
public Object invoke(Invocation invocation) throws Throwable {
messageCount.countDown();
if (messageCount.getCount() < maxMessages - 11) {
TimeUnit.MILLISECONDS.sleep(200);