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
This commit is contained in:
Neil McErlean
2015-06-23 10:11:37 +00:00
parent 2fb85342f1
commit 708b7bd0d4

View File

@@ -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<ExemptionCategory> exemptionCategories = Arrays.asList(exemptionCategoryA, exemptionCategoryB);
List<ExemptionCategory> exemptionCategories = asList(exemptionCategoryA, exemptionCategoryB);
// setup interactions
doReturn(exemptionCategories).when(mockClassificationSchemeService).getExemptionCategories();
// setup web script parameters
Map<String, String> parameters = new HashMap<String, String>();
Map<String, String> 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));
}