From ac21c5723216c767983e304e9db2df1fb11d90c7 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 9 Feb 2018 16:58:37 +0000 Subject: [PATCH] Search-577, added helper method for a test --- pom.xml | 2 +- .../resources/alfresco/public-rest-context.xml | 1 + .../rest/api/search/SerializerTestHelper.java | 16 ++++++++++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 2e9b394b6a..f76600c324 100644 --- a/pom.xml +++ b/pom.xml @@ -37,7 +37,7 @@ 6.23 6.17 - 7.2 + 7.3-SNAPSHOT 1.0 2.8.10 diff --git a/src/main/resources/alfresco/public-rest-context.xml b/src/main/resources/alfresco/public-rest-context.xml index 8936d28ecb..ae137544d7 100644 --- a/src/main/resources/alfresco/public-rest-context.xml +++ b/src/main/resources/alfresco/public-rest-context.xml @@ -991,6 +991,7 @@ + diff --git a/src/test/java/org/alfresco/rest/api/search/SerializerTestHelper.java b/src/test/java/org/alfresco/rest/api/search/SerializerTestHelper.java index 7808f24637..a13ccebd38 100644 --- a/src/test/java/org/alfresco/rest/api/search/SerializerTestHelper.java +++ b/src/test/java/org/alfresco/rest/api/search/SerializerTestHelper.java @@ -1,6 +1,6 @@ -/*- +/* * #%L - * Alfresco Remote API + * Alfresco Repository * %% * Copyright (C) 2005 - 2016 Alfresco Software Limited * %% @@ -127,4 +127,16 @@ public class SerializerTestHelper implements RequestReader }); return out.toString(); } + public Object extractFromJson(String json, Class clasz) throws IOException + { + Content content = mock(Content.class); + when(content.getReader()).thenReturn(new StringReader(json)); + WebScriptRequest request = mock(WebScriptRequest.class); + when(request.getContent()).thenReturn(content); + return extractJsonContent(request, jsonHelper, clasz); + } + public Object searchSQLQueryFromJson(String query, Class classz) throws IOException + { + return extractFromJson(query, classz); + } }