@Test
public void testDelete() {

    // Create a record in the database
    Datastore datastore = getService();
    KeyFactory keyFactory = datastore.newKeyFactory().setKind("Foo");
    Key key = keyFactory.newKey("myid");
    Entity.Builder builder = Entity.newBuilder(key);
    builder.set("longVal", 1564094282994L);
    builder.set("byteVal", Blob.copyFrom("abcd".getBytes()));
    Entity entity = builder.build();
    datastore.put(entity);
    // Delete the record
    Foo foo = new Foo("myid", null, null, List.of("hello", "hi"));
    CloudDatastoreBackend backend = new CloudDatastoreBackend();
    backend.delete(foo);
    // Check that the record was deleted
    keyFactory = datastore.newKeyFactory().setKind("Foo");
    key = keyFactory.newKey("myid");
    entity = datastore.get(key);
    assertNull(entity);
}