@Test public void getEventsWithBodyAndHeaders() throws Exception { final ImmutableMap<String, String> headersMap = new ImmutableMap.Builder<String, String>().put ("header1", "value1").put ("header2", "value2").build(); final List<Event> events = handler.getEvents("body", headersMap); Assertions.assertThat(events).isNotNull(); Assertions.assertThat(events.get(0).getBody()).isEqualTo("body".getBytes()); Assertions.assertThat(events.get(0).getHeaders()).isEqualTo(headersMap); }
@Override public List<Event> getEvents(String body, Map<String, String> headers) { List<Event> events = new ArrayList<Event>(0); events.add(EventBuilder.withBody(body, Charsets.UTF_8, headers)); return events; }
DefaultRestSourceHandler implements RestSourceHandler { @Override public List<Event> getEvents(String body, Map<String, String> headers) { List<Event> events = new ArrayList<Event>(0); events.add(EventBuilder.withBody(body, Charsets.UTF_8, headers)); return events; } }
DefaultRestSourceHandler implements RestSourceHandler { @Override public List<Event> getEvents(String body, Map<String, String> headers) { List<Event> events = new ArrayList<Event>(0); events.add(EventBuilder.withBody(body, Charsets.UTF_8, headers)); return events; } DefaultRestSourceHandler(); }
DefaultRestSourceHandler implements RestSourceHandler { @Override public List<Event> getEvents(String body, Map<String, String> headers) { List<Event> events = new ArrayList<Event>(0); events.add(EventBuilder.withBody(body, Charsets.UTF_8, headers)); return events; } DefaultRestSourceHandler(); @Override List<Event> getEvents(String body, Map<String, String> headers); @Override void configure(Context context); }
DefaultRestSourceHandler implements RestSourceHandler { @Override public List<Event> getEvents(String body, Map<String, String> headers) { List<Event> events = new ArrayList<Event>(0); events.add(EventBuilder.withBody(body, Charsets.UTF_8, headers)); return events; } DefaultRestSourceHandler(); @Override List<Event> getEvents(String body, Map<String, String> headers); @Override void configure(Context context);  }