Package org.mokai.action

Examples of org.mokai.action.AddSuffixAction


public class AddSuffixActionTest {

  @Test
  public void shouldAddSuffixIfNotPresent() throws Exception {
    AddSuffixAction action = new AddSuffixAction();
    action.setField("to");
    action.setSuffix("suf");

    Message message = new Message();
    message.setProperty("to", "test");

    action.execute(message);

    Assert.assertEquals(message.getProperty("to", String.class), "testsuf");
  }
View Full Code Here


    Assert.assertEquals(message.getProperty("to", String.class), "testsuf");
  }

  @Test
  public void shouldAddSuffixIfFieldDoesntExists() throws Exception {
    AddSuffixAction action = new AddSuffixAction();
    action.setField("to");
    action.setSuffix("suf");

    Message message = new Message();

    action.execute(message);

    Assert.assertEquals(message.getProperty("to", String.class), "suf");
  }
View Full Code Here

    Assert.assertEquals(message.getProperty("to", String.class), "suf");
  }

  @Test
  public void shouldNotAddSuffixIfPresent() throws Exception {
    AddSuffixAction action = new AddSuffixAction();
    action.setField("to");
    action.setSuffix("suf");

    Message message = new Message();
    message.setProperty("to", "testsuf");

    action.execute(message);

    Assert.assertEquals(message.getProperty("to", String.class), "testsuf");
  }
View Full Code Here

    Assert.assertEquals(message.getProperty("to", String.class), "testsuf");
  }

  @Test(expectedExceptions=IllegalArgumentException.class)
  public void shouldFailIfSuffixNotSet() throws Exception {
    AddSuffixAction action = new AddSuffixAction();
    action.setField("to");

    action.execute(new Message());
  }
View Full Code Here

    action.execute(new Message());
  }

  @Test(expectedExceptions=IllegalArgumentException.class)
  public void shouldFailIfFieldNotSet() throws Exception {
    AddSuffixAction action = new AddSuffixAction();
    action.setSuffix("57");

    action.execute(new Message());
  }
View Full Code Here

TOP

Related Classes of org.mokai.action.AddSuffixAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.