@Test public void serdesUndefinedEventMapped() { EventResourceReal eventResource = new EventResourceReal(null, new GsonSupport()); Map<String, Object> uemap = Maps.newHashMap(); uemap.put("a", "1"); UndefinedEventMapped<Map<String, Object>> ue = new UndefinedEventMapped<Map<String, Object>>().data(uemap); EventRecord<UndefinedEventMapped> er = new EventRecord<>("topic", ue); Map<String, Object> outmap = (Map<String, Object>) eventResource.mapEventRecordToSerdes(er); assertTrue(outmap.size() == 1); assertTrue(outmap.containsKey("a")); assertEquals("1", outmap.get("a")); }
@VisibleForTesting <T> Object mapEventRecordToSerdes(EventRecord<T> er) { return jsonSupport.transformEventRecord(er); }
EventResourceReal implements EventResource { @VisibleForTesting <T> Object mapEventRecordToSerdes(EventRecord<T> er) { return jsonSupport.transformEventRecord(er); } }
EventResourceReal implements EventResource { @VisibleForTesting <T> Object mapEventRecordToSerdes(EventRecord<T> er) { return jsonSupport.transformEventRecord(er); } EventResourceReal(NakadiClient client); @VisibleForTesting  EventResourceReal(NakadiClient client, JsonSupport jsonSupport); }
EventResourceReal implements EventResource { @VisibleForTesting <T> Object mapEventRecordToSerdes(EventRecord<T> er) { return jsonSupport.transformEventRecord(er); } EventResourceReal(NakadiClient client); @VisibleForTesting  EventResourceReal(NakadiClient client, JsonSupport jsonSupport); @Deprecated @Override EventResource scope(String scope); @Override EventResource retryPolicy(RetryPolicy retryPolicy); @Override EventResource flowId(final String flowId); @Override final Response send(String eventTypeName, Collection<T> events); @Override Response send(String eventTypeName, Collection<T> events,
      Map<String, Object> headers); @Override Response send(String eventTypeName, T event); @Override Response send(String eventTypeName, T event, Map<String, Object> headers); @Override BatchItemResponseCollection sendBatch(String eventTypeName, List<T> events); @Override BatchItemResponseCollection sendBatch(String eventTypeName, List<T> events,
      Map<String, Object> headers); }
EventResourceReal implements EventResource { @VisibleForTesting <T> Object mapEventRecordToSerdes(EventRecord<T> er) { return jsonSupport.transformEventRecord(er); } EventResourceReal(NakadiClient client); @VisibleForTesting  EventResourceReal(NakadiClient client, JsonSupport jsonSupport); @Deprecated @Override EventResource scope(String scope); @Override EventResource retryPolicy(RetryPolicy retryPolicy); @Override EventResource flowId(final String flowId); @Override final Response send(String eventTypeName, Collection<T> events); @Override Response send(String eventTypeName, Collection<T> events,
      Map<String, Object> headers); @Override Response send(String eventTypeName, T event); @Override Response send(String eventTypeName, T event, Map<String, Object> headers); @Override BatchItemResponseCollection sendBatch(String eventTypeName, List<T> events); @Override BatchItemResponseCollection sendBatch(String eventTypeName, List<T> events,
      Map<String, Object> headers);  }