ClientDAO { public void deleteClient(Client client) { dslContext.transaction(configuration -> { DSL.using(configuration) .delete(CLIENTS) .where(CLIENTS.ID.eq(client.getId())) .execute(); DSL.using(configuration) .delete(MEMBERSHIPS) .where(MEMBERSHIPS.CLIENTID.eq(client.getId())) .execute(); }); } private  ClientDAO(DSLContext dslContext, ClientMapper clientMapper,
      RowHmacGenerator rowHmacGenerator); long createClient(String name, String user, String description,
      @Nullable URI spiffeId); void deleteClient(Client client); void sawClient(Client client, @Nullable Principal principal); Optional<Client> getClientByName(String name); Optional<Client> getClientBySpiffeId(URI spiffeId); Optional<Client> getClientById(long id); ImmutableSet<Client> getClients();  }
@Test public void deleteClient() { int before = tableSize(); clientDAO.deleteClient(client1); assertThat(tableSize()).isEqualTo(before - 1); assertThat(clientDAO.getClients()).containsOnly(client2); }