WorldpayCreateReturnRequestAction extends AbstractComponentWidgetAdapterAware implements CockpitAction<OrderModel, OrderModel> { @Override public ActionResult<OrderModel> perform(ActionContext<OrderModel> actionContext) { this.sendOutput(SOCKET_OUT_CONTEXT, actionContext.getData()); ActionResult actionResult = new ActionResult(SUCCESS); actionResult.getStatusFlags().add(OBJECT_PERSISTED); return actionResult; }  @Override boolean canPerform(final ActionContext<OrderModel> actionContext); @Override String getConfirmationMessage(ActionContext<OrderModel> actionContext); @Override boolean needsConfirmation(ActionContext<OrderModel> actionContext); @Override ActionResult<OrderModel> perform(ActionContext<OrderModel> actionContext);  }
@Test public void shouldPerformAction() { final ActionResult<OrderModel> result = testObj.perform(actionContextMock); verify(testObj).sendOutput(SOCKET_OUT_CONTEXT, orderModelMock); assertTrue(result.getStatusFlags().contains(OBJECT_PERSISTED)); assertEquals(ActionResult.SUCCESS, result.getResultCode()); }