In the replication webscripts, return single responses still wrapped in data:{} entries

Update unit tests following this json change, and also fix them after the json changes from r21749


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@21790 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Nick Burch
2010-08-13 12:45:05 +00:00
parent 4716fae43a
commit 3c16d97c3c
8 changed files with 63 additions and 51 deletions

View File

@@ -620,7 +620,7 @@ public class RunningActionRestApiTest extends BaseWebScriptTest
assertEquals(Status.STATUS_OK, response.getStatus());
String jsonStr = response.getContentAsString();
JSONObject jsonRD = new JSONObject(jsonStr);
JSONObject jsonRD = new JSONObject(jsonStr).getJSONObject("data");
assertNotNull(jsonRD);
assertEquals(id, jsonRD.get("actionId"));
assertEquals(ReplicationDefinitionImpl.EXECUTOR_NAME, jsonRD.get("actionType"));
@@ -662,7 +662,7 @@ public class RunningActionRestApiTest extends BaseWebScriptTest
assertEquals(Status.STATUS_OK, response.getStatus());
jsonStr = response.getContentAsString();
jsonRD = new JSONObject(jsonStr);
jsonRD = new JSONObject(jsonStr).getJSONObject("data");
assertNotNull(jsonRD);
assertEquals(id2, jsonRD.get("actionId"));
assertEquals(ReplicationDefinitionImpl.EXECUTOR_NAME, jsonRD.get("actionType"));
@@ -679,7 +679,7 @@ public class RunningActionRestApiTest extends BaseWebScriptTest
rd = replicationService.loadReplicationDefinition("Test1");
jsonStr = response.getContentAsString();
jsonRD = new JSONObject(jsonStr);
jsonRD = new JSONObject(jsonStr).getJSONObject("data");
assertNotNull(jsonRD);
assertEquals(id, jsonRD.get("actionId"));
assertEquals(ReplicationDefinitionImpl.EXECUTOR_NAME, jsonRD.get("actionType"));
@@ -702,7 +702,7 @@ public class RunningActionRestApiTest extends BaseWebScriptTest
assertEquals(Status.STATUS_OK, response.getStatus());
jsonStr = response.getContentAsString();
jsonRD = new JSONObject(jsonStr);
jsonRD = new JSONObject(jsonStr).getJSONObject("data");
assertNotNull(jsonRD);
assertEquals(id3, jsonRD.get("actionId"));
assertEquals(ReplicationDefinitionImpl.EXECUTOR_NAME, jsonRD.get("actionType"));
@@ -834,7 +834,7 @@ public class RunningActionRestApiTest extends BaseWebScriptTest
// Check we got back some details on it
String jsonStr = response.getContentAsString();
JSONObject jsonRD = new JSONObject(jsonStr);
JSONObject jsonRD = new JSONObject(jsonStr).getJSONObject("data");
assertNotNull(jsonRD);
assertEquals(id, jsonRD.get("actionId"));
@@ -916,7 +916,7 @@ public class RunningActionRestApiTest extends BaseWebScriptTest
// Check we got back some details on it
String jsonStr = response.getContentAsString();
JSONObject jsonRD = new JSONObject(jsonStr);
JSONObject jsonRD = new JSONObject(jsonStr).getJSONObject("data");
assertNotNull(jsonRD);
assertEquals(id, jsonRD.get("actionId"));