Project

General

Profile

« Previous | Next » 

Revision a1ac8acd

Added by Andreas Kohlbecker about 6 years ago

ref #7269 fixing bug regarding Curator field and extending test

View differences:

cdmlib-ext/src/main/java/eu/etaxonomy/cdm/ext/registration/messages/redmine/RedmineRegistrationMessageService.java
178 178
        }
179 179
        if(!registration.getSubmitter().equals(fromUser)){
180 180
            // it the sender is not the submitter it must me the curator then
181
            CustomField customFieldCurator = CustomFieldFactory.create(getPreferenceAsInt(RedminePreferenceKey.CUSTOM_FIELD_CURATOR_ID));
181
            int customFieldId = getPreferenceAsInt(RedminePreferenceKey.CUSTOM_FIELD_CURATOR_ID);
182
            CustomField customFieldCurator = issue.getCustomFieldById(customFieldId);
183
            if(customFieldCurator == null){
184
                customFieldCurator = CustomFieldFactory.create(customFieldId);
185
            }
182 186
            customFieldCurator.setValue(Integer.toString(redmineFromUser.getId()));
183 187
            issue.addCustomField(customFieldCurator);
184 188
        }
cdmlib-ext/src/test/java/eu/etaxonomy/cdm/ext/registration/messages/redmine/RedmineRegistrationMessageServiceTest.java
207 207
        redmineCurator = messageService.findUser(curator);
208 208
        redmineSubmitter = messageService.findUser(submitter);
209 209
        assertEquals(redmineSubmitter.getId(), issue.getAssigneeId());
210
        assertEquals(redmineCurator.getId(), Integer.valueOf(issue.getCustomFieldByName("Curator").getValue()));
210 211

  
211 212
        assertEquals(1, messageService.countActiveMessagesFor(reg, submitter));
212 213

  

Also available in: Unified diff