Actions
Defect #10904
closedunexpected change in REST API between 1.3.1 and 1.4.2: different error handling for "Create project"
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);
}
}
}
Updated by Alex Last over 12 years ago
- Status changed from New to Resolved
never mind, I see Redmine still provides the same error messages, but with no "\r" or "\n" between XML lines in the response. this is fine, we just need to make our manual XML parsing code more reliable to account for that.
thanks for Redmine 1.4.2 release!
Updated by Jean-Philippe Lang over 12 years ago
- Status changed from Resolved to Closed
- Resolution set to Invalid
Actions