Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public class ITDatastoreTest {
private static Key KEY3;
private static Key KEY4;
private static Key KEY5;
private static Key KEY6;
private static final String MARKS_KIND = "Marks";
private static FullEntity<IncompleteKey> PARTIAL_ENTITY1;
private static FullEntity<IncompleteKey> PARTIAL_ENTITY2;
Expand Down Expand Up @@ -193,6 +194,10 @@ public ITDatastoreTest(
KEY3 = Key.newBuilder(KEY2).setName("bla").setNamespace(NAMESPACE).build();
KEY4 = Key.newBuilder(KEY2).setName("newName1").setNamespace(NAMESPACE).build();
KEY5 = Key.newBuilder(KEY2).setName("newName2").setNamespace(NAMESPACE).build();
KEY6 =
Key.newBuilder(options.getProjectId(), KIND2, 100, options.getDatabaseId())
.setNamespace(NAMESPACE)
.build();

LIST_VALUE2 = ListValue.of(Collections.singletonList(KeyValue.of(KEY1)));

Expand Down Expand Up @@ -1787,6 +1792,21 @@ public void testGet() {
assertFalse(entity.contains("bla"));
}

@Test
public void testIncompleteKey() {
Key parentKey = null;
try {
IncompleteKey incompleteKey = IncompleteKey.newBuilder(KEY6, KIND1).build();
parentKey = incompleteKey.getParent();
Entity entity = Entity.newBuilder(parentKey).set("name", "val").build();
datastore.put(entity);
Entity retrievedEntity = datastore.get(parentKey);
assertThat(retrievedEntity).isEqualTo(entity);
} finally {
datastore.delete(parentKey);
}
}

@Test
public void testGetWithReadTime() throws InterruptedException {
Key key =
Expand Down