Description of problem: 1) Create an environment 2) Try adding the same content id to environment twice Something like this POST /candlepin/environments/100/content?contentId=1 POST /candlepin/environments/100/content?contentId=1 This raises an error which makes sense. But the error message itself does not complain that its a duplicate content id. We instead get an error like this RestClient::InternalServerError: Katello::Resources::Candlepin::Environment: 500 Internal Server Error {"displayMessage":"Runtime Error could not execute statement at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse:2,102","requestUuid":"13c15fcd-0bc2-4686-a988-e0ba70377b86"} (POST /candlepin/environments/1/content) Preferable would be an error that says "Duplicate Resource" with the appropriate status code.
commit 2b1cf427caf59708f75d5facd237de1a0c0e761c Author: Chris Rog <crog> Date: Tue Mar 31 15:52:04 2015 -0400 1207822: EnvironmentResource fix for duplicate content IDs - EnvironmentResource will now throw a ConflictException if an API user attempts to promote content that has already been promoted. - Added spec tests to verify the above behavior
Moving to closed per the updated candlepin process for bugs that have been merged or have been taken care of.