@Test public void when_client_activity_fails_and_request_result_is_failure_then_server_failure_should_be_reported() { TestResult result = new TestResult(Status.FAILED, new RuntimeException("server")); when(warpContext.getFirstNonSuccessfulResult()).thenReturn(result); doThrow(new RuntimeException("client")).when(activity).perform(); try { executor.execute(activity, warpContext); fail("client activity should fail the request"); } catch (RuntimeException e) { String message = e.getMessage(); if (!"server".equals(message)) { throw e; } } }
@Override public WarpResult execute(Activity activity, WarpContext warpContext) { try { setupServerInspection(); executeActivity(activity); awaitServerExecution(warpContext); checkActivityFailure(); return warpContext.getResult(); } finally { cleanup(); } }
DefaultWarpExecutor implements WarpExecutor { @Override public WarpResult execute(Activity activity, WarpContext warpContext) { try { setupServerInspection(); executeActivity(activity); awaitServerExecution(warpContext); checkActivityFailure(); return warpContext.getResult(); } finally { cleanup(); } } }
DefaultWarpExecutor implements WarpExecutor { @Override public WarpResult execute(Activity activity, WarpContext warpContext) { try { setupServerInspection(); executeActivity(activity); awaitServerExecution(warpContext); checkActivityFailure(); return warpContext.getResult(); } finally { cleanup(); } }  }
DefaultWarpExecutor implements WarpExecutor { @Override public WarpResult execute(Activity activity, WarpContext warpContext) { try { setupServerInspection(); executeActivity(activity); awaitServerExecution(warpContext); checkActivityFailure(); return warpContext.getResult(); } finally { cleanup(); } }  @Override WarpResult execute(Activity activity, WarpContext warpContext); }
DefaultWarpExecutor implements WarpExecutor { @Override public WarpResult execute(Activity activity, WarpContext warpContext) { try { setupServerInspection(); executeActivity(activity); awaitServerExecution(warpContext); checkActivityFailure(); return warpContext.getResult(); } finally { cleanup(); } }  @Override WarpResult execute(Activity activity, WarpContext warpContext);  }