mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -19,11 +19,11 @@
|
|||||||
|
|
||||||
package org.alfresco.module.org_alfresco_module_rm.script.classification;
|
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.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.mockito.Mockito.doReturn;
|
import static org.mockito.Mockito.doReturn;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -77,13 +77,13 @@ public class ExemptionCategoriesGetUnitTest extends BaseWebScriptUnitTest
|
|||||||
// Create test data.
|
// Create test data.
|
||||||
ExemptionCategory exemptionCategoryA = new ExemptionCategory("idA", "labelA");
|
ExemptionCategory exemptionCategoryA = new ExemptionCategory("idA", "labelA");
|
||||||
ExemptionCategory exemptionCategoryB = new ExemptionCategory("idB", "labelB");
|
ExemptionCategory exemptionCategoryB = new ExemptionCategory("idB", "labelB");
|
||||||
List<ExemptionCategory> exemptionCategories = Arrays.asList(exemptionCategoryA, exemptionCategoryB);
|
List<ExemptionCategory> exemptionCategories = asList(exemptionCategoryA, exemptionCategoryB);
|
||||||
|
|
||||||
// setup interactions
|
// setup interactions
|
||||||
doReturn(exemptionCategories).when(mockClassificationSchemeService).getExemptionCategories();
|
doReturn(exemptionCategories).when(mockClassificationSchemeService).getExemptionCategories();
|
||||||
|
|
||||||
// setup web script parameters
|
// setup web script parameters
|
||||||
Map<String, String> parameters = new HashMap<String, String>();
|
Map<String, String> parameters = new HashMap<>();
|
||||||
|
|
||||||
// execute web script
|
// execute web script
|
||||||
JSONObject json = executeJSONWebScript(parameters);
|
JSONObject json = executeJSONWebScript(parameters);
|
||||||
@@ -92,7 +92,12 @@ public class ExemptionCategoriesGetUnitTest extends BaseWebScriptUnitTest
|
|||||||
|
|
||||||
// check the JSON result using Jackson to allow easy equality testing.
|
// check the JSON result using Jackson to allow easy equality testing.
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
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);
|
JsonNode expected = mapper.readTree(expectedJSONString);
|
||||||
assertEquals(expected, mapper.readTree(actualJSONString));
|
assertEquals(expected, mapper.readTree(actualJSONString));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user