Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.
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 @@ -81,6 +81,21 @@ public void testFieldMask() throws IOException {
.isEqualTo("{\"name\":\"tree_frog\",\"limbs\":[\"legs\"],\"poisonous\":null}");
}

@Test
public void testPartialFieldMask() throws IOException {
List<String> fieldMask = Lists.newArrayList("name", "poisonous");
FrogMessage frogMessage = new FrogMessage("tree_frog", 4, Lists.newArrayList("legs"), null);

InsertFrogRequest insertFrogRequest =
new InsertFrogRequest("name/tree_frog", "request57", frogMessage, fieldMask);

OutputStream outputStream = insertFrog(insertFrogRequest);

// JSON content string must contain all and ONLY the fields in fieldMask, even if the value is null.
Truth.assertThat(outputStream.toString())
.isEqualTo("{\"name\":\"tree_frog\",\"poisonous\":null}");
}

@Test
public void testNullFieldMask() throws IOException {
List<String> nullFieldMask = null;
Expand Down