Beispiel #1
0
        public async Task UpdateProjectDetailsTest()
        {
            // test requires a user token.
            var client = ServiceProvider.GetRequiredService <ICwsProjectClient>();
            var updateProjectDetailsRequestModel = new UpdateProjectDetailsRequestModel
            {
                projectName = $"Merino test project {Guid.NewGuid()}"
            };

            try
            {
                await client.UpdateProjectDetails(new Guid(mystagingProject), updateProjectDetailsRequestModel, CustomHeaders());
            }
            catch (Exception e)
            {
                Assert.Contains(HttpStatusCode.BadRequest.ToString(), e.Message);
                Assert.Contains(":9056,", e.Message);

                /*
                 * This call returns: (possibly because this is application context?)
                 * BadRequest {"status":400,"code":9056,"message":"Bad request","moreInfo":"Please provide this id to support, while contacting, TraceId 5e9a82a7ad9caf287518ec873da80845","timestamp":1587184295988}
                 *
                 * Postman returns:
                 * {
                 *  "status": 400,
                 *  "code": 9006,
                 *  "message": "Account not found or not active",
                 *  "moreInfo": "Please provide this id to support, while contacting, TraceId 5e9a80357074c0914b66ae9cdcf6dfa7",
                 *  "timestamp": 1587183669699,
                 *  "fieldErrors": [
                 *      {
                 *          "field": "accountId",
                 *          "attemptedValue": "trn::profilex:us-west-2:account:158ef953-4967-4af7-81cc-952d47cb6c6"
                 *      }
                 *  ]
                 * }
                 */
            }

            //Assert.NotNull(result);
            //Assert.NotNull(result.Id);
        }
Beispiel #2
0
 public Task UpdateProjectDetails(Guid projectUid, UpdateProjectDetailsRequestModel updateProjectDetailsRequest, IHeaderDictionary customHeaders = null)
 {
     log.LogDebug($"{nameof(UpdateProjectDetails)} Mock: projectUid {projectUid} updateProjectDetailsRequest {JsonConvert.SerializeObject(updateProjectDetailsRequest)}");
     return(Task.CompletedTask);
 }