diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/HttpClient.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/HttpClient.java
index 2fe46fb..ebed1d7 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/HttpClient.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/HttpClient.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP
  * ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,14 +21,16 @@
 package org.onap.policy.common.endpoints.http.client;
 
 import java.util.Map;
-
+import java.util.concurrent.Future;
 import javax.ws.rs.client.Entity;
+import javax.ws.rs.client.InvocationCallback;
 import javax.ws.rs.core.Response;
 
 import org.onap.policy.common.capabilities.Startable;
 
 /**
- * Http Client interface.
+ * Http Client interface. Supports both synchronous and asynchronous operations.
+ *
  */
 public interface HttpClient extends Startable {
 
@@ -48,6 +50,24 @@
     Response get();
 
     /**
+     * Asynchronous GET request.
+     *
+     * @param callback callback to be invoked, asynchronously, when the request completes
+     * @param path context uri path.
+     *
+     * @return future that can be used to cancel the request or await the response
+     */
+    Future<Response> get(InvocationCallback<Response> callback, String path);
+
+    /**
+     * Asynchronous GET request.
+     *
+     * @param callback callback to be invoked, asynchronously, when the request completes
+     * @return future that can be used to cancel the request or await the response
+     */
+    Future<Response> get(InvocationCallback<Response> callback);
+
+    /**
      * PUT request.
      *
      * @param path context uri path
@@ -59,6 +79,19 @@
     Response put(String path, Entity<?> entity, Map<String, Object> headers);
 
     /**
+     * Asynchronous PUT request.
+     *
+     * @param callback callback to be invoked, asynchronously, when the request completes
+     * @param path context uri path
+     * @param entity body
+     * @param headers headers
+     *
+     * @return future that can be used to cancel the request or await the response
+     */
+    Future<Response> put(InvocationCallback<Response> callback, String path, Entity<?> entity,
+                    Map<String, Object> headers);
+
+    /**
      * POST request.
      *
      * @param path context uri path
@@ -70,6 +103,19 @@
     Response post(String path, Entity<?> entity, Map<String, Object> headers);
 
     /**
+     * Asynchronous POST request.
+     *
+     * @param callback callback to be invoked, asynchronously, when the request completes
+     * @param path context uri path
+     * @param entity body
+     * @param headers headers
+     *
+     * @return future that can be used to cancel the request or await the response
+     */
+    Future<Response> post(InvocationCallback<Response> callback, String path, Entity<?> entity,
+                    Map<String, Object> headers);
+
+    /**
      * DELETE request.
      *
      * @param path context uri path
@@ -80,6 +126,17 @@
     Response delete(String path, Map<String, Object> headers);
 
     /**
+     * Asynchronous DELETE request.
+     *
+     * @param callback callback to be invoked, asynchronously, when the request completes
+     * @param path context uri path
+     * @param headers headers
+     *
+     * @return future that can be used to cancel the request or await the response
+     */
+    Future<Response> delete(InvocationCallback<Response> callback, String path, Map<String, Object> headers);
+
+    /**
      * Retrieve the body from the HTTP transaction.
      *
      * @param response response.
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/internal/JerseyClient.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/internal/JerseyClient.java
index 8a71771..1a822ff 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/internal/JerseyClient.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/internal/JerseyClient.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP
  * ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2018 Samsung Electronics Co., Ltd.
  * Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
@@ -28,11 +28,13 @@
 import java.security.SecureRandom;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.concurrent.Future;
 import javax.net.ssl.SSLContext;
 import javax.ws.rs.client.Client;
 import javax.ws.rs.client.ClientBuilder;
 import javax.ws.rs.client.Entity;
 import javax.ws.rs.client.Invocation.Builder;
+import javax.ws.rs.client.InvocationCallback;
 import javax.ws.rs.core.Response;
 import org.apache.commons.lang3.StringUtils;
 import org.glassfish.jersey.client.ClientProperties;
@@ -169,21 +171,52 @@
     }
 
     @Override
+    public Future<Response> get(InvocationCallback<Response> callback, String path) {
+        if (!StringUtils.isBlank(path)) {
+            return this.client.target(this.baseUrl).path(path).request().async().get(callback);
+        } else {
+            return this.client.target(this.baseUrl).request().async().get(callback);
+        }
+    }
+
+    @Override
+    public Future<Response> get(InvocationCallback<Response> callback) {
+        return this.client.target(this.baseUrl).request().async().get(callback);
+    }
+
+    @Override
     public Response put(String path, Entity<?> entity, Map<String, Object> headers) {
         return getBuilder(path, headers).put(entity);
     }
 
     @Override
+    public Future<Response> put(InvocationCallback<Response> callback, String path, Entity<?> entity,
+                    Map<String, Object> headers) {
+        return getBuilder(path, headers).async().put(entity, callback);
+    }
+
+    @Override
     public Response post(String path, Entity<?> entity, Map<String, Object> headers) {
         return getBuilder(path, headers).post(entity);
     }
 
     @Override
+    public Future<Response> post(InvocationCallback<Response> callback, String path, Entity<?> entity,
+                    Map<String, Object> headers) {
+        return getBuilder(path, headers).async().post(entity, callback);
+    }
+
+    @Override
     public Response delete(String path, Map<String, Object> headers) {
         return getBuilder(path, headers).delete();
     }
 
     @Override
+    public Future<Response> delete(InvocationCallback<Response> callback, String path, Map<String, Object> headers) {
+        return getBuilder(path, headers).async().delete(callback);
+    }
+
+    @Override
     public boolean start() {
         return alive;
     }
diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/HttpClientTest.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/HttpClientTest.java
index 2aaf136..d3f94cd 100644
--- a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/HttpClientTest.java
+++ b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/HttpClientTest.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP
  * ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2018 Samsung Electronics Co., Ltd.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,15 +23,21 @@
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Properties;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 import javax.ws.rs.client.Entity;
+import javax.ws.rs.client.InvocationCallback;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
+import lombok.Getter;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -194,6 +200,28 @@
     }
 
     @Test
+    public void testHttpGetNoAuthClientAsync() throws Exception {
+        final HttpClient client = getNoAuthHttpClient(TEST_HTTP_NO_AUTH_CLIENT, false,
+            6666);
+        MyCallback callback = new MyCallback();
+        final Response response = client.get(callback, HELLO).get();
+
+        verifyCallback("testHttpGetNoAuthClientAsync", callback, response);
+
+        final String body = HttpClient.getBody(response, String.class);
+
+        assertEquals(200, response.getStatus());
+        assertEquals(HELLO, body);
+    }
+
+    private void verifyCallback(String testName, MyCallback callback, final Response response)
+                    throws InterruptedException {
+        assertTrue(testName, callback.await());
+        assertNull(testName, callback.getThrowable());
+        assertSame(testName, response, callback.getResponse());
+    }
+
+    @Test
     public void testHttpPutNoAuthClient() throws Exception {
         final HttpClient client = getNoAuthHttpClient(TEST_HTTP_NO_AUTH_CLIENT, false, 6666);
 
@@ -206,6 +234,22 @@
     }
 
     @Test
+    public void testHttpPutNoAuthClientAsync() throws Exception {
+        final HttpClient client = getNoAuthHttpClient(TEST_HTTP_NO_AUTH_CLIENT, false, 6666);
+
+        Entity<MyEntity> entity = Entity.entity(new MyEntity(MY_VALUE), MediaType.APPLICATION_JSON);
+        MyCallback callback = new MyCallback();
+        final Response response = client.put(callback, HELLO, entity, Collections.emptyMap()).get();
+
+        verifyCallback("testHttpPutNoAuthClientAsync", callback, response);
+
+        final String body = HttpClient.getBody(response, String.class);
+
+        assertEquals(200, response.getStatus());
+        assertEquals(PUT_HELLO, body);
+    }
+
+    @Test
     public void testHttpPostNoAuthClient() throws Exception {
         final HttpClient client = getNoAuthHttpClient(TEST_HTTP_NO_AUTH_CLIENT, false,
             6666);
@@ -219,6 +263,23 @@
     }
 
     @Test
+    public void testHttpPostNoAuthClientAsync() throws Exception {
+        final HttpClient client = getNoAuthHttpClient(TEST_HTTP_NO_AUTH_CLIENT, false,
+            6666);
+
+        Entity<MyEntity> entity = Entity.entity(new MyEntity(MY_VALUE), MediaType.APPLICATION_JSON);
+        MyCallback callback = new MyCallback();
+        final Response response = client.post(callback, HELLO, entity, Collections.emptyMap()).get();
+
+        verifyCallback("testHttpPostNoAuthClientAsync", callback, response);
+
+        final String body = HttpClient.getBody(response, String.class);
+
+        assertEquals(200, response.getStatus());
+        assertEquals("POST:hello:{myParameter=myValue}", body);
+    }
+
+    @Test
     public void testHttpDeletetNoAuthClient() throws Exception {
         final HttpClient client = getNoAuthHttpClient(TEST_HTTP_NO_AUTH_CLIENT, false,
             6666);
@@ -231,6 +292,41 @@
     }
 
     @Test
+    public void testHttpDeletetNoAuthClientAsync() throws Exception {
+        final HttpClient client = getNoAuthHttpClient(TEST_HTTP_NO_AUTH_CLIENT, false,
+            6666);
+
+        MyCallback callback = new MyCallback();
+        final Response response = client.delete(callback, HELLO, Collections.emptyMap()).get();
+
+        verifyCallback("testHttpDeletetNoAuthClientAsync", callback, response);
+
+        final String body = HttpClient.getBody(response, String.class);
+
+        assertEquals(200, response.getStatus());
+        assertEquals("DELETE:hello", body);
+    }
+
+    /**
+     * Perform one asynchronous test with auth client; don't need to test every method.
+     * @throws Exception if an error occurs
+     */
+    @Test
+    public void testHttpAsyncAuthClient() throws Exception {
+        final HttpClient client = getAuthHttpClient();
+
+        MyCallback callback = new MyCallback();
+        final Response response = client.get(callback, HELLO).get();
+
+        verifyCallback("testHttpAsyncAuthClient", callback, response);
+
+        final String body = HttpClient.getBody(response, String.class);
+
+        assertEquals(200, response.getStatus());
+        assertEquals(HELLO, body);
+    }
+
+    @Test
     public void testHttpGetAuthClient() throws Exception {
         final HttpClient client = getAuthHttpClient();
 
@@ -382,16 +478,33 @@
             server.waitedStart(10000);
         }
 
+        Response response;
         final HttpClient clientPap = HttpClientFactoryInstance.getClientFactory().get("PAP");
-        final Response response = clientPap.get();
+        response = clientPap.get();
         assertEquals(200, response.getStatus());
 
         final HttpClient clientPdp = HttpClientFactoryInstance.getClientFactory().get("PDP");
-        final Response response2 = clientPdp.get("test");
-        assertEquals(500, response2.getStatus());
+        response = clientPdp.get("test");
+        assertEquals(500, response.getStatus());
 
         assertFalse(MyJacksonProvider.hasWrittenSome());
         assertFalse(MyGsonProvider.hasWrittenSome());
+
+        // try with empty path
+        response = clientPap.get("");
+        assertEquals(200, response.getStatus());
+
+        // try it asynchronously, too
+        MyCallback callback = new MyCallback();
+        response = clientPap.get(callback).get();
+        verifyCallback("testHttpAuthClientProps", callback, response);
+        assertEquals(200, response.getStatus());
+
+        // try it asynchronously, with empty path
+        callback = new MyCallback();
+        response = clientPap.get(callback, "").get();
+        verifyCallback("testHttpAuthClientProps - empty path", callback, response);
+        assertEquals(200, response.getStatus());
     }
 
     @Test
