final byte[] data = new byte[1024];
final int flag = MessageFlagUtils.getFlag(null);
final PutCommand request = new PutCommand(this.topic, partition, data, null, flag, opaque);
this.metaConfig.setTopics(Arrays.asList(this.topic));
this.metaConfig.closePartitions(this.topic, partition, partition);
final BooleanCommand expectedResp =
new BooleanCommand(
HttpStatus.Forbidden,
"Put message to [broker 'meta://localhost:8123'] [partition 'PutProcessorUnitTest-1'] failed.Detail:partition[0-1] has been closed",
request.getOpaque());
final AtomicBoolean invoked = new AtomicBoolean(false);
final PutCallback cb = new PutCallback() {
@Override
public void putComplete(final ResponseCommand resp) {
invoked.set(true);
System.out.println(((BooleanCommand) resp).getErrorMsg());
if (!expectedResp.equals(resp)) {
throw new RuntimeException();
}
}
};
EasyMock.expect(this.brokerZooKeeper.getBrokerString()).andReturn("meta://localhost:8123");