Esempio n. 1
0
  @Test(expectedExceptions = IllegalArgumentException.class)
  public void shouldThrowExceptionIfToNotSet() throws Exception {
    CopyAction action = new CopyAction();
    action.setTo("prop-2");

    action.execute(new Message());
  }
Esempio n. 2
0
  @Test
  public void shouldCopyProperty() throws Exception {
    CopyAction action = new CopyAction();
    action.setFrom("prop-1");
    action.setTo("prop-2");

    Message message = new Message();
    message.setProperty("prop-1", "value");

    action.execute(message);

    Assert.assertEquals(message.getProperty("prop-1"), "value");
    Assert.assertEquals(message.getProperty("prop-2"), "value");
  }