コード例 #1
0
  @Test(expected = ActionTestException.class)
  public void testFailPrivateMethod() throws Exception {
    // given
    final PrivateTestActionContext context = new PrivateTestActionContext();

    // when
    actionService.doAction(new SingleAction(unicastFor(agent.getAddress()), context));
    actionService.processActions();
  }
コード例 #2
0
  @Test
  public void testExecuteDefaultActionFromContext() {
    // given
    final SimpleTestActionContext context = new SimpleTestActionContext();

    // when
    actionService.doAction(new SingleAction(unicastFor(agent.getAddress()), context));
    actionService.processActions();

    // then
    assertThat(context.actionRun, is(true));
  }
コード例 #3
0
  @Test
  public void testPackageMethod() throws Exception {
    // given
    final PackageTestActionContext context = new PackageTestActionContext();

    // when
    actionService.doAction(new SingleAction(unicastFor(agent.getAddress()), context));
    actionService.processActions();

    // then
    assertThat(context.actionRun, is(true));
  }
コード例 #4
0
 @SuppressWarnings("unused")
 @Test(expected = NullPointerException.class)
 public void testNullContext() {
   // when
   new SingleAction(unicastFor(agent.getAddress()), null);
 }