@Test public void testGetWebhooksEvent() throws FMSException { WebhooksEvent webhooksEvent = webhooksService.getWebhooksEvent(payload); Assert.assertNotNull(webhooksEvent); Assert.assertEquals(webhooksEvent.getEventNotifications().size(), 1); }
public WebhooksEvent getWebhooksEvent(String payload) { if (!StringUtils.hasText(payload)) { return null; } try { ObjectMapper mapper = new ObjectMapper(); return mapper.readValue(payload, WebhooksEvent.class); } catch (JsonParseException e) { LOG.error("Error while parsing payload", e); return null; } catch (JsonMappingException e) { LOG.error("Error while mapping payload", e); return null; } catch (IOException e) { LOG.error("IO exception while parsing payload", e); return null; } }
WebhooksService { public WebhooksEvent getWebhooksEvent(String payload) { if (!StringUtils.hasText(payload)) { return null; } try { ObjectMapper mapper = new ObjectMapper(); return mapper.readValue(payload, WebhooksEvent.class); } catch (JsonParseException e) { LOG.error("Error while parsing payload", e); return null; } catch (JsonMappingException e) { LOG.error("Error while mapping payload", e); return null; } catch (IOException e) { LOG.error("IO exception while parsing payload", e); return null; } } }
WebhooksService { public WebhooksEvent getWebhooksEvent(String payload) { if (!StringUtils.hasText(payload)) { return null; } try { ObjectMapper mapper = new ObjectMapper(); return mapper.readValue(payload, WebhooksEvent.class); } catch (JsonParseException e) { LOG.error("Error while parsing payload", e); return null; } catch (JsonMappingException e) { LOG.error("Error while mapping payload", e); return null; } catch (IOException e) { LOG.error("IO exception while parsing payload", e); return null; } }  }
WebhooksService { public WebhooksEvent getWebhooksEvent(String payload) { if (!StringUtils.hasText(payload)) { return null; } try { ObjectMapper mapper = new ObjectMapper(); return mapper.readValue(payload, WebhooksEvent.class); } catch (JsonParseException e) { LOG.error("Error while parsing payload", e); return null; } catch (JsonMappingException e) { LOG.error("Error while mapping payload", e); return null; } catch (IOException e) { LOG.error("IO exception while parsing payload", e); return null; } }  boolean verifyPayload(String intuitSignature, String payload); WebhooksEvent getWebhooksEvent(String payload); }
WebhooksService { public WebhooksEvent getWebhooksEvent(String payload) { if (!StringUtils.hasText(payload)) { return null; } try { ObjectMapper mapper = new ObjectMapper(); return mapper.readValue(payload, WebhooksEvent.class); } catch (JsonParseException e) { LOG.error("Error while parsing payload", e); return null; } catch (JsonMappingException e) { LOG.error("Error while mapping payload", e); return null; } catch (IOException e) { LOG.error("IO exception while parsing payload", e); return null; } }  boolean verifyPayload(String intuitSignature, String payload); WebhooksEvent getWebhooksEvent(String payload);  }