@Test public void givenInteractionContextWithEventWhenSerializeThenIsSerialized() throws JsonProcessingException { List<Event> events = new ArrayList<>(); events.add(new ChangedDescriptionEvent() {{ description = "Hello World"; }}); events.add(new ChangedDescriptionEvent() {{ description = "Hello World2"; }}); Map<String, String> attributes = new HashMap<>(); attributes.put("user", "rickard"); InteractionContext interaction = new InteractionContext("task", 1, new Date(12345), attributes, new Interaction(new Identifier(1), events)); String json = eventStorage.serialize(interaction); System.out.println(json); }
String serialize(InteractionContext interactionContext) throws JsonProcessingException { return mapper.writeValueAsString(interactionContext); }
FileEventStorage implements InteractionContextSink, Closeable { String serialize(InteractionContext interactionContext) throws JsonProcessingException { return mapper.writeValueAsString(interactionContext); } }
FileEventStorage implements InteractionContextSink, Closeable { String serialize(InteractionContext interactionContext) throws JsonProcessingException { return mapper.writeValueAsString(interactionContext); } FileEventStorage(ObjectMapper mapper); }
FileEventStorage implements InteractionContextSink, Closeable { String serialize(InteractionContext interactionContext) throws JsonProcessingException { return mapper.writeValueAsString(interactionContext); } FileEventStorage(ObjectMapper mapper); @Override void apply(InteractionContext interactionContext); void load(File file, EventStore eventStore); void save(File file, EventSource eventSource); @Override void close(); }
FileEventStorage implements InteractionContextSink, Closeable { String serialize(InteractionContext interactionContext) throws JsonProcessingException { return mapper.writeValueAsString(interactionContext); } FileEventStorage(ObjectMapper mapper); @Override void apply(InteractionContext interactionContext); void load(File file, EventStore eventStore); void save(File file, EventSource eventSource); @Override void close();  }