From 691855bed2f00d97ba443bb9ae681ba31a44ef3c Mon Sep 17 00:00:00 2001 From: Alex Mukha Date: Thu, 6 Aug 2020 12:44:48 +0100 Subject: [PATCH] Fix json serialisation for StatsSearchTest --- .../alfresco/rest/search/RestRequestStatsModel.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packaging/tests/tas-restapi/src/main/java/org/alfresco/rest/search/RestRequestStatsModel.java b/packaging/tests/tas-restapi/src/main/java/org/alfresco/rest/search/RestRequestStatsModel.java index edb3a91acb..6057da4722 100644 --- a/packaging/tests/tas-restapi/src/main/java/org/alfresco/rest/search/RestRequestStatsModel.java +++ b/packaging/tests/tas-restapi/src/main/java/org/alfresco/rest/search/RestRequestStatsModel.java @@ -1,5 +1,6 @@ package org.alfresco.rest.search; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import org.alfresco.rest.core.IRestModel; import org.alfresco.rest.core.assertion.ModelAssertion; @@ -12,6 +13,16 @@ import java.util.List; * Generated from 'Alfresco Content Services REST API' swagger file * Base Path {@linkplain /alfresco/api/-default-/public/search/versions/1} */ + +/* + From Jackson 2.8 this annotation is required to make sure that defaults are read from the actual field values, + as opposing to field type defaults. For example, the default for boolean primitive is "false", + but the default for the "min" field in this class is "true". + This configuration does not affect the product and is only related to test framework and how it serializes the request into JSON. + See org.alfresco.utility.model.TestModel#toJson + Note: This change was required for org.alfresco.test.search.functional.searchServices.search.StatsSearchTest + */ +@JsonInclude(JsonInclude.Include.NON_DEFAULT) public class RestRequestStatsModel extends TestModel implements IRestModel { @Override