final SyncCommand request = new SyncCommand(this.topic, partition, data, flag, msgId, -1, opaque);
final MessageStore store = this.mocksControl.createMock(MessageStore.class);
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 'GregorCommandProcessorUnitTest-1'] failed.",
request.getOpaque());
final PutCallback cb = new PutCallback() {
@Override
public void putComplete(final ResponseCommand resp) {
invoked.set(true);
System.out.println(((BooleanCommand) resp).getErrorMsg());
if (!expectResp.equals(resp)) {
throw new RuntimeException();
}
}
};
store.append(msgId, request,