+func (s *FederationSuite) TestUpdateRemoteWorkflow(c *check.C) {
+ req := httptest.NewRequest("PATCH", "/arvados/v1/workflows/"+arvadostest.WorkflowWithDefinitionYAMLUUID, strings.NewReader(url.Values{
+ "workflow": {`{"description":"updated by TestUpdateRemoteWorkflow"}`},
+ }.Encode()))
+ req.Header.Set("Content-type", "application/x-www-form-urlencoded")
+ req.Header.Set("Authorization", "Bearer "+arvadostest.ActiveToken)
+ resp := httptest.NewRecorder()
+ s.handler.ServeHTTP(resp, req)
+ s.checkResponseOK(c, resp)
+ var wf arvados.Workflow
+ c.Check(json.Unmarshal(resp.Body.Bytes(), &wf), check.IsNil)
+ c.Check(wf.UUID, check.Equals, arvadostest.WorkflowWithDefinitionYAMLUUID)
+ c.Assert(wf.ModifiedAt, check.NotNil)
+ c.Logf("%s", *wf.ModifiedAt)
+ c.Check(time.Since(*wf.ModifiedAt) < time.Minute, check.Equals, true)
+}
+
+func (s *FederationSuite) checkResponseOK(c *check.C, resp *httptest.ResponseRecorder) {
+ c.Check(resp.Code, check.Equals, http.StatusOK)
+ if resp.Code != http.StatusOK {
+ c.Logf("... response body = %s\n", resp.Body.String())
+ }
+}
+