public static final WriteTransactionCustomizer writeOneTopMultipleNested( final String topName, final String... nestedName) { CollectionNodeBuilder<MapEntryNode, OrderedMapNode> nestedMapBuilder = nestedMap(); for (String nestedItem : nestedName) { nestedMapBuilder.addChild(nestedList(nestedItem).build()); } final ContainerNode data = top() .addChild( topLevelMap() .addChild(topLevelList(topName).addChild(nestedMapBuilder.build()).build()) .build()) .build(); return DatastoreTestTask.simpleWrite(TOP_LEVEL, data); }
/** * Create a new test task. The task will operate on the backed database, and will use the proper * background executor service. * * @return Test task initialized to clean up {@value #TOP_LEVEL} and its children. */ public final DatastoreTestTask newTestTask() { return new DatastoreTestTask(datastore, dclExecutorService) .cleanup(DatastoreTestTask.simpleDelete(TOP_LEVEL)); }
public static final WriteTransactionCustomizer deleteNested( final String topName, final String nestedName) { return DatastoreTestTask.simpleDelete(path(topName, nestedName)); }