Exemplo n.º 1
0
  public void testUnbindQueue() throws Exception {
    AMQQueue queue = createTestQueue(QUEUE_NAME, "queueOwner", false);
    Binding binding =
        new Binding(
            UUIDGenerator.generateRandomUUID(),
            ROUTING_KEY,
            queue,
            _exchange,
            FieldTable.convertToMap(_bindingArgs));
    _store.bindQueue(binding);

    _store.unbindQueue(binding);
    reopenStore();

    verify(_bindingRecoveryHandler, never())
        .binding(
            any(UUID.class), any(UUID.class), any(UUID.class), anyString(), isA(ByteBuffer.class));
  }
Exemplo n.º 2
0
  public void testBindQueue() throws Exception {
    AMQQueue queue = createTestQueue(QUEUE_NAME, "queueOwner", false);
    Binding binding =
        new Binding(
            UUIDGenerator.generateRandomUUID(),
            ROUTING_KEY,
            queue,
            _exchange,
            FieldTable.convertToMap(_bindingArgs));
    _store.bindQueue(binding);

    reopenStore();

    ByteBuffer argsAsBytes = ByteBuffer.wrap(_bindingArgs.getDataAsBytes());

    verify(_bindingRecoveryHandler)
        .binding(binding.getId(), _exchange.getId(), queue.getId(), ROUTING_KEY, argsAsBytes);
  }