@@ -497,4 +610,29 @@
 
     }
 
+    class MyCallback implements InvocationCallback<Response> {
+        @Getter
+        private Response response;
+
+        @Getter
+        private Throwable throwable;
+
+        private CountDownLatch latch = new CountDownLatch(1);
+
+        @Override
+        public void completed(Response response) {
+            this.response = response;
+            latch.countDown();
+        }
+
+        @Override
+        public void failed(Throwable throwable) {
+            this.throwable = throwable;
+            latch.countDown();
+        }
+
+        public boolean await() throws InterruptedException {
+            return latch.await(5, TimeUnit.SECONDS);
+        }
+    }
 }
diff --git a/utils/src/main/java/org/onap/policy/common/utils/coder/Coder.java b/utils/src/main/java/org/onap/policy/common/utils/coder/Coder.java
index bb51f2b..ec0e5e4 100644
--- a/utils/src/main/java/org/onap/policy/common/utils/coder/Coder.java
+++ b/utils/src/main/java/org/onap/policy/common/utils/coder/Coder.java
@@ -1,8 +1,8 @@
 /*
  * ============LICENSE_START=======================================================
- * ONAP PAP
+ * ONAP
  * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -41,6 +41,16 @@
     String encode(Object object) throws CoderException;
 
     /**
+     * Encodes an object into json, optionally making it "pretty".
+     *
+     * @param object object to be encoded
+     * @param pretty {@code true} if it should be encoded as "pretty" json, {@code false} otherwise
+     * @return a json string representing the object
+     * @throws CoderException if an error occurs
+     */
+    String encode(Object object, boolean pretty) throws CoderException;
+
+    /**
      * Encodes an object into json, writing to the given target.
      *
      * @param target target to which to write the encoded json
diff --git a/utils/src/main/java/org/onap/policy/common/utils/coder/StandardCoder.java b/utils/src/main/java/org/onap/policy/common/utils/coder/StandardCoder.java
index 6d0cbc9..13973f1 100644
--- a/utils/src/main/java/org/onap/policy/common/utils/coder/StandardCoder.java
+++ b/utils/src/main/java/org/onap/policy/common/utils/coder/StandardCoder.java
@@ -54,9 +54,21 @@
      * Gson object used to encode and decode messages.
      */
     @Getter(AccessLevel.PROTECTED)
