Eliminate constructors with side-effects

Several of the Gson and Jackson handlers take a GsonBuilder, which
they then configure with additional adapters prior to create a Gson
object that they subsequently use.  The code has been modified so
that the constructors no longer take a GsonBuilder, thus eliminating
the side-effects that they had on the builders.  Instead, a
configBuilder() method has been added to the handler classes that
makes it clear tht they modify the GsonBuilder.

This also has the advantage that classes that want a Gson object
configured per a given handler need only call that handler's
configBuilder() method; previously, they had to constructor the
handler and then retrieve its gson object.

Also updated a few tests to specify the HTTP "Accept" header to ensure
that return results are in yaml format.

Change-Id: I2ef98198041ff9f73913d01ee6ee14ecf20ba617
Issue-ID: POLICY-2081
Signed-off-by: Jim Hahn <jrh3@att.com>
7 files changed
tree: ae1e560e9918be4de1dbbacad0e144f589ec761d
  1. capabilities/
  2. common-logging/
  3. common-parameters/
  4. gson/
  5. integrity-audit/
  6. integrity-monitor/
  7. policy-endpoints/
  8. project-configs/
  9. utils/
  10. utils-test/
  11. .gitattributes
  12. .gitignore
  13. .gitreview
  14. INFO.yaml
  15. LICENSE.txt
  16. lombok.config
  17. pom.xml
  18. README.md
  19. version.properties
README.md

Copyright 2018 AT&T Intellectual Property. All rights reserved. This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE Full license text at https://creativecommons.org/licenses/by/4.0/legalcode

This source repository contains ONAP common code, which is shared by 'policy-drools-pdp' and 'policy-engine'. To build it:

  1. using Maven 3
  2. git clone http://gerrit.onap.org/r/oparent and copy oparent/settings.xml to ~/.m2
  3. mvn clean install