assertThat(dao.findAll()).isEmpty();
}
@Test
public void testCRUD() {
final Todo todo = Todo.newBuilder()
.id(UUID.randomUUID().toString())
.email("john@example.com")
.build();
dao.createTableIfNotExists();
dao.insert(todo);
assertThat(dao.exists(todo.getId())).isTrue();
assertThat(dao.exists("dummy-missing-id")).isFalse();
assertThat(dao.findAll()).contains(todo);
assertThat(dao.findById(todo.getId())).isEqualTo(todo);
final Item item = Item.newBuilder()
.title("Something")
.created(new Date())
.build();
Todo updated = todo.toBuilder().item(item).build();
dao.update(updated);
assertThat(dao.findById(updated.getId())).isEqualTo(updated);
dao.delete(updated.getId());
assertThat(dao.findAll()).isEmpty();
}