import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Collection;
import javax.xml.stream.XMLStreamException;
import javax.xml.transform.dom.DOMResult;
-import org.json.JSONObject;
import org.opendaylight.controller.md.sal.dom.api.DOMNotification;
import org.opendaylight.controller.md.sal.dom.api.DOMNotificationListener;
import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
*/
@VisibleForTesting
String prepareJson() {
- final JSONObject json = new JSONObject();
- json.put("ietf-restconf:notification",
- new JSONObject(writeBodyToString()).put("event-time", ListenerAdapter.toRFC3339(Instant.now())));
+ JsonParser jsonParser = new JsonParser();
+ JsonObject json = new JsonObject();
+ json.add("ietf-restconf:notification", jsonParser.parse(writeBodyToString()));
+ json.addProperty("event-time", ListenerAdapter.toRFC3339(Instant.now()));
return json.toString();
}