-    private static final Gson GSON = GsonMessageBodyHandler.configBuilder(
-                    new GsonBuilder().registerTypeAdapter(StandardCoderObject.class, new StandardTypeAdapter()))
-                    .create();
+    private static final Gson GSON;
+
+    /**
+     * Gson object used to encode messages in "pretty" format.
+     */
+    @Getter(AccessLevel.PROTECTED)
+    private static final Gson GSON_PRETTY;
+
+    static {
+        GsonBuilder builder = GsonMessageBodyHandler.configBuilder(
+                        new GsonBuilder().registerTypeAdapter(StandardCoderObject.class, new StandardTypeAdapter()));
+
+        GSON = builder.create();
+        GSON_PRETTY = builder.setPrettyPrinting().create();
+    }
 
     /**
      * Constructs the object.
@@ -67,8 +79,18 @@
 
     @Override
     public String encode(Object object) throws CoderException {
+        return encode(object, false);
+    }
+
+    @Override
+    public String encode(Object object, boolean pretty) throws CoderException {
         try {
-            return toJson(object);
+            if (pretty) {
+                return toPrettyJson(object);
+
+            } else {
+                return toJson(object);
+            }
 
         } catch (RuntimeException e) {
             throw new CoderException(e);
@@ -151,6 +173,16 @@
         }
     }
 
+    /**
+     * Encodes the object as "pretty" json.
+     *
+     * @param object object to be encoded
+     * @return the encoded object
+     */
+    protected String toPrettyJson(Object object) {
+        return GSON_PRETTY.toJson(object);
+    }
+
     @Override
     public StandardCoderObject toStandard(Object object) throws CoderException {
         try {
diff --git a/utils/src/main/java/org/onap/policy/common/utils/coder/StandardValCoder.java b/utils/src/main/java/org/onap/policy/common/utils/coder/StandardValCoder.java
index 378254b..6e08e72 100644
--- a/utils/src/main/java/org/onap/policy/common/utils/coder/StandardValCoder.java
+++ b/utils/src/main/java/org/onap/policy/common/utils/coder/StandardValCoder.java
@@ -62,10 +62,21 @@
     }
 
     @Override
+    protected String toPrettyJson(Object object) {
+        /*
+         * The validator strips off the "pretty" stuff (i.e., spaces), thus we have to validate
+         * and generate the pretty JSON in separate steps.
+         */
+        getGSON().toJson(object, object.getClass(), validatorApi.createJsonWriter(validator, new StringWriter()));
+
+        return super.toPrettyJson(object);
+    }
+
+    @Override
     protected String toJson(@NonNull Object object) {
         StringWriter output = new StringWriter();
         toJson(output, object);
-        return String.valueOf(output);
+        return output.toString();
     }
 
     @Override
diff --git a/utils/src/main/java/org/onap/policy/common/utils/coder/StandardYamlCoder.java b/utils/src/main/java/org/onap/policy/common/utils/coder/StandardYamlCoder.java
index 36f15b9..1bcf6ac 100644
--- a/utils/src/main/java/org/onap/policy/common/utils/coder/StandardYamlCoder.java
+++ b/utils/src/main/java/org/onap/policy/common/utils/coder/StandardYamlCoder.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP
  * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -38,6 +38,12 @@
     }
 
     @Override
