summaryrefslogtreecommitdiffstats
path: root/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/DocumentV1ApiTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/DocumentV1ApiTest.java')
-rw-r--r--vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/DocumentV1ApiTest.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/DocumentV1ApiTest.java b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/DocumentV1ApiTest.java
index c8fcb4c4635..04639db4dac 100644
--- a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/DocumentV1ApiTest.java
+++ b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/DocumentV1ApiTest.java
@@ -411,6 +411,7 @@ public class DocumentV1ApiTest {
DocumentUpdate expectedUpdate = new DocumentUpdate(doc3.getDataType(), doc3.getId());
expectedUpdate.addFieldUpdate(FieldUpdate.createAssign(doc3.getField("artist"), new StringFieldValue("Lisa Ekdahl")));
expectedUpdate.setCondition(new TestAndSetCondition("true"));
+ expectedUpdate.setCreateIfNonExistent(true);
assertEquals(expectedUpdate, update);
parameters.responseHandler().get().handleResponse(new UpdateResponse(0, false));
assertEquals(parameters().withRoute("content"), parameters);
@@ -419,10 +420,16 @@ public class DocumentV1ApiTest {
response = driver.sendRequest("http://localhost/document/v1/space/music/docid?selection=true&cluster=content&timeChunk=10", PUT,
"""
{
+ "extra-ignored-field": { "foo": [{ }], "bar": null },
+ "another-ignored-field": [{ "foo": [{ }] }],
+ "remove": "id:ns:type::ignored",
+ "put": "id:ns:type::ignored",
"fields": {
"artist": { "assign": "Lisa Ekdahl" },
"nonexisting": { "assign": "Ignored" }
- }
+ },
+ "post": "id:ns:type::ignored",
+ "create": true
}""");
assertSameJson("""
{
@@ -778,7 +785,7 @@ public class DocumentV1ApiTest {
response = driver.sendRequest("http://localhost/document/v1/space/music/number/1/two?condition=test%20it", POST, "");
assertSameJson("{" +
" \"pathId\": \"/document/v1/space/music/number/1/two\"," +
- " \"message\": \"Could not read document, no document?\"" +
+ " \"message\": \"expected start of root object, got null\"" +
"}",
response.readAll());
assertEquals(400, response.getStatus());
@@ -791,7 +798,8 @@ public class DocumentV1ApiTest {
"}");
Inspector responseRoot = SlimeUtils.jsonToSlime(response.readAll()).get();
assertEquals("/document/v1/space/music/number/1/two", responseRoot.field("pathId").asString());
- assertTrue(responseRoot.field("message").asString().startsWith("Unexpected character ('┻' (code 9531 / 0x253b)): was expecting double-quote to start field name"));
+ assertTrue(responseRoot.field("message").asString(),
+ responseRoot.field("message").asString().startsWith("failed parsing document: Unexpected character ('┻' (code 9531 / 0x253b)): was expecting double-quote to start field name"));
assertEquals(400, response.getStatus());
// PUT on a unknown document type is a 400