Project

General

Profile

Actions

Defect #10904

closed

unexpected change in REST API between 1.3.1 and 1.4.2: different error handling for "Create project"

Added by Alex Last over 12 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
REST API
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

I installed Redmine 1.4.2 on our test server today and switched Redmine Java API tests to run against it (instead of Redmine 1.3.1).

this test fails now because Redmine simply throws 422 Unprocessable entry error instead of a nice error message as it used to do in Redmine 1.3.1:

@Test
public void testCreateProjectFailsWithReservedIdentifier() throws Exception {
Project projectToCreate = new Project();
projectToCreate.setName("new");
projectToCreate.setIdentifier("new");
String key = null;
try {
Project createdProject = mgr.createProject(projectToCreate);
// in case if the creation haven't failed (although it should have had!),
// need to cleanup - delete this project
key = createdProject.getIdentifier();
} catch (RedmineProcessingException e) {
Assert.assertNotNull(e.getErrors());
Assert.assertEquals(1, e.getErrors().size());
Assert.assertEquals("Identifier is reserved", e.getErrors().get(0));
} finally {
if (key != null) {
mgr.deleteProject(key);
}
}
}
Actions

Also available in: Atom PDF