From 708b7bd0d4bc6d1844eae7802cb4666f5d4f993e Mon Sep 17 00:00:00 2001 From: Neil McErlean Date: Tue, 23 Jun 2015 10:11:37 +0000 Subject: [PATCH] Trivial reformatting done as part of RM-2323. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@106839 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../ExemptionCategoriesGetUnitTest.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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)); }