+    protected String toPrettyJson(Object object) {
+        // YAML is already "pretty"
+        return toJson(object);
+    }
+
+    @Override
     protected String toJson(Object object) {
         return translator.toYaml(object);
     }
diff --git a/utils/src/test/java/org/onap/policy/common/utils/coder/StandardCoderTest.java b/utils/src/test/java/org/onap/policy/common/utils/coder/StandardCoderTest.java
index 43a17de..d5cde55 100644
--- a/utils/src/test/java/org/onap/policy/common/utils/coder/StandardCoderTest.java
+++ b/utils/src/test/java/org/onap/policy/common/utils/coder/StandardCoderTest.java
@@ -77,6 +77,32 @@
     }
 
     @Test
+    public void testEncodeObjectBoolean() throws Exception {
+        final List<Integer> arr = Arrays.asList(1100, 1110);
+
+        /*
+         * As plain json.
+         */
+        assertEquals("[1100,1110]", coder.encode(arr, false));
+
+        // test exception case
+        coder = spy(new StandardCoder());
+        when(coder.toJson(arr)).thenThrow(jpe);
+        assertThatThrownBy(() -> coder.encode(arr, false)).isInstanceOf(CoderException.class).hasCause(jpe);
+
+
+        /*
+         * As pretty json.
+         */
+        assertEquals("[\n  1100,\n  1110\n]", coder.encode(arr, true));
+
+        // test exception case
+        coder = spy(new StandardCoder());
+        when(coder.toPrettyJson(arr)).thenThrow(jpe);
+        assertThatThrownBy(() -> coder.encode(arr, true)).isInstanceOf(CoderException.class).hasCause(jpe);
+    }
+
+    @Test
     public void testEncodeWriterObject() throws Exception {
         List<Integer> arr = Arrays.asList(1200, 1210);
         StringWriter wtr = new StringWriter();
diff --git a/utils/src/test/java/org/onap/policy/common/utils/coder/StandardValCoderTest.java b/utils/src/test/java/org/onap/policy/common/utils/coder/StandardValCoderTest.java
index 38106f5..2fcdb0d 100644
--- a/utils/src/test/java/org/onap/policy/common/utils/coder/StandardValCoderTest.java
+++ b/utils/src/test/java/org/onap/policy/common/utils/coder/StandardValCoderTest.java
@@ -20,8 +20,10 @@
 
 package org.onap.policy.common.utils.coder;
 
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -119,6 +121,26 @@
         StringWriter writer = new StringWriter();
         valCoder.encode(writer, valOuter);
         assertEquals(valOuterJson, writer.toString());
+
+        // test exception case with an empty object
+        assertThatThrownBy(() -> valCoder.encode(new ValOuter())).isInstanceOf(CoderException.class);
+    }
+
+    @Test
+    public void testPretty() throws CoderException {
+        StandardValCoder valCoder = new StandardValCoder(jsonSchema, "test-schema");
+        ValOuter valOuter = valCoder.decode(validJson, ValOuter.class);
+
+        String valOuterJson = valCoder.encode(valOuter);
+        assertEquals(valOuterJson, valCoder.encode(valOuter, false));
+        String prettyValOuterJson = valCoder.encode(valOuter, true);
+        assertNotEquals(valOuterJson, prettyValOuterJson);
+
+        assertEquals(valOuter, valCoder.decode(prettyValOuterJson, ValOuter.class));
+
+        // test exception cases with an empty object
+        assertThatThrownBy(() -> valCoder.encode(new ValOuter(), false)).isInstanceOf(CoderException.class);
+        assertThatThrownBy(() -> valCoder.encode(new ValOuter(), true)).isInstanceOf(CoderException.class);
     }
 
     @Test
