Example #1
0
 public void commit(String transactionId, FrameDecorator frameDecorator) {
   checkNotNull(transactionId, "transactionId cannot be null");
   Frame frame = new Frame(Command.COMMIT);
   frame.transaction(transactionId);
   preprocessor.decorate(frame, frameDecorator);
   send(frame);
 }
  @Test(expected = StompInvalidHeaderException.class)
  public void validationFails() {
    Frame frame = new Frame(Command.BEGIN);
    frame.transaction("tx-1");

    FrameDecorator decorator =
        new FrameDecorator() {
          @Override
          public void decorateFrame(Frame frame) {
            frame.transaction("tx-2");
          }
        };

    FramePreprocessor processor = new FrameValidator();
    processor.decorate(frame, decorator);
  }