Exemple #1
0
        public void Handle(BugUpdatedMessage message)
        {
            //TODO: take into account: when set the second developer in TP this developer assigned in Bugzilla

            if (!message.ChangedFields.Contains(BugField.EntityStateID))
            {
                return;
            }

            var bugzillaBug = _bugzillaInfoStorageRepository.GetBugzillaBug(message.Dto.ID);

            if (bugzillaBug == null)
            {
                return;
            }

            var status = _entityStateConverter.GetMappedBugzillaStatus(message.Dto);

            if (status == null)
            {
                return;
            }

            try
            {
                _log.InfoFormat("Updating bug status in Bugzilla. TargetProcess Bug ID: {0}; Bugzilla Bug ID: {1}", message.Dto.ID, bugzillaBug.Id);
                _bugzillaService.Execute(_actionFactory.GetChangeStatusAction(message.Dto, bugzillaBug.Id, status));
                _log.InfoFormat("Bug status in Bugzilla updated. TargetProcess Bug ID: {0}; Bugzilla Bug ID: {1}", message.Dto.ID, bugzillaBug.Id);
            }
            catch (Exception e)
            {
                _log.Error(e.Message, e);
            }
        }
Exemple #2
0
        private void CheckMappedBugzillaValue(int tpEntityStateId, string bzStatus)
        {
            var mapped = _converter.GetMappedBugzillaStatus(new BugDTO {
                EntityStateID = tpEntityStateId
            });

            mapped.Should(Be.EqualTo(bzStatus));
        }