public void CreateTask() { const string login = "******"; var user_info = new UserInfo() { Id = 1, Roles = new List <string> { ROLE }, Login = login }; var form = new CreateForm { Task = TaskCode.Explore, ExplorationId = EXPLORATION_ID, Notes = "notes", InformationSystemCode = PRODUCT_CODE }; _ldapService.GetWatchersByLogin(login).Returns(new List <PersonInfo>()); try { _taskCreateService.CreateTask(form, user_info); } catch { // ignored } _jiraApiService.Received().CreateIssue(PERIMETER_VALUE, Arg.Any <string>(), form.Notes, Arg.Any <string>(), login, Arg.Any <IEnumerable <ProjectVersion> >(), Arg.Any <string>(), Arg.Any <string>(), Arg.Any <string>()); }
public IActionResult CreateTask(CreateForm create_form) { _logger.LogInformation($"CreateTask {nameof(create_form)} - {JsonConvert.SerializeObject(create_form)}"); var errors = _taskFormValidationService.Validate(create_form).ToList(); if (!errors.Any()) { var issue_key = _taskCreateService.CreateTask(create_form, _userInfoService.GetUserInfo()); return(Redirect(MakeUrlToIssue(issue_key))); } return(new JsonResult(errors)); }