openvidu-test-browsers: JsonParser static method in CustomWebhook

pull/391/head
pabloFuente 2020-02-02 20:37:28 +01:00
parent 3e9eef2d27
commit 189c6264c2
1 changed files with 1 additions and 2 deletions

View File

@ -46,7 +46,6 @@ public class CustomWebhook {
public static CountDownLatch initLatch;
private static Map<String, BlockingQueue<JsonObject>> events = new ConcurrentHashMap<>();
private static JsonParser jsonParser = new JsonParser();
public static void main(String[] args, CountDownLatch initLatch) {
CustomWebhook.initLatch = initLatch;
@ -76,7 +75,7 @@ public class CustomWebhook {
public class WebhookController {
@RequestMapping("/webhook")
public void webhook(@RequestBody String eventString) {
JsonObject event = (JsonObject) jsonParser.parse(eventString);
JsonObject event = JsonParser.parseString(eventString).getAsJsonObject();
final String eventName = event.get("event").getAsString();
System.out.println("Webhook event: " + event.toString());
if (events.get(eventName) == null) {