@Test
  public void shouldUpdateReportingData() throws Exception {
    Map<String, Object> data = new HashMap<>();
    ReportingData reportingData = new ReportingData("Boo").with("abc", "def");
    ReportDataUpdateRequest dataRequest =
        new ReportDataUpdateRequest()
            .withType("Boo")
            .withReportingData(asList(reportingData))
            .withStartDate("2013-01-26")
            .withEndDate("2013-02-25");
    data.put("data", dataRequest);
    when(agent.post(eq("http://drishti/update"), any(String.class), eq("application/json")))
        .thenReturn(new HttpResponse(true, null));

    listener.updateReportingData(new MotechEvent("SUBJECT", data));

    verify(agent)
        .post(
            "http://drishti/update",
            "{\"startDate\":\"2013-01-26\",\"endDate\":\"2013-02-25\",\"type\":\"Boo\",\"reportingData\":[{\"type\":\"Boo\",\"data\":{\"abc\":\"def\"}}]}",
            "application/json");
  }