in src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletMoveTest.java [113:138]
public void testMoveNodeExistingFail() throws IOException {
final String testPath = TEST_BASE_PATH + "/exist/" + System.currentTimeMillis();
Map<String, String> props = new HashMap<String, String>();
props.put("text", "Hello");
testClient.createNode(HTTP_BASE_URL + testPath + "/src", props);
// create dest node
props.put("text", "Hello Destination");
testClient.createNode(HTTP_BASE_URL + testPath + "/dest", props);
props.clear();
props.put(SlingPostConstants.RP_OPERATION, SlingPostConstants.OPERATION_MOVE);
props.put(SlingPostConstants.RP_DEST, testPath + "/dest");
try {
testClient.createNode(HTTP_BASE_URL + testPath, props);
} catch (HttpStatusCodeException hsce) {
// if we do not get the status code 302 message, fail
if (hsce.getActualStatus() == 302) {
throw hsce;
}
}
// expect unmodified dest
String content = getContent(HTTP_BASE_URL + testPath + "/dest.json", CONTENT_TYPE_JSON);
assertJavascript("Hello Destination", content, "out.println(data.text)");
}