aboutsummaryrefslogtreecommitdiffstats
path: root/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/MockedOperationHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/MockedOperationHandler.java')
-rw-r--r--vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/MockedOperationHandler.java11
1 files changed, 9 insertions, 2 deletions
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 3b16d9a378c..297576f1bef 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
@@ -55,9 +55,16 @@ public class MockedOperationHandler implements OperationHandler {
}
@Override
- public Optional<String> get(RestUri restUri) throws RestApiException {
+ public Optional<String> get(RestUri restUri, Optional<String> fieldSet) throws RestApiException {
log.append("GET: " + restUri.generateFullId());
- return Optional.empty();
+ // This is _not_ an elegant way to return data back to the test.
+ // An alternative is removing this entire class in favor of explicit mock expectations.
+ return fieldSet.map(fs -> String.format("{\"fields\": {\"fieldset\": \"%s\"}}", fs));
+ }
+
+ @Override
+ public Optional<String> get(RestUri restUri) throws RestApiException {
+ return get(restUri, Optional.empty());
}
}