diff --git a/utils/src/test/java/org/onap/policy/common/utils/coder/StandardYamlCoderTest.java b/utils/src/test/java/org/onap/policy/common/utils/coder/StandardYamlCoderTest.java
index e38c5c9..c770cd3 100644
--- a/utils/src/test/java/org/onap/policy/common/utils/coder/StandardYamlCoderTest.java
+++ b/utils/src/test/java/org/onap/policy/common/utils/coder/StandardYamlCoderTest.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP
  * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,8 +20,11 @@
 
 package org.onap.policy.common.utils.coder;
 
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
 
 import java.io.File;
 import java.io.StringWriter;
@@ -45,6 +48,25 @@
     }
 
     @Test
+    public void testToPrettyJson() throws CoderException {
+        String expected = coder.encode(cont);
+        assertEquals(expected, coder.encode(cont, false));
+
+        String yaml = coder.encode(cont, true);
+        assertEquals(expected, yaml);
+
+        Container cont2 = coder.decode(yaml, Container.class);
+        assertEquals(cont, cont2);
+
+        // test exception cases
+        IllegalArgumentException expex = new IllegalArgumentException("expected exception");
+        coder = spy(new StandardYamlCoder());
+        when(coder.toJson(cont)).thenThrow(expex);
+        assertThatThrownBy(() -> coder.encode(cont, false)).isInstanceOf(CoderException.class).hasCause(expex);
+        assertThatThrownBy(() -> coder.encode(cont, true)).isInstanceOf(CoderException.class).hasCause(expex);
+    }
+
+    @Test
     public void testToJsonObject() throws CoderException {
         String yaml = coder.encode(cont);
 
