Rest servers should return 400 for bad syntax JSON 45/94245/2
authorJim Hahn <jrh3@att.com>
Fri, 23 Aug 2019 22:35:40 +0000 (18:35 -0400)
committerJim Hahn <jrh3@att.com>
Fri, 23 Aug 2019 22:46:14 +0000 (18:46 -0400)
commite7fbfd23ef9a03951935509856d3b4d33e5da546
tree46acb34764d6eed44ce455b1e25b496331f03ff2
parentcf0cd76d63f9eba680a6307dd4a708e7169cb403
Rest servers should return 400 for bad syntax JSON

Modified common RestServer to inject an exception handler
into the list of providers so that it returns 400 instead
of 500 for JSON parsing errors.

Change-Id: I7c77625e3531e26413d72cc386296a709946cda2
Issue-ID: POLICY-1725
Signed-off-by: Jim Hahn <jrh3@att.com>
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/JsonExceptionMapper.java [new file with mode: 0644]
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/RestServer.java
policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/JsonExceptionMapperTest.java [new file with mode: 0644]
policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestServerTest.java