public void testProcessRequestAppendFail() throws Exception {
final int partition = 1;
final int opaque = -1;
final byte[] data = new byte[1024];
final int flag = MessageFlagUtils.getFlag(null);
final PutCommand request = new PutCommand(this.topic, partition, data, null, flag, opaque);
final long msgId = 100000L;
final MessageStore store = this.mocksControl.createMock(MessageStore.class);
EasyMock.expect(this.idWorker.nextId()).andReturn(msgId);
EasyMock.expect(this.storeManager.getOrCreateMessageStore(this.topic, partition)).andReturn(store);
final AtomicBoolean invoked = new AtomicBoolean(false);
final BooleanCommand expectResp =
new BooleanCommand(HttpStatus.InternalServerError,
"Put message to [broker 'meta://localhost:8123'] [partition 'PutProcessorUnitTest-1'] failed.",
request.getOpaque());
final PutCallback cb = new PutCallback() {
@Override
public void putComplete(final ResponseCommand resp) {
invoked.set(true);