コード例 #1
0
  @Test
  public void shouldMapSendOperationAttribute() throws JMSException {
    MappedApi service = service(new MappingBuilder("myop").build());

    // When
    service.mappedNoArgCall();

    // Then
    MapMessage message = (MapMessage) captureMessage();
    assertEquals("mappedNoArgCall", message.getObject("myop"));
  }
コード例 #2
0
  @Test
  public void shouldMapSendAttributes() throws JMSException {
    // Given
    MappedApi proxy = MessageSender.of(MappedApi.class);

    // When
    proxy.mappedCall("a", 0L);

    // Then
    MapMessage message = (MapMessage) captureMessage();
    assertEquals("a", message.getObject("A"));
    assertEquals("0", message.getObject("B"));
  }
コード例 #3
0
  @Test
  public void shouldMapSendOperationName() throws JMSException {
    // Given
    Mapping mapping =
        new MappingBuilder(OPERATION_FIELD_NAME) //
            .mapOperation("mappedNoArgCall", "MAPPED_NOARG_OP")
            .build();
    MappedApi service = service(mapping);

    // When
    service.mappedNoArgCall();

    // Then
    MapMessage message = (MapMessage) captureMessage();
    assertEquals("MAPPED_NOARG_OP", message.getObject(OPERATION_FIELD_NAME));
  }