mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
REPO-2451: Service Pack: MNT-17612: AccessDeniedException in Edit Offline Upload New Version
Update code formating
This commit is contained in:
@@ -41,17 +41,16 @@ public class NodesLockTests extends RestTest
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NODES, TestGroup.CORE })
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NODES }, executionType = ExecutionType.REGRESSION, description = "Verify Collaborator can lock PERSISTENT after EPHEMERAL lock made by different user")
|
||||
public void lockEphemeralAndRelockPersistentWithDifferentUser() throws Exception
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NODES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Collaborator can lock PERSISTENT after EPHEMERAL lock made by different user")
|
||||
public void lockEphemeralAndRelockPersistentDifferentUser() throws Exception
|
||||
{
|
||||
|
||||
STEP("1. Add user(s) as collaborators to the site created by administrator and add a file in this site.");
|
||||
file1 = dataContent.usingUser(adminUser).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
|
||||
|
||||
STEP("2. Verify with admin that the file is not locked.");
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model1.assertThat().field("isLocked").is(false);
|
||||
|
||||
STEP("3. Lock the file using mode EPHEMERAL with user1 (POST nodes/{nodeId}/lock).");
|
||||
@@ -63,18 +62,15 @@ public class NodesLockTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
STEP("4. Verify with user1 that the file is locked.");
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
.assertThat().field("properties").contains("lockType=READ_ONLY_LOCK");
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=EPHEMERAL").assertThat().field("properties").contains("lockType=READ_ONLY_LOCK");
|
||||
|
||||
STEP("5. Lock the file using mode PERSISTENT with user2 while the file is still locked");
|
||||
RestNodeLockBodyModel lockBodyModel2 = new RestNodeLockBodyModel();
|
||||
lockBodyModel2.setLifetime("PERSISTENT");
|
||||
lockBodyModel2.setTimeToExpire(20);
|
||||
lockBodyModel2.setType("ALLOW_OWNER_CHANGES");
|
||||
restClient.authenticateUser(user2).withCoreAPI().usingNode(file1).usingParams("include=isLocked")
|
||||
.lockNode(lockBodyModel2);
|
||||
restClient.authenticateUser(user2).withCoreAPI().usingNode(file1).usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNPROCESSABLE_ENTITY).assertLastError()
|
||||
.containsErrorKey(RestErrorModel.API_DEFAULT_ERRORKEY)
|
||||
.containsSummary(String.format(RestErrorModel.LOCKED_NODE_SUMMARY, file1.getNodeRefWithoutVersion()))
|
||||
@@ -82,17 +78,16 @@ public class NodesLockTests extends RestTest
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NODES, TestGroup.CORE })
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NODES }, executionType = ExecutionType.REGRESSION, description = "Verify Collaborator can lock PERSISTENT after EPHEMERAL lock made by different user")
|
||||
public void lockEphemeralAndRelockEphemeralWithDifferentUser() throws Exception
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NODES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Collaborator can lock PERSISTENT after EPHEMERAL lock made by different user")
|
||||
public void lockEphemeralAndRelockEphemeralDifferentUser() throws Exception
|
||||
{
|
||||
|
||||
STEP("1. Add user(s) as collaborators to the site created by administrator and add a file in this site.");
|
||||
file1 = dataContent.usingUser(adminUser).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
|
||||
|
||||
STEP("2. Verify with admin that the file is not locked.");
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model1.assertThat().field("isLocked").is(false);
|
||||
|
||||
STEP("3. Lock the file using mode EPHEMERAL with user1 (POST nodes/{nodeId}/lock).");
|
||||
@@ -104,9 +99,9 @@ public class NodesLockTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
STEP("4. Verify with user1 that the file is locked.");
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
.assertThat().field("properties").contains("lockType=READ_ONLY_LOCK");
|
||||
|
||||
STEP("5. Lock the file using mode EPHEMERAL with user2 while the file is still locked");
|
||||
@@ -114,8 +109,7 @@ public class NodesLockTests extends RestTest
|
||||
lockBodyModel2.setLifetime("EPHEMERAL");
|
||||
lockBodyModel2.setTimeToExpire(20);
|
||||
lockBodyModel2.setType("FULL");
|
||||
restClient.authenticateUser(user2).withCoreAPI().usingNode(file1).usingParams("include=isLocked")
|
||||
.lockNode(lockBodyModel2);
|
||||
restClient.authenticateUser(user2).withCoreAPI().usingNode(file1).usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNPROCESSABLE_ENTITY).assertLastError()
|
||||
.containsErrorKey(RestErrorModel.API_DEFAULT_ERRORKEY)
|
||||
.containsSummary(String.format(RestErrorModel.LOCKED_NODE_SUMMARY, file1.getNodeRefWithoutVersion()))
|
||||
@@ -123,17 +117,16 @@ public class NodesLockTests extends RestTest
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NODES, TestGroup.CORE })
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NODES }, executionType = ExecutionType.REGRESSION, description = "Verify Collaborator can lock EPHEMERAL after EPHEMERAL lock made by same user")
|
||||
public void lockEphemeralAndRelockEphemeralWithSameUser() throws Exception
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NODES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Collaborator can lock EPHEMERAL after EPHEMERAL lock made by same user")
|
||||
public void lockEphemeralAndRelockEphemeralSameUser() throws Exception
|
||||
{
|
||||
|
||||
STEP("1. Add user(s) as collaborators to the site created by administrator and add a file in this site.");
|
||||
file1 = dataContent.usingUser(adminUser).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
|
||||
|
||||
STEP("2. Verify with admin that the file is not locked.");
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model1.assertThat().field("isLocked").is(false);
|
||||
|
||||
STEP("3. Lock the file using mode EPHEMERAL with user1 (POST nodes/{nodeId}/lock).");
|
||||
@@ -145,9 +138,9 @@ public class NodesLockTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
STEP("4. Verify with user1 that the file is locked.");
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
.assertThat().field("properties").contains("lockType=READ_ONLY_LOCK");
|
||||
|
||||
STEP("5. Lock the file using mode EPHEMERAL with user1 while the file is still locked");
|
||||
@@ -155,26 +148,25 @@ public class NodesLockTests extends RestTest
|
||||
lockBodyModel2.setLifetime("EPHEMERAL");
|
||||
lockBodyModel2.setTimeToExpire(20);
|
||||
lockBodyModel2.setType("FULL");
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
file1Model3.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
file1Model3.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
.assertThat().field("properties").contains("lockType=READ_ONLY_LOCK");
|
||||
}
|
||||
|
||||
@Bug(id = "MNT-17612", status = Status.FIXED, description = "AccessDeniedException in AOS Edit Offline Upload New Version")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NODES, TestGroup.CORE })
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NODES }, executionType = ExecutionType.REGRESSION, description = "Verify Collaborator can lock PERSISTENT after EPHEMERAL lock made by same user")
|
||||
public void lockEphemeralAndRelockPersistentWithSameUser() throws Exception
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NODES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Collaborator can lock PERSISTENT after EPHEMERAL lock made by same user")
|
||||
public void lockEphemeralAndRelockPersistentSameUser() throws Exception
|
||||
{
|
||||
|
||||
STEP("1. Add user(s) as collaborators to the site created by administrator and add a file in this site.");
|
||||
file1 = dataContent.usingUser(adminUser).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
|
||||
|
||||
STEP("2. Verify with admin that the file is not locked.");
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model1.assertThat().field("isLocked").is(false);
|
||||
|
||||
STEP("3. Lock the file using mode EPHEMERAL with user1 (POST nodes/{nodeId}/lock).");
|
||||
@@ -186,9 +178,9 @@ public class NodesLockTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
STEP("4. Verify with user1 that the file is locked.");
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
.assertThat().field("properties").contains("lockType=READ_ONLY_LOCK");
|
||||
|
||||
STEP("5. Lock the file using mode PERSISTENT with user1 while the file is still locked");
|
||||
@@ -196,38 +188,31 @@ public class NodesLockTests extends RestTest
|
||||
lockBodyModel2.setLifetime("PERSISTENT");
|
||||
lockBodyModel2.setTimeToExpire(20);
|
||||
lockBodyModel2.setType("ALLOW_OWNER_CHANGES");
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
file1Model3.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
file1Model3.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
.assertThat().field("properties").contains("lockType=READ_ONLY_LOCK");
|
||||
|
||||
STEP("6. Verify that the file is locked PERSISTENT only after EPHEMERAL lock has expired");
|
||||
try
|
||||
{
|
||||
Thread.sleep(2500);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
RestNodeModel file1Model4 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
file1Model4.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
try{Thread.sleep(2500);}finally{}
|
||||
RestNodeModel file1Model4 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model4.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
.assertThat().field("properties").contains("lockType=WRITE_LOCK");
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NODES, TestGroup.CORE })
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NODES }, executionType = ExecutionType.REGRESSION, description = "Verify Collaborator can lock EPHEMERAL after PERSISTENT lock made by different user")
|
||||
public void lockPersistentAndRelockEphemeralWithDifferentUser() throws Exception
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NODES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Collaborator can lock EPHEMERAL after PERSISTENT lock made by different user")
|
||||
public void lockPersistentAndRelockEphemeralDifferentUser() throws Exception
|
||||
{
|
||||
|
||||
STEP("1. Add user(s) as collaborators to the site created by administrator and add a file in this site.");
|
||||
file1 = dataContent.usingUser(adminUser).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
|
||||
|
||||
STEP("2. Verify with admin that the file is not locked.");
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model1.assertThat().field("isLocked").is(false);
|
||||
|
||||
STEP("3. Lock the file using mode PERSISTENT with user1 (POST nodes/{nodeId}/lock).");
|
||||
@@ -239,9 +224,9 @@ public class NodesLockTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
STEP("4. Verify with user1 that the file is locked.");
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
.assertThat().field("properties").contains("lockType=WRITE_LOCK");
|
||||
|
||||
STEP("5. Lock the file using mode EPHEMERAL with user2 while the file is still locked");
|
||||
@@ -249,8 +234,7 @@ public class NodesLockTests extends RestTest
|
||||
lockBodyModel2.setLifetime("EPHEMERAL");
|
||||
lockBodyModel2.setTimeToExpire(20);
|
||||
lockBodyModel2.setType("FULL");
|
||||
restClient.authenticateUser(user2).withCoreAPI().usingNode(file1).usingParams("include=isLocked")
|
||||
.lockNode(lockBodyModel2);
|
||||
restClient.authenticateUser(user2).withCoreAPI().usingNode(file1).usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNPROCESSABLE_ENTITY).assertLastError()
|
||||
.containsErrorKey(RestErrorModel.API_DEFAULT_ERRORKEY)
|
||||
.containsSummary(String.format(RestErrorModel.LOCKED_NODE_SUMMARY, file1.getNodeRefWithoutVersion()))
|
||||
@@ -258,17 +242,16 @@ public class NodesLockTests extends RestTest
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NODES, TestGroup.CORE })
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NODES }, executionType = ExecutionType.REGRESSION, description = "Verify Collaborator can lock EPHEMERAL after PERSISTENT lock made by different user")
|
||||
public void lockPersistentAndRelockPersistentWithDifferentUser() throws Exception
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NODES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Collaborator can lock EPHEMERAL after PERSISTENT lock made by different user")
|
||||
public void lockPersistentAndRelockPersistentDifferentUser() throws Exception
|
||||
{
|
||||
|
||||
STEP("1. Add user(s) as collaborators to the site created by administrator and add a file in this site.");
|
||||
file1 = dataContent.usingUser(adminUser).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
|
||||
|
||||
STEP("2. Verify with admin that the file is not locked.");
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model1.assertThat().field("isLocked").is(false);
|
||||
|
||||
STEP("3. Lock the file using mode PERSISTENT with user1 (POST nodes/{nodeId}/lock).");
|
||||
@@ -280,9 +263,9 @@ public class NodesLockTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
STEP("4. Verify with user1 that the file is locked.");
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
.assertThat().field("properties").contains("lockType=WRITE_LOCK");
|
||||
|
||||
STEP("5. Lock the file using mode PERSISTENT with user2 while the file is still locked");
|
||||
@@ -290,8 +273,7 @@ public class NodesLockTests extends RestTest
|
||||
lockBodyModel2.setLifetime("PERSISTENT");
|
||||
lockBodyModel2.setTimeToExpire(20);
|
||||
lockBodyModel2.setType("ALLOW_OWNER_CHANGES");
|
||||
restClient.authenticateUser(user2).withCoreAPI().usingNode(file1).usingParams("include=isLocked")
|
||||
.lockNode(lockBodyModel2);
|
||||
restClient.authenticateUser(user2).withCoreAPI().usingNode(file1).usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNPROCESSABLE_ENTITY).assertLastError()
|
||||
.containsErrorKey(RestErrorModel.API_DEFAULT_ERRORKEY)
|
||||
.containsSummary(String.format(RestErrorModel.LOCKED_NODE_SUMMARY, file1.getNodeRefWithoutVersion()))
|
||||
@@ -299,8 +281,8 @@ public class NodesLockTests extends RestTest
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NODES, TestGroup.CORE })
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NODES }, executionType = ExecutionType.REGRESSION, description = "Verify Collaborator can lock EPHEMERAL after PERSISTENT lock made by different user is expired")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NODES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Collaborator can lock EPHEMERAL after PERSISTENT lock made by different user is expired")
|
||||
public void lockPersistentAndRelockEphemeralAfterExpiredLockDifferentUser() throws Exception
|
||||
{
|
||||
|
||||
@@ -308,8 +290,7 @@ public class NodesLockTests extends RestTest
|
||||
file1 = dataContent.usingUser(adminUser).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
|
||||
|
||||
STEP("2. Verify with admin that the file is not locked.");
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model1.assertThat().field("isLocked").is(false);
|
||||
|
||||
STEP("3. Lock the file using mode PERSISTENT with user1 (POST nodes/{nodeId}/lock).");
|
||||
@@ -321,9 +302,9 @@ public class NodesLockTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
STEP("4. Verify with admin that the file is locked.");
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
.assertThat().field("properties").contains("lockType=WRITE_LOCK");
|
||||
|
||||
STEP("5. Lock the file using mode EPHEMERAL with user2 while the first lock has expired");
|
||||
@@ -331,24 +312,18 @@ public class NodesLockTests extends RestTest
|
||||
lockBodyModel2.setLifetime("EPHEMERAL");
|
||||
lockBodyModel2.setTimeToExpire(20);
|
||||
lockBodyModel2.setType("FULL");
|
||||
try
|
||||
{
|
||||
Thread.sleep(1500);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user2).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
try{Thread.sleep(1500);}finally{}
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user2).withCoreAPI().usingNode(file1).usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
file1Model3.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
file1Model3.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
.assertThat().field("properties").contains("lockType=READ_ONLY_LOCK");
|
||||
}
|
||||
|
||||
@Bug(id = "MNT-17612", status = Status.FIXED, description = "AccessDeniedException in AOS Edit Offline Upload New Version")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NODES, TestGroup.CORE })
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NODES }, executionType = ExecutionType.REGRESSION, description = "Verify Collaborator can lock PERSISTENT after EPHEMERAL lock made by another user is expired")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NODES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Collaborator can lock PERSISTENT after EPHEMERAL lock made by another user is expired")
|
||||
public void lockEphemeralAndRelockPersistentAfterExpiredLockDifferentUser() throws Exception
|
||||
{
|
||||
|
||||
@@ -356,8 +331,7 @@ public class NodesLockTests extends RestTest
|
||||
file1 = dataContent.usingUser(adminUser).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
|
||||
|
||||
STEP("2. Verify with admin that the file is not locked.");
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model1.assertThat().field("isLocked").is(false);
|
||||
|
||||
STEP("3. Lock the file using mode EPHEMERAL with user1 (POST nodes/{nodeId}/lock).");
|
||||
@@ -369,9 +343,9 @@ public class NodesLockTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
STEP("4. Verify with user1 that the file is locked.");
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
.assertThat().field("properties").contains("lockType=READ_ONLY_LOCK");
|
||||
|
||||
STEP("5. Lock the file using mode PERSISTENT with user2 after the first lock has expired");
|
||||
@@ -379,23 +353,17 @@ public class NodesLockTests extends RestTest
|
||||
lockBodyModel2.setLifetime("PERSISTENT");
|
||||
lockBodyModel2.setTimeToExpire(20);
|
||||
lockBodyModel2.setType("ALLOW_OWNER_CHANGES");
|
||||
try
|
||||
{
|
||||
Thread.sleep(1500);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user2).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
try{Thread.sleep(1500);}finally{}
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user2).withCoreAPI().usingNode(file1).usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
file1Model3.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
file1Model3.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
.assertThat().field("properties").contains("lockType=WRITE_LOCK");
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NODES, TestGroup.CORE })
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NODES }, executionType = ExecutionType.REGRESSION, description = "Verify Collaborator can lock EPHEMERAL after EPHEMERAL lock made by another user is expired")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NODES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Collaborator can lock EPHEMERAL after EPHEMERAL lock made by another user is expired")
|
||||
public void lockEphemeralAndRelockEphemeralAfterExpiredLockDifferentUser() throws Exception
|
||||
{
|
||||
|
||||
@@ -403,8 +371,7 @@ public class NodesLockTests extends RestTest
|
||||
file1 = dataContent.usingUser(adminUser).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
|
||||
|
||||
STEP("2. Verify with admin that the file is not locked.");
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model1.assertThat().field("isLocked").is(false);
|
||||
|
||||
STEP("3. Lock the file using mode EPHEMERAL with user1 (POST nodes/{nodeId}/lock).");
|
||||
@@ -416,9 +383,9 @@ public class NodesLockTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
STEP("4. Verify with user1 that the file is locked.");
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
.assertThat().field("properties").contains("lockType=READ_ONLY_LOCK");
|
||||
|
||||
STEP("5. Lock the file using mode EPHEMERAL with user2 while the first lock has expired");
|
||||
@@ -426,24 +393,17 @@ public class NodesLockTests extends RestTest
|
||||
lockBodyModel2.setLifetime("EPHEMERAL");
|
||||
lockBodyModel2.setTimeToExpire(20);
|
||||
lockBodyModel2.setType("FULL");
|
||||
try
|
||||
{
|
||||
Thread.sleep(1500);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user2).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
try{Thread.sleep(1500);}finally{}
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user2).withCoreAPI().usingNode(file1).usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
file1Model3.assertThat().field("isLocked").is(true);
|
||||
file1Model3.assertThat().field("properties").contains("lockLifetime=EPHEMERAL").assertThat().field("properties")
|
||||
.contains("lockType=READ_ONLY_LOCK");
|
||||
file1Model3.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
.assertThat().field("properties").contains("lockType=READ_ONLY_LOCK");
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NODES, TestGroup.CORE })
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NODES }, executionType = ExecutionType.REGRESSION, description = "Verify Collaborator can lock EPHEMERAL after PERSISTENT lock made by different user is expired")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NODES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Collaborator can lock EPHEMERAL after PERSISTENT lock made by different user is expired")
|
||||
public void lockPersistentAndRelockPersistentAfterExpiredLockDifferentUser() throws Exception
|
||||
{
|
||||
|
||||
@@ -451,8 +411,7 @@ public class NodesLockTests extends RestTest
|
||||
file1 = dataContent.usingUser(adminUser).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
|
||||
|
||||
STEP("2. Verify with admin that the file is not locked.");
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model1.assertThat().field("isLocked").is(false);
|
||||
|
||||
STEP("3. Lock the file using mode PERSISTENT with user1 (POST nodes/{nodeId}/lock).");
|
||||
@@ -464,9 +423,9 @@ public class NodesLockTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
STEP("4. Verify with admin that the file is locked.");
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
.assertThat().field("properties").contains("lockType=WRITE_LOCK");
|
||||
|
||||
STEP("5. Lock the file using mode PERSISTENT with user2 after the first lock has expired");
|
||||
@@ -474,33 +433,25 @@ public class NodesLockTests extends RestTest
|
||||
lockBodyModel2.setLifetime("PERSISTENT");
|
||||
lockBodyModel2.setTimeToExpire(20);
|
||||
lockBodyModel2.setType("ALLOW_OWNER_CHANGES");
|
||||
try
|
||||
{
|
||||
Thread.sleep(1500);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user2).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
try{Thread.sleep(1500);}finally{}
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user2).withCoreAPI().usingNode(file1).usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
file1Model3.assertThat().field("isLocked").is(true);
|
||||
file1Model3.assertThat().field("properties").contains("lockLifetime=PERSISTENT").assertThat().field("properties")
|
||||
.contains("lockType=WRITE_LOCK");
|
||||
file1Model3.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
.assertThat().field("properties").contains("lockType=WRITE_LOCK");
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NODES, TestGroup.CORE })
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NODES }, executionType = ExecutionType.REGRESSION, description = "Verify Collaborator can lock EPHEMERAL after EPHEMERAL lock made by same user is expired")
|
||||
public void lockEphemeralAndRelockEphemeralAfterLocktimeIsPassedSameUser() throws Exception
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NODES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Collaborator can lock EPHEMERAL after EPHEMERAL lock made by same user is expired")
|
||||
public void lockEphemeralAndRelockEphemeralAfterExpiredLockSameUser() throws Exception
|
||||
{
|
||||
|
||||
STEP("1. Add user(s) as collaborators to the site created by administrator and add a file in this site.");
|
||||
file1 = dataContent.usingUser(adminUser).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
|
||||
|
||||
STEP("2. Verify with admin that the file is not locked.");
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model1.assertThat().field("isLocked").is(false);
|
||||
|
||||
STEP("3. Lock the file using mode EPHEMERAL with user1 (POST nodes/{nodeId}/lock).");
|
||||
@@ -512,9 +463,9 @@ public class NodesLockTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
STEP("4. Verify with user1 that the file is locked.");
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
.assertThat().field("properties").contains("lockType=READ_ONLY_LOCK");
|
||||
|
||||
STEP("5. Lock the file using mode EPHEMERAL with user1 after the first lock has expired");
|
||||
@@ -522,24 +473,17 @@ public class NodesLockTests extends RestTest
|
||||
lockBodyModel2.setLifetime("EPHEMERAL");
|
||||
lockBodyModel2.setTimeToExpire(20);
|
||||
lockBodyModel2.setType("FULL");
|
||||
try
|
||||
{
|
||||
Thread.sleep(1500);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
try{Thread.sleep(1500);}finally{}
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
file1Model3.assertThat().field("isLocked").is(true);
|
||||
file1Model3.assertThat().field("properties").contains("lockLifetime=EPHEMERAL").assertThat().field("properties")
|
||||
.contains("lockType=READ_ONLY_LOCK");
|
||||
file1Model3.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
.assertThat().field("properties").contains("lockType=READ_ONLY_LOCK");
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NODES, TestGroup.CORE })
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NODES }, executionType = ExecutionType.REGRESSION, description = "Verify Collaborator can lock PERSISTENT after PERSISTENT lock made by same user is expired")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NODES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Collaborator can lock PERSISTENT after PERSISTENT lock made by same user is expired")
|
||||
public void lockPersistentAndRelockPersistentAfterExpiredLockSameUser() throws Exception
|
||||
{
|
||||
|
||||
@@ -547,8 +491,7 @@ public class NodesLockTests extends RestTest
|
||||
file1 = dataContent.usingUser(adminUser).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
|
||||
|
||||
STEP("2. Verify with admin that the file is not locked.");
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model1.assertThat().field("isLocked").is(false);
|
||||
|
||||
STEP("3. Lock the file using mode PERSISTENT with user1 (POST nodes/{nodeId}/lock).");
|
||||
@@ -560,8 +503,7 @@ public class NodesLockTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
STEP("4. Verify with user1 that the file is locked.");
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true);
|
||||
file1Model2.assertThat().field("properties").contains("lockLifetime=PERSISTENT");
|
||||
|
||||
@@ -570,24 +512,17 @@ public class NodesLockTests extends RestTest
|
||||
lockBodyModel2.setLifetime("PERSISTENT");
|
||||
lockBodyModel2.setTimeToExpire(20);
|
||||
lockBodyModel2.setType("ALLOW_OWNER_CHANGES");
|
||||
try
|
||||
{
|
||||
Thread.sleep(1500);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
try{Thread.sleep(1500);}finally{}
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
file1Model3.assertThat().field("isLocked").is(true);
|
||||
file1Model3.assertThat().field("properties").contains("lockLifetime=PERSISTENT").assertThat().field("properties")
|
||||
.contains("lockType=WRITE_LOCK");
|
||||
file1Model3.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
.assertThat().field("properties").contains("lockType=WRITE_LOCK");
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NODES, TestGroup.CORE })
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NODES }, executionType = ExecutionType.REGRESSION, description = "Verify Collaborator can lock EPHEMERAL after PERSISTENT lock made by same user is expired")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NODES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Collaborator can lock EPHEMERAL after PERSISTENT lock made by same user is expired")
|
||||
public void lockPersistentAndRelockEphemeralAfterExpiredLockSameUser() throws Exception
|
||||
{
|
||||
|
||||
@@ -595,8 +530,7 @@ public class NodesLockTests extends RestTest
|
||||
file1 = dataContent.usingUser(adminUser).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
|
||||
|
||||
STEP("2. Verify with admin that the file is not locked.");
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model1.assertThat().field("isLocked").is(false);
|
||||
|
||||
STEP("3. Lock the file using mode PERSISTENT with user1 (POST nodes/{nodeId}/lock).");
|
||||
@@ -608,9 +542,9 @@ public class NodesLockTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
STEP("4. Verify with admin that the file is locked.");
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
.assertThat().field("properties").contains("lockType=WRITE_LOCK");
|
||||
|
||||
STEP("5. Lock the file using mode EPHEMERAL with user1 while the first lock has expired");
|
||||
@@ -618,24 +552,18 @@ public class NodesLockTests extends RestTest
|
||||
lockBodyModel2.setLifetime("EPHEMERAL");
|
||||
lockBodyModel2.setTimeToExpire(20);
|
||||
lockBodyModel2.setType("FULL");
|
||||
try
|
||||
{
|
||||
Thread.sleep(1500);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
try{Thread.sleep(1500);}finally{}
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
file1Model3.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
file1Model3.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
.assertThat().field("properties").contains("lockType=READ_ONLY_LOCK");
|
||||
}
|
||||
|
||||
@Bug(id = "MNT-17612", status = Status.FIXED, description = "AccessDeniedException in AOS Edit Offline Upload New Version")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NODES, TestGroup.CORE })
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NODES }, executionType = ExecutionType.REGRESSION, description = "Verify Collaborator can lock PERSISTENT after EPHEMERAL lock made by same user is expired")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NODES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Collaborator can lock PERSISTENT after EPHEMERAL lock made by same user is expired")
|
||||
public void lockEphemeralAndRelockPersistentAfterExpiredLockSameUser() throws Exception
|
||||
{
|
||||
|
||||
@@ -656,9 +584,9 @@ public class NodesLockTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
STEP("4. Verify with useer1 that the file is locked.");
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
.assertThat().field("properties").contains("lockType=READ_ONLY_LOCK");
|
||||
|
||||
STEP("5. Lock the file using mode PERSISTENT with user1 while the first lock has expired");
|
||||
@@ -666,32 +594,25 @@ public class NodesLockTests extends RestTest
|
||||
lockBodyModel2.setLifetime("PERSISTENT");
|
||||
lockBodyModel2.setTimeToExpire(20);
|
||||
lockBodyModel2.setType("ALLOW_OWNER_CHANGES");
|
||||
try
|
||||
{
|
||||
Thread.sleep(1500);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
try{Thread.sleep(1500);}finally{}
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
file1Model3.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
file1Model3.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
.assertThat().field("properties").contains("lockType=WRITE_LOCK");
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NODES, TestGroup.CORE })
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NODES }, executionType = ExecutionType.REGRESSION, description = "Verify Collaborator can lock PERSISTENT after PERSISTENT lock made by same user")
|
||||
public void lockPersistentAndRelockPersistentWithSameUser() throws Exception
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NODES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Collaborator can lock PERSISTENT after PERSISTENT lock made by same user")
|
||||
public void lockPersistentAndRelockPersistentSameUser() throws Exception
|
||||
{
|
||||
|
||||
STEP("1. Add user(s) as collaborators to the site created by administrator and add a file in this site.");
|
||||
file1 = dataContent.usingUser(adminUser).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
|
||||
|
||||
STEP("2. Verify with admin that the file is not locked.");
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model1.assertThat().field("isLocked").is(false);
|
||||
|
||||
STEP("3. Lock the file using mode PERSISTENT with user1 (POST nodes/{nodeId}/lock).");
|
||||
@@ -703,9 +624,9 @@ public class NodesLockTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
STEP("4. Verify with user1 that the file is locked.");
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
.assertThat().field("properties").contains("lockType=WRITE_LOCK");
|
||||
|
||||
STEP("5. Lock the file using mode PERSISTENT with user1 while the file is still locked");
|
||||
@@ -713,26 +634,24 @@ public class NodesLockTests extends RestTest
|
||||
lockBodyModel2.setLifetime("PERSISTENT");
|
||||
lockBodyModel2.setTimeToExpire(20);
|
||||
lockBodyModel2.setType("ALLOW_OWNER_CHANGES");
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
file1Model3.assertThat().field("isLocked").is(true);
|
||||
file1Model3.assertThat().field("properties").contains("lockLifetime=PERSISTENT").assertThat().field("properties")
|
||||
.contains("lockType=WRITE_LOCK");
|
||||
file1Model3.assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
.assertThat().field("properties").contains("lockType=WRITE_LOCK");
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NODES, TestGroup.CORE })
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NODES }, executionType = ExecutionType.REGRESSION, description = "Verify Collaborator can lock EPHERMERAL after PERSISTENT lock made by same user")
|
||||
public void lockPersistentAndRelockEphemeralWithSameUser() throws Exception
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NODES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Collaborator can lock EPHERMERAL after PERSISTENT lock made by same user")
|
||||
public void lockPersistentAndRelockEphemeralSameUser() throws Exception
|
||||
{
|
||||
|
||||
STEP("1. Add user(s) as collaborators to the site created by administrator and add a file in this site.");
|
||||
file1 = dataContent.usingUser(adminUser).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
|
||||
|
||||
STEP("2. Verify with admin that the file is not locked.");
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
RestNodeModel file1Model1 = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model1.assertThat().field("isLocked").is(false);
|
||||
|
||||
STEP("3. Lock the file using mode PERSISTENT with user1 (POST nodes/{nodeId}/lock).");
|
||||
@@ -744,9 +663,9 @@ public class NodesLockTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
STEP("4. Verify with user1 that the file is locked.");
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true).assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
RestNodeModel file1Model2 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").getNode();
|
||||
file1Model2.assertThat().field("isLocked").is(true)
|
||||
.assertThat().field("properties").contains("lockLifetime=PERSISTENT")
|
||||
.assertThat().field("properties").contains("lockType=WRITE_LOCK");
|
||||
|
||||
STEP("5. Lock the file using mode EPHERMERAL with user1 while the file is still locked");
|
||||
@@ -754,12 +673,11 @@ public class NodesLockTests extends RestTest
|
||||
lockBodyModel2.setLifetime("EPHEMERAL");
|
||||
lockBodyModel2.setTimeToExpire(20);
|
||||
lockBodyModel2.setType("FULL");
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1)
|
||||
.usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
RestNodeModel file1Model3 = restClient.authenticateUser(user1).withCoreAPI().usingNode(file1).usingParams("include=isLocked").lockNode(lockBodyModel2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
file1Model3.assertThat().field("isLocked").is(true);
|
||||
file1Model3.assertThat().field("properties").contains("lockLifetime=EPHEMERAL").assertThat().field("properties")
|
||||
.contains("lockType=READ_ONLY_LOCK");
|
||||
file1Model3.assertThat().field("properties").contains("lockLifetime=EPHEMERAL")
|
||||
.assertThat().field("properties").contains("lockType=READ_ONLY_LOCK");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user