@Test
public void patchShouldFailWithForbiddenIfNotAuthorized() throws Exception {

  sinceVersion(Api.Version.V3);
  doThrow(new ResponseException(Response.forStatus(FORBIDDEN)))
      .when(workflowActionAuthorizer).authorizeWorkflowAction(any(), any(WorkflowId.class));
  final Response<ByteString> response =
      awaitResponse(serviceHelper.request("PATCH", path("/foo/bar/state"), STATEPAYLOAD_FULL));
  assertThat(response, hasStatus(withCode(FORBIDDEN)));
  verify(storage, never()).patchState(any(), any());
}