DefaultClientTable implements ClientTable<E> { @Override public Event append(String user, String operation, String objectId, String data) { Event event = new DefaultEvent(user, operation, objectId, LocalDateTime.now(clock), data); this.accessor.append(event); return event; } DefaultClientTable(DatabaseAccessor accessor, Function<String, ? extends ClientOperation<E>> operationMap);   DefaultClientTable(DatabaseAccessor accessor, Function<String, ? extends ClientOperation<E>> operationMap, Clock clock); @Override String getName(); @Override Event append(String user, String operation, String objectId, String data); @Override Stream<E> findAll(); E findById(String id);  }
@Test @DisplayName("Appends operations") public void testAppend() { table.append("myUser", "ADD", "myObject", "myData"); ArgumentCaptor<Event> event = ArgumentCaptor.forClass(Event.class); verify(accessor).append(event.capture()); assertThat(event.getValue().getTime()).isEqualTo(now); assertThat(event.getValue().getUser()).isEqualTo("myUser"); assertThat(event.getValue().getOperation()).isEqualTo("ADD"); assertThat(event.getValue().getObjectId()).isEqualTo("myObject"); assertThat(event.getValue().getData()).isEqualTo("myData"); }