diff --git a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ExemptionCategoriesGetUnitTest.java b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ExemptionCategoriesGetUnitTest.java index 137f0c3b04..522bf7f967 100644 --- a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ExemptionCategoriesGetUnitTest.java +++ b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ExemptionCategoriesGetUnitTest.java @@ -19,11 +19,11 @@ package org.alfresco.module.org_alfresco_module_rm.script.classification; +import static java.util.Arrays.asList; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.mockito.Mockito.doReturn; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -77,13 +77,13 @@ public class ExemptionCategoriesGetUnitTest extends BaseWebScriptUnitTest // Create test data. ExemptionCategory exemptionCategoryA = new ExemptionCategory("idA", "labelA"); ExemptionCategory exemptionCategoryB = new ExemptionCategory("idB", "labelB"); - List exemptionCategories = Arrays.asList(exemptionCategoryA, exemptionCategoryB); + List exemptionCategories = asList(exemptionCategoryA, exemptionCategoryB); // setup interactions doReturn(exemptionCategories).when(mockClassificationSchemeService).getExemptionCategories(); // setup web script parameters - Map parameters = new HashMap(); + Map parameters = new HashMap<>(); // execute web script JSONObject json = executeJSONWebScript(parameters); @@ -92,7 +92,12 @@ public class ExemptionCategoriesGetUnitTest extends BaseWebScriptUnitTest // check the JSON result using Jackson to allow easy equality testing. ObjectMapper mapper = new ObjectMapper(); - String expectedJSONString = "{\"data\":{\"items\":[{\"displayLabel\":\"labelA\",\"id\":\"idA\",\"fullCategory\":\"idA: labelA\"},{\"displayLabel\":\"labelB\",\"id\":\"idB\",\"fullCategory\":\"idB: labelB\"}]}}"; + String expectedJSONString = "{\"data\":{" + + "\"items\":[" + + "{\"displayLabel\":\"labelA\"," + "\"id\":\"idA\"," + "\"fullCategory\":\"idA: labelA\"}," + + "{\"displayLabel\":\"labelB\",\"id\":\"idB\",\"fullCategory\":\"idB: labelB\"}" + + "]" + + "}}"; JsonNode expected = mapper.readTree(expectedJSONString); assertEquals(expected, mapper.readTree(actualJSONString)); }