From 401833665e281289838bd47950b85234f5e36a03 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 12 Jan 2021 22:43:39 +0200 Subject: [PATCH] ACS-1125 : Bump json from 20200518 to 20201115 (#160) * Bump json from 20200518 to 20201115 Bumps [json](https://github.com/douglascrockford/JSON-java) from 20200518 to 20201115. - [Release notes](https://github.com/douglascrockford/JSON-java/releases) - [Commits](https://github.com/douglascrockford/JSON-java/commits) Signed-off-by: dependabot-preview[bot] * ACS-1125 : Fix failing tests after json upgrade Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: DenisGabriela --- pom.xml | 2 +- .../preference/PreferenceServiceTest.java | 54 ++++++++++--------- .../rest/api/search/ResultMapperTests.java | 7 +-- 3 files changed, 33 insertions(+), 30 deletions(-) diff --git a/pom.xml b/pom.xml index bf8db1d270..62916ad494 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 8.15 1.68 3.7.0 - 20200518 + 20201115 1.4-DBCP330 2.8.0 2.8.5 diff --git a/remote-api/src/test/java/org/alfresco/repo/web/scripts/preference/PreferenceServiceTest.java b/remote-api/src/test/java/org/alfresco/repo/web/scripts/preference/PreferenceServiceTest.java index f15adac18e..abd5faaeb4 100644 --- a/remote-api/src/test/java/org/alfresco/repo/web/scripts/preference/PreferenceServiceTest.java +++ b/remote-api/src/test/java/org/alfresco/repo/web/scripts/preference/PreferenceServiceTest.java @@ -1,30 +1,32 @@ -/* - * #%L - * Alfresco Remote API - * %% - * Copyright (C) 2005 - 2016 Alfresco Software Limited - * %% - * This file is part of the Alfresco software. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * Alfresco is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Alfresco is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - * #L% - */ +/* + * #%L + * Alfresco Remote API + * %% + * Copyright (C) 2005 - 2016 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ package org.alfresco.repo.web.scripts.preference; +import java.math.BigDecimal; + import org.alfresco.model.ContentModel; import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.security.authentication.AuthenticationUtil; @@ -204,7 +206,7 @@ public class PreferenceServiceTest extends BaseWebScriptTest { assertEquals("value", jsonObject.get("stringValue")); assertEquals(10, jsonObject.get("numberValue")); - assertEquals(3.142, jsonObject.get("numberValue2")); + assertEquals(BigDecimal.valueOf(3.142), jsonObject.get("numberValue2")); } } diff --git a/remote-api/src/test/java/org/alfresco/rest/api/search/ResultMapperTests.java b/remote-api/src/test/java/org/alfresco/rest/api/search/ResultMapperTests.java index c7b2995510..7d52e9e9ea 100644 --- a/remote-api/src/test/java/org/alfresco/rest/api/search/ResultMapperTests.java +++ b/remote-api/src/test/java/org/alfresco/rest/api/search/ResultMapperTests.java @@ -40,6 +40,7 @@ import static org.mockito.Mockito.when; import java.io.IOException; import java.io.Serializable; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -363,14 +364,14 @@ public class ResultMapperTests assertEquals("created",statsFacet.getLabel()); Set statsMetrics = statsFacet.getBuckets().get(0).getMetrics(); assertEquals(8,statsMetrics.size()); - assertTrue(statsMetrics.contains(new SimpleMetric(METRIC_TYPE.sumOfSquares, 2.1513045770343806E27 ))); + assertTrue(statsMetrics.contains(new SimpleMetric(METRIC_TYPE.sumOfSquares, BigDecimal.valueOf(2.1513045770343806E27) ))); assertTrue(statsMetrics.contains(new SimpleMetric(METRIC_TYPE.min, "2011-02-15T20:16:27.080Z" ))); assertTrue(statsMetrics.contains(new SimpleMetric(METRIC_TYPE.max, "2017-04-10T15:06:30.143Z" ))); assertTrue(statsMetrics.contains(new SimpleMetric(METRIC_TYPE.mean, "2016-09-05T04:20:12.898Z" ))); assertTrue(statsMetrics.contains(new SimpleMetric(METRIC_TYPE.countValues, 990 ))); assertTrue(statsMetrics.contains(new SimpleMetric(METRIC_TYPE.missing, 290 ))); - assertTrue(statsMetrics.contains(new SimpleMetric(METRIC_TYPE.sum, 1.458318720769983E15))); - assertTrue(statsMetrics.contains(new SimpleMetric(METRIC_TYPE.stddev, 5.6250677994522545E10))); + assertTrue(statsMetrics.contains(new SimpleMetric(METRIC_TYPE.sum, BigDecimal.valueOf(1.458318720769983E15)))); + assertTrue(statsMetrics.contains(new SimpleMetric(METRIC_TYPE.stddev, BigDecimal.valueOf(5.6250677994522545E10)))); statsFacet = searchContext.getFacets().get(6); assertEquals("numericLabel",statsFacet.getLabel());