diff options
Diffstat (limited to 'vespaclient-container-plugin/src/test')
4 files changed, 6 insertions, 6 deletions
diff --git a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/OperationHandlerImplTest.java b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/OperationHandlerImplTest.java index 87360fcf998..8b7276441f2 100644 --- a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/OperationHandlerImplTest.java +++ b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/OperationHandlerImplTest.java @@ -66,8 +66,9 @@ public class OperationHandlerImplTest { ByteArrayOutputStream stream = new ByteArrayOutputStream(); e.getResponse().render(stream); String errorMsg = new String( stream.toByteArray()); - assertThat(errorMsg, is("{\"errors\":[\"Your vespa cluster contains the content clusters foo2 " + - "(configId2), foo (configId), foo3 (configId2), not wrong. Please select a valid vespa cluster.\"]}")); + assertThat(errorMsg, is("{\"errors\":[{\"description\":" + + "\"MISSING_CLUSTER Your vespa cluster contains the content clusters foo2 (configId2), foo (configId)," + + " foo3 (configId2), not wrong. Please select a valid vespa cluster.\",\"id\":-9}]}")); return; } fail("Expected exception"); diff --git a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/MockedOperationHandler.java b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/MockedOperationHandler.java index 2d98b72e579..f4f745fbcee 100644 --- a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/MockedOperationHandler.java +++ b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/MockedOperationHandler.java @@ -45,7 +45,7 @@ public class MockedOperationHandler implements OperationHandler { String theLog = log.toString(); log = new StringBuilder(); deleteCount = 0; - throw new RestApiException(Response.createErrorResponse(666, theLog)); + throw new RestApiException(Response.createErrorResponse(666, theLog, RestUri.apiErrorCodes.ERROR_ID_BASIC_USAGE)); } log.append("DELETE: " + restUri.generateFullId()); } diff --git a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/RestApiTest.java b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/RestApiTest.java index 3971b4320b5..ecaaba77435 100644 --- a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/RestApiTest.java +++ b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/RestApiTest.java @@ -96,7 +96,6 @@ public class RestApiTest { assertThat(x, is(post_test_response_cond)); } - String post_test_empty_response = "{\"errors\":[\"Could not read document, no document?\"]"; @Test public void testEmptyPost() throws Exception { Request request = new Request("http://localhost:" + getFirstListenPort() + post_test_uri); @@ -104,7 +103,7 @@ public class RestApiTest { StringEntity entity = new StringEntity("", ContentType.create("application/json")); httpPost.setEntity(entity); String x = doRest(httpPost); - assertThat(x, startsWith(post_test_empty_response)); + assertThat(x, containsString("Could not read document, no document?")); } String update_test_uri = "/document/v1/namespace/testdocument/docid/c"; diff --git a/vespaclient-container-plugin/src/test/java/com/yahoo/feedhandler/v3/FeedTesterV3.java b/vespaclient-container-plugin/src/test/java/com/yahoo/feedhandler/v3/FeedTesterV3.java index 708a9ed7a6b..7e5ac4dff3a 100644 --- a/vespaclient-container-plugin/src/test/java/com/yahoo/feedhandler/v3/FeedTesterV3.java +++ b/vespaclient-container-plugin/src/test/java/com/yahoo/feedhandler/v3/FeedTesterV3.java @@ -111,7 +111,7 @@ public class FeedTesterV3 { Object[] args = invocation.getArguments(); PutDocumentMessage putDocumentMessage = (PutDocumentMessage) args[0]; ReplyContext replyContext = (ReplyContext)putDocumentMessage.getContext(); - replyContext.feedReplies.add(new OperationStatus("message", replyContext.docId, ErrorCode.OK, "trace")); + replyContext.feedReplies.add(new OperationStatus("message", replyContext.docId, ErrorCode.OK, false, "trace")); Result result = mock(Result.class); when(result.isAccepted()).thenReturn(true); return result; |