mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
REPO-2251 : REST API: Reliable TAS REST API & CMIS build plans (5.2.N & 5.1.N)
Refactor all Network tests: Group network tests into related class (removed from previous class designed for each endpoint) Add abstract class NetworkDataPrep on which are created tenants and other resources shared for these tests (high cost) NOTE: Some test still need fixing.
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
package org.alfresco.rest;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.model.RestNetworkModel;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
|
||||
public abstract class NetworkDataPrep extends RestTest
|
||||
{
|
||||
protected static UserModel adminUserModel;
|
||||
protected static UserModel adminTenantUser, secondAdminTenantUser;
|
||||
protected static UserModel tenantUser, secondTenantUser, differentNetworkTenantUser;
|
||||
protected static UserModel tenantUserWithBad;
|
||||
protected static UserModel userModel;
|
||||
protected static RestNetworkModel restNetworkModel;
|
||||
protected static String tenantDomain;
|
||||
protected static SiteModel siteModel;
|
||||
protected static FileModel document, document2;
|
||||
private static boolean isInitialized = false;
|
||||
|
||||
public void init()
|
||||
{
|
||||
if(isInitialized)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
isInitialized = true;
|
||||
try
|
||||
{
|
||||
initialization();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void initialization() throws Exception
|
||||
{
|
||||
adminUserModel = dataUser.getAdminUser();
|
||||
//create first tenant Admin User.
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
restClient.usingTenant().createTenant(adminTenantUser);
|
||||
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
secondTenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("sTenant");
|
||||
//create second tenant Admin User.
|
||||
secondAdminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.usingTenant().createTenant(secondAdminTenantUser);
|
||||
|
||||
tenantDomain = tenantUser.getDomain();
|
||||
differentNetworkTenantUser = dataUser.usingUser(secondAdminTenantUser).createUserWithTenant("dTenant");
|
||||
|
||||
userModel = dataUser.createRandomTestUser();
|
||||
|
||||
siteModel = dataSite.usingUser(adminUserModel).createPublicRandomSite();
|
||||
document = dataContent.usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
document2 = dataContent.usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,19 @@ package org.alfresco.rest.favorites;
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.core.RestRequest;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.*;
|
||||
import org.alfresco.rest.model.RestCommentModel;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestFavoriteSiteModel;
|
||||
import org.alfresco.rest.model.RestPersonFavoritesModel;
|
||||
import org.alfresco.rest.model.RestPersonFavoritesModelsCollection;
|
||||
import org.alfresco.rest.model.RestTagModel;
|
||||
import org.alfresco.utility.constants.UserRole;
|
||||
import org.alfresco.utility.model.*;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.FolderModel;
|
||||
import org.alfresco.utility.model.LinkModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
@@ -17,7 +26,7 @@ import org.testng.annotations.Test;
|
||||
|
||||
public class AddFavoriteSiteTests extends RestTest
|
||||
{
|
||||
private UserModel userModel, adminUser, adminTenantUser, tenantUser;
|
||||
private UserModel userModel, adminUser;
|
||||
private SiteModel publicSite, privateSite, moderatedSite;
|
||||
private FileModel document;
|
||||
private FolderModel folder;
|
||||
@@ -475,70 +484,4 @@ public class AddFavoriteSiteTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError()
|
||||
.containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, site.getId().split("/")[3]));
|
||||
}
|
||||
|
||||
@Bug(id="MNT-16904")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.NETWORKS, TestGroup.REGRESSION})
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.NETWORKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user is not able to delete favorites using an invalid network ID - status code (401)")
|
||||
public void tenantIsNotAbleToDeleteFavoriteSiteWithInvalidNetworkID() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
publicSite = dataSite.usingUser(tenantUser).createPublicRandomSite();
|
||||
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI();
|
||||
tenantUser.setDomain("invalidNetwork");
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(publicSite);
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED)
|
||||
.assertLastError()
|
||||
.containsSummary(RestErrorModel.AUTHENTICATION_FAILED)
|
||||
.containsErrorKey(RestErrorModel.ENTITY_NOT_FOUND_ERRORKEY)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.NETWORKS, TestGroup.REGRESSION})
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user is able to add to favorites his site and status code is (201)")
|
||||
public void tenantAddFavoriteSiteValidNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
publicSite = dataSite.usingUser(tenantUser).createPublicRandomSite();
|
||||
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI();
|
||||
tenantUser.setDomain(tenantUser.getDomain());
|
||||
|
||||
restClient.withCoreAPI()
|
||||
.usingAuthUser().addSiteToFavorites(publicSite);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().getFavorites()
|
||||
.assertThat()
|
||||
.entriesListContains("targetGuid", publicSite.getGuidWithoutVersion());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.NETWORKS, TestGroup.REGRESSION})
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user is able to add to favorites a site created by admin tenant - same network and status code is (201)")
|
||||
public void tenantUserIsAbleToAddFavoriteSiteAddedByAdminSameNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
publicSite = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI();
|
||||
tenantUser.setDomain(adminTenantUser.getDomain());
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().addFavoriteSite(publicSite);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().getFavorites()
|
||||
.assertThat()
|
||||
.entriesListContains("targetGuid", publicSite.getGuidWithoutVersion());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -432,23 +432,6 @@ public class AddFavoritesTests extends RestTest
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@Bug(id = "MNT-16904")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify the post favorites request when network id is invalid for tenant user")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void addFavoriteSitesWhenNetworkIdIsInvalid() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
restClient.usingTenant().createTenant(adminTenantUser);
|
||||
UserModel tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
|
||||
tenantUser.setDomain("invalidNetwork");
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED)
|
||||
.assertLastError().containsSummary(RestErrorModel.AUTHENTICATION_FAILED);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify the response of favorite a sie with empty body at request")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package org.alfresco.rest.favorites;
|
||||
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.utility.constants.UserRole;
|
||||
import org.alfresco.utility.data.DataUser;
|
||||
@@ -363,70 +362,4 @@ public class DeleteFavoriteSiteTests extends RestTest
|
||||
.assertLastError()
|
||||
.containsSummary(RestErrorModel.PERMISSION_WAS_DENIED);
|
||||
}
|
||||
|
||||
@Bug(id="MNT-16904")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user is not able to delete favorites using an invalid network ID")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE,TestGroup.NETWORKS, TestGroup.REGRESSION })
|
||||
public void tenantIsNotAbleToDeleteFavoriteSiteWithInvalidNetworkID() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUserModel).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
SiteModel siteModel = dataSite.usingUser(tenantUser).createPublicRandomSite();
|
||||
siteModel.setGuid(restClient.authenticateUser(tenantUser).withCoreAPI().usingSite(siteModel).getSite().getGuid());
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
tenantUser.setDomain("invalidNetwork");
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().removeFavoriteSite(siteModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED)
|
||||
.assertLastError()
|
||||
.containsSummary(RestErrorModel.AUTHENTICATION_FAILED)
|
||||
.containsErrorKey(RestErrorModel.ENTITY_NOT_FOUND_ERRORKEY)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user deletes favorites site and status code is (204)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE,TestGroup.NETWORKS, TestGroup.REGRESSION })
|
||||
public void tenantDeleteFavoriteSiteValidNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUserModel).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
SiteModel siteModel = dataSite.usingUser(tenantUser).createPublicRandomSite();
|
||||
siteModel.setGuid(restClient.authenticateUser(tenantUser).withCoreAPI().usingSite(siteModel).getSite().getGuid());
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
tenantUser.setDomain(tenantUser.getDomain());
|
||||
|
||||
restClient.withCoreAPI()
|
||||
.usingAuthUser().removeFavoriteSite(siteModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().getFavorites()
|
||||
.assertThat()
|
||||
.entriesListDoesNotContain("targetGuid", siteModel.getGuidWithoutVersion());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user deletes favorites site created by admin tenant - same network and status code is (204)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE,TestGroup.NETWORKS, TestGroup.REGRESSION })
|
||||
public void tenantUserIsAbleToDeleteFavoriteSiteAddedByAdminSameNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUserModel).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
SiteModel siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
siteModel.setGuid(restClient.authenticateUser(adminTenantUser).withCoreAPI().usingSite(siteModel).getSite().getGuid());
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
tenantUser.setDomain(adminTenantUser.getDomain());
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().removeFavoriteSite(siteModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().getFavorites()
|
||||
.assertThat()
|
||||
.entriesListDoesNotContain("targetGuid", siteModel.getGuidWithoutVersion());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,14 @@ package org.alfresco.rest.favorites;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.utility.constants.UserRole;
|
||||
import org.alfresco.utility.data.DataUser.ListUserWithRoles;
|
||||
import org.alfresco.utility.model.*;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.FolderModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
@@ -406,72 +409,4 @@ public class DeleteFavoriteTests extends RestTest
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@Bug(id="MNT-16904")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user is not able to delete favorites using an invalid network ID")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES,TestGroup.NETWORKS, TestGroup.REGRESSION })
|
||||
public void tenantIsNotAbleToDeleteFavoriteSiteWithInvalidNetworkID() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUserModel).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
siteModel = dataSite.usingUser(tenantUser).createPublicRandomSite();
|
||||
siteModel.setGuid(restClient.authenticateUser(tenantUser).withCoreAPI().usingSite(siteModel).getSite().getGuid());
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
tenantUser.setDomain("invalidNetwork");
|
||||
|
||||
restClient.withCoreAPI()
|
||||
.usingAuthUser().deleteSiteFromFavorites(siteModel)
|
||||
.assertStatusCodeIs(HttpStatus.UNAUTHORIZED)
|
||||
.assertLastError()
|
||||
.containsSummary(RestErrorModel.AUTHENTICATION_FAILED)
|
||||
.containsErrorKey(RestErrorModel.ENTITY_NOT_FOUND_ERRORKEY)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user deletes favorites site and status code is (204)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES,TestGroup.NETWORKS, TestGroup.REGRESSION })
|
||||
public void tenantDeleteFavoriteSiteValidNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUserModel).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
siteModel = dataSite.usingUser(tenantUser).createPublicRandomSite();
|
||||
siteModel.setGuid(restClient.authenticateUser(tenantUser).withCoreAPI().usingSite(siteModel).getSite().getGuid());
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
tenantUser.setDomain(tenantUser.getDomain());
|
||||
|
||||
restClient.withCoreAPI()
|
||||
.usingAuthUser().deleteSiteFromFavorites(siteModel)
|
||||
.assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().getFavorites()
|
||||
.assertThat()
|
||||
.entriesListDoesNotContain("targetGuid", siteModel.getGuidWithoutVersion());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user deletes favorites site created by admin tenant - same network and status code is (204)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES,TestGroup.NETWORKS, TestGroup.REGRESSION })
|
||||
public void tenantUserIsAbleToDeleteFavoriteSiteAddedByAdminSameNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUserModel).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
siteModel.setGuid(restClient.authenticateUser(adminTenantUser).withCoreAPI().usingSite(siteModel).getSite().getGuid());
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
tenantUser.setDomain(adminTenantUser.getDomain());
|
||||
|
||||
restClient.withCoreAPI()
|
||||
.usingAuthUser().deleteSiteFromFavorites(siteModel)
|
||||
.assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().getFavorites()
|
||||
.assertThat()
|
||||
.entriesListDoesNotContain("targetGuid", siteModel.getGuidWithoutVersion());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,294 @@
|
||||
package org.alfresco.rest.favorites;
|
||||
|
||||
import org.alfresco.rest.NetworkDataPrep;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
public class FavoritesNetworkTests extends NetworkDataPrep
|
||||
{
|
||||
private SiteModel publicSite;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.NETWORKS, TestGroup.REGRESSION})
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user is able to add to favorites his site and status code is (201)")
|
||||
public void tenantAddFavoriteSiteValidNetwork() throws Exception
|
||||
{
|
||||
publicSite = dataSite.usingUser(tenantUser).createPublicRandomSite();
|
||||
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI();
|
||||
|
||||
restClient.withCoreAPI()
|
||||
.usingAuthUser().addSiteToFavorites(publicSite);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().getFavorites()
|
||||
.assertThat()
|
||||
.entriesListContains("targetGuid", publicSite.getGuidWithoutVersion());
|
||||
}
|
||||
|
||||
@Bug(id="MNT-16904")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.NETWORKS, TestGroup.REGRESSION})
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.NETWORKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user is not able to add favorites using an invalid network ID - status code (401)")
|
||||
public void tenantIsNotAbleToAddFavoriteSiteWithInvalidNetworkID() throws Exception
|
||||
{
|
||||
publicSite = dataSite.usingUser(tenantUser).createPublicRandomSite();
|
||||
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI();
|
||||
String domain = tenantUser.getDomain();
|
||||
try
|
||||
{
|
||||
tenantUser.setDomain("invalidNetwork");
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(publicSite);
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED)
|
||||
.assertLastError()
|
||||
.containsSummary(RestErrorModel.AUTHENTICATION_FAILED)
|
||||
.containsErrorKey(RestErrorModel.ENTITY_NOT_FOUND_ERRORKEY)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
finally
|
||||
{
|
||||
tenantUser.setDomain(domain);
|
||||
}
|
||||
}
|
||||
|
||||
@Bug(id="MNT-16904")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user is not able to remove favorites using an invalid network ID")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE,TestGroup.NETWORKS, TestGroup.REGRESSION })
|
||||
public void tenantIsNotAbleToRemoveFavoriteSiteWithInvalidNetworkID() throws Exception
|
||||
{
|
||||
SiteModel siteModel = dataSite.usingUser(tenantUser).createPublicRandomSite();
|
||||
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
String domain = tenantUser.getDomain();
|
||||
try
|
||||
{
|
||||
tenantUser.setDomain("invalidNetwork");
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().removeFavoriteSite(siteModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED)
|
||||
.assertLastError()
|
||||
.containsSummary(RestErrorModel.AUTHENTICATION_FAILED)
|
||||
.containsErrorKey(RestErrorModel.ENTITY_NOT_FOUND_ERRORKEY)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
finally
|
||||
{
|
||||
tenantUser.setDomain(domain);
|
||||
}
|
||||
}
|
||||
|
||||
@Bug(id="MNT-16904")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user is not able to delete favorites using an invalid network ID")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES,TestGroup.NETWORKS, TestGroup.REGRESSION })
|
||||
public void tenantIsNotAbleToDeleteFavoriteSiteWithInvalidNetworkID() throws Exception
|
||||
{
|
||||
siteModel = dataSite.usingUser(tenantUser).createPublicRandomSite();
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
String domain = tenantUser.getDomain();
|
||||
try
|
||||
{
|
||||
tenantUser.setDomain("invalidNetwork");
|
||||
|
||||
restClient.withCoreAPI()
|
||||
.usingAuthUser().deleteSiteFromFavorites(siteModel)
|
||||
.assertStatusCodeIs(HttpStatus.UNAUTHORIZED)
|
||||
.assertLastError()
|
||||
.containsSummary(RestErrorModel.AUTHENTICATION_FAILED)
|
||||
.containsErrorKey(RestErrorModel.ENTITY_NOT_FOUND_ERRORKEY)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
finally
|
||||
{
|
||||
tenantUser.setDomain(domain);
|
||||
}
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.NETWORKS, TestGroup.REGRESSION})
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user is able to add to favorites a site created by admin tenant - same network and status code is (201)")
|
||||
public void tenantUserIsAbleToAddFavoriteSiteAddedByAdminSameNetwork() throws Exception
|
||||
{
|
||||
publicSite = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI();
|
||||
tenantUser.setDomain(adminTenantUser.getDomain());
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().addFavoriteSite(publicSite);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().getFavorites()
|
||||
.assertThat()
|
||||
.entriesListContains("targetGuid", publicSite.getGuidWithoutVersion());
|
||||
}
|
||||
|
||||
@Bug(id = "MNT-16904")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify the get favorites request when network id is invalid for tenant user")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void getFavoriteSitesWhenNetworkIdIsInvalid() throws Exception
|
||||
{
|
||||
SiteModel firstSiteModel = dataSite.usingUser(adminUserModel).createPublicRandomSite();
|
||||
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||
|
||||
String domain = tenantUser.getDomain();
|
||||
try
|
||||
{
|
||||
tenantUser.setDomain("invalidNetwork");
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().getFavorites();
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED)
|
||||
.assertLastError().containsSummary(RestErrorModel.AUTHENTICATION_FAILED);
|
||||
}
|
||||
finally
|
||||
{
|
||||
tenantUser.setDomain(domain);
|
||||
}
|
||||
}
|
||||
|
||||
@Bug(id = "MNT-16904")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify the post favorites request when network id is invalid for tenant user")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void addFavoriteSitesWhenNetworkIdIsInvalid() throws Exception
|
||||
{
|
||||
String domain = tenantUser.getDomain();
|
||||
try
|
||||
{
|
||||
tenantUser.setDomain("invalidNetwork");
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED)
|
||||
.assertLastError().containsSummary(RestErrorModel.AUTHENTICATION_FAILED);
|
||||
}
|
||||
finally{
|
||||
tenantUser.setDomain(domain);
|
||||
}
|
||||
}
|
||||
|
||||
@Bug(id = "MNT-16904")
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify the get favorite request for invalid network id")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getFavoriteSiteWithInvalidNetworkId() throws Exception
|
||||
{
|
||||
siteModel = dataSite.usingUser(tenantUser).createPublicRandomSite();
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
|
||||
String domain = tenantUser.getDomain();
|
||||
try
|
||||
{
|
||||
tenantUser.setDomain("invalidNetwork");
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().getFavorite(siteModel.getGuid());
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED)
|
||||
.assertLastError()
|
||||
.containsSummary(RestErrorModel.AUTHENTICATION_FAILED);
|
||||
}
|
||||
finally
|
||||
{
|
||||
tenantUser.setDomain(domain);
|
||||
}
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify the get favorite request with tenant user")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getFavoriteSiteWithTenantUser() throws Exception
|
||||
{
|
||||
siteModel = dataSite.usingUser(tenantUser).createPublicRandomSite();
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().getFavorite(siteModel.getGuid());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user deletes favorites site and status code is (204)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE,TestGroup.NETWORKS, TestGroup.REGRESSION })
|
||||
public void tenantRemoveFavoriteSiteValidNetwork() throws Exception
|
||||
{
|
||||
SiteModel siteModel = dataSite.usingUser(tenantUser).createPublicRandomSite();
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
|
||||
restClient.withCoreAPI()
|
||||
.usingAuthUser().removeFavoriteSite(siteModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().getFavorites()
|
||||
.assertThat()
|
||||
.entriesListDoesNotContain("targetGuid", siteModel.getGuidWithoutVersion());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user deletes favorites site and status code is (204)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES,TestGroup.NETWORKS, TestGroup.REGRESSION })
|
||||
public void tenantDeleteFavoriteSiteValidNetwork() throws Exception
|
||||
{
|
||||
siteModel = dataSite.usingUser(tenantUser).createPublicRandomSite();
|
||||
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
|
||||
restClient.withCoreAPI()
|
||||
.usingAuthUser().deleteSiteFromFavorites(siteModel)
|
||||
.assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().getFavorites()
|
||||
.assertThat()
|
||||
.entriesListDoesNotContain("targetGuid", siteModel.getGuidWithoutVersion());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user remove favorites site created by admin tenant - same network and status code is (204)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE,TestGroup.NETWORKS, TestGroup.REGRESSION })
|
||||
public void tenantUserIsAbleToRemoveFavoriteSiteAddedByAdminSameNetwork() throws Exception
|
||||
{
|
||||
SiteModel siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
tenantUser.setDomain(adminTenantUser.getDomain());
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().removeFavoriteSite(siteModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().getFavorites()
|
||||
.assertThat()
|
||||
.entriesListDoesNotContain("targetGuid", siteModel.getGuidWithoutVersion());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user deletes favorites site created by admin tenant - same network and status code is (204)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES,TestGroup.NETWORKS, TestGroup.REGRESSION })
|
||||
public void tenantUserIsAbleToDeleteFavoriteSiteAddedByAdminSameNetwork() throws Exception
|
||||
{
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
tenantUser.setDomain(adminTenantUser.getDomain());
|
||||
|
||||
restClient.withCoreAPI()
|
||||
.usingAuthUser().deleteSiteFromFavorites(siteModel)
|
||||
.assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().getFavorites()
|
||||
.assertThat()
|
||||
.entriesListDoesNotContain("targetGuid", siteModel.getGuidWithoutVersion());
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,6 @@ import org.alfresco.utility.data.RandomData;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
@@ -3,7 +3,6 @@ package org.alfresco.rest.favorites;
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.dataprep.SiteService;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestPersonFavoritesModel;
|
||||
import org.alfresco.utility.constants.UserRole;
|
||||
@@ -478,41 +477,4 @@ public class GetFavoriteTests extends RestTest
|
||||
.and().field("target.folder.modifiedBy").is(adminUserModel.getUsername())
|
||||
.and().field("target.folder.id").is(folderModel.getNodeRef());
|
||||
}
|
||||
|
||||
@Bug(id = "MNT-16904")
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify the get favorite request for invalid network id")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getFavoriteSiteWithInvalidNetworkId() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
restClient.usingTenant().createTenant(adminTenantUser);
|
||||
UserModel tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
|
||||
siteModel = dataSite.usingUser(tenantUser).createPublicRandomSite();
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
|
||||
tenantUser.setDomain("invalidNetwork");
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().getFavorite(siteModel.getGuid());
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED)
|
||||
.assertLastError()
|
||||
.containsSummary(RestErrorModel.AUTHENTICATION_FAILED);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify the get favorite request with tenant user")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getFavoriteSiteWithTenantUser() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUserModel).usingTenant().createTenant(adminTenantUser);
|
||||
UserModel tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
|
||||
siteModel = dataSite.usingUser(tenantUser).createPublicRandomSite();
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().getFavorite(siteModel.getGuid());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package org.alfresco.rest.favorites;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestPersonFavoritesModel;
|
||||
import org.alfresco.rest.model.RestPersonFavoritesModelsCollection;
|
||||
@@ -14,7 +13,6 @@ import org.alfresco.utility.model.FolderModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -527,24 +525,6 @@ public class GetFavoritesTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError().containsSummary(String.format(RestErrorModel.INVALID_MAXITEMS, " "));
|
||||
}
|
||||
|
||||
@Bug(id = "MNT-16904")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify the get favorites request when network id is invalid for tenant user")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void getFavoriteSitesWhenNetworkIdIsInvalid() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
restClient.usingTenant().createTenant(adminTenantUser);
|
||||
UserModel tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteToFavorites(firstSiteModel);
|
||||
|
||||
tenantUser.setDomain("invalidNetwork");
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().getFavorites();
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED)
|
||||
.assertLastError().containsSummary(RestErrorModel.AUTHENTICATION_FAILED);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify the get favorites request for a high value for skipCount parameter")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package org.alfresco.rest.networks;
|
||||
|
||||
import org.alfresco.rest.RestTest;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.alfresco.rest.NetworkDataPrep;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestNetworkModel;
|
||||
import org.alfresco.rest.model.RestNetworkQuotaModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
@@ -13,28 +14,16 @@ import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Tests for /people/{personId}/networks
|
||||
*/
|
||||
public class RestGetNetworkForPersonTests extends RestTest
|
||||
public class RestGetNetworkForPersonTests extends NetworkDataPrep
|
||||
{
|
||||
UserModel adminUserModel, secondAdminTenantUser;
|
||||
UserModel adminTenantUser;
|
||||
UserModel tenantUser;
|
||||
RestNetworkModel restNetworkModel;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
adminUserModel = dataUser.getAdminUser();
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
restClient.usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
secondAdminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.usingTenant().createTenant(secondAdminTenantUser);
|
||||
init();
|
||||
}
|
||||
|
||||
@Bug(id = "MNT-16904")
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package org.alfresco.rest.networks;
|
||||
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.NetworkDataPrep;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestNetworkModel;
|
||||
import org.alfresco.utility.constants.UserRole;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
@@ -20,24 +18,12 @@ import org.testng.annotations.Test;
|
||||
/**
|
||||
* Created by Cristina Axinte on 9/26/2016.
|
||||
*/
|
||||
public class RestGetNetworkTests extends RestTest
|
||||
public class RestGetNetworkTests extends NetworkDataPrep
|
||||
{
|
||||
UserModel adminTenantUser;
|
||||
UserModel adminAnotherTenantUser;
|
||||
UserModel tenantUser;
|
||||
UserModel adminuser;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
adminuser = dataUser.getAdminUser();
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminuser);
|
||||
restClient.usingTenant().createTenant(adminTenantUser);
|
||||
adminAnotherTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.usingTenant().createTenant(adminAnotherTenantUser);
|
||||
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
init();
|
||||
}
|
||||
|
||||
@Bug(id = "MNT-16904")
|
||||
@@ -69,7 +55,7 @@ public class RestGetNetworkTests extends RestTest
|
||||
public void adminTenantChecksIfAnotherExistingNetworkIsForbidden() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminTenantUser);
|
||||
restClient.withCoreAPI().usingNetworks().getNetwork(adminAnotherTenantUser);
|
||||
restClient.withCoreAPI().usingNetworks().getNetwork(secondAdminTenantUser);
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN);
|
||||
}
|
||||
|
||||
@@ -99,7 +85,7 @@ public class RestGetNetworkTests extends RestTest
|
||||
public void userTenantChecksIfAnotherExistingNetworkIsForbidden() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(tenantUser);
|
||||
restClient.withCoreAPI().usingNetworks().getNetwork(adminAnotherTenantUser);
|
||||
restClient.withCoreAPI().usingNetworks().getNetwork(secondAdminTenantUser);
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN);
|
||||
}
|
||||
|
||||
@@ -109,10 +95,10 @@ public class RestGetNetworkTests extends RestTest
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.REGRESSION })
|
||||
public void adminTenantGetsInvalidNetwork() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminAnotherTenantUser);
|
||||
adminAnotherTenantUser.setDomain("tenant.@%");
|
||||
restClient.authenticateUser(secondAdminTenantUser);
|
||||
secondAdminTenantUser.setDomain("tenant.@%");
|
||||
|
||||
restClient.withCoreAPI().usingNetworks().getNetwork(adminAnotherTenantUser);
|
||||
restClient.withCoreAPI().usingNetworks().getNetwork(secondAdminTenantUser);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsErrorKey(RestErrorModel.ENTITY_NOT_FOUND_ERRORKEY)
|
||||
.containsSummary(String.format(RestErrorModel.UNEXPECTED_TENANT, adminTenantUser.getDomain(), "@"))
|
||||
@@ -126,7 +112,7 @@ public class RestGetNetworkTests extends RestTest
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.REGRESSION })
|
||||
public void adminUserGetsExistingNetwork() throws Exception
|
||||
{
|
||||
RestNetworkModel restNetworkModel = restClient.authenticateUser(adminuser).withCoreAPI().usingNetworks().getNetwork(adminTenantUser);
|
||||
RestNetworkModel restNetworkModel = restClient.authenticateUser(adminUserModel).withCoreAPI().usingNetworks().getNetwork(adminTenantUser);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restNetworkModel.assertThat().fieldsCount().is("1");
|
||||
restNetworkModel.assertThat().field("id").is(adminTenantUser.getDomain())
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package org.alfresco.rest.networks;
|
||||
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.NetworkDataPrep;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestNetworkModelsCollection;
|
||||
import org.alfresco.utility.constants.UserRole;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
@@ -14,24 +12,14 @@ import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
public class RestGetNetworksForPersonTests extends RestTest
|
||||
public class RestGetNetworksForPersonTests extends NetworkDataPrep
|
||||
{
|
||||
private UserModel adminUserModel, secondAdminTenantUser;
|
||||
private UserModel adminTenantUser;
|
||||
private UserModel tenantUser;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
adminUserModel = dataUser.getAdminUser();
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
restClient.usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
secondAdminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.usingTenant().createTenant(secondAdminTenantUser);
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
@Bug(id = "MNT-16904")
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.NETWORKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify non existing user gets another exisiting network with Rest API and checks the unauthorized status")
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package org.alfresco.rest.sites;
|
||||
|
||||
import org.alfresco.dataprep.SiteService;
|
||||
import org.alfresco.rest.NetworkDataPrep;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestSiteMembershipRequestModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
public class SitesNetworkTests extends NetworkDataPrep
|
||||
{
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify create site membership request returns status code 404 when personId is not member of the domain.")
|
||||
public void addSiteMembershipRequestWhenPersonIdIsNotInTheDomain() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminTenantUser).withCoreAPI().usingAuthUser().addSiteMembershipRequest(siteModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.RELATIONSHIP_NOT_FOUND, adminTenantUser.getUsername().toLowerCase(), siteModel.getId()));
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify create site membership request returns status code 200 with tenant.")
|
||||
public void addSiteMembershipRequestWithTenant() throws Exception
|
||||
{
|
||||
SiteModel tenantPublicSite = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
RestSiteMembershipRequestModel siteMembershipRequest = restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteMembershipRequest(tenantPublicSite);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
siteMembershipRequest.assertThat().field("id").is(tenantPublicSite.getId())
|
||||
.assertThat().field("site").isNotEmpty();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.NETWORKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add process item using by admin in other network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getSiteMembershipRequestByAdminInOtherNetwork() throws Exception
|
||||
{
|
||||
SiteModel moderatedSite = dataSite.usingUser(secondAdminTenantUser).createModeratedRandomSite();
|
||||
|
||||
restClient.authenticateUser(adminTenantUser).withCoreAPI().usingAuthUser().addSiteMembershipRequest(moderatedSite);
|
||||
restClient.authenticateUser(secondAdminTenantUser).withCoreAPI().usingAuthUser().getSiteMembershipRequest(moderatedSite);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError()
|
||||
.containsErrorKey(RestErrorModel.RELATIONSHIP_NOT_FOUND_ERRORKEY)
|
||||
.containsSummary(String.format(RestErrorModel.RELATIONSHIP_NOT_FOUND, secondAdminTenantUser.getUsername().toLowerCase(), moderatedSite.getId()))
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.NETWORKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add process item using by the admin in same network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getSiteMembershipRequestByAdminSameNetwork() throws Exception
|
||||
{
|
||||
SiteModel moderatedSite = dataSite.usingUser(adminTenantUser).createModeratedRandomSite();
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteMembershipRequest(moderatedSite);
|
||||
|
||||
RestSiteMembershipRequestModel returnedModel = restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().getSiteMembershipRequest(moderatedSite);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
returnedModel.assertThat().field("id").is(moderatedSite.getId())
|
||||
.and().field("message").is("Please accept me")
|
||||
.and().field("site.title").is(moderatedSite.getTitle())
|
||||
.and().field("site.visibility").is(SiteService.Visibility.MODERATED.toString())
|
||||
.and().field("site.guid").isNotEmpty()
|
||||
.and().field("site.description").is(moderatedSite.getDescription())
|
||||
.and().field("site.preset").is("site-dashboard");
|
||||
}
|
||||
}
|
||||
-31
@@ -2,7 +2,6 @@ package org.alfresco.rest.sites.membershipRequests;
|
||||
|
||||
import org.alfresco.dataprep.SiteService;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestSiteEntry;
|
||||
import org.alfresco.rest.model.RestSiteMembershipRequestModel;
|
||||
@@ -389,36 +388,6 @@ public class AddSiteMembershipRequestTests extends RestTest
|
||||
siteMembershipRequests.assertThat().entriesListContains("id", anotherModeratedSite.getId());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify create site membership request returns status code 404 when personId is not member of the domain.")
|
||||
public void addSiteMembershipRequestWhenPersonIdIsNotInTheDomain() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser)
|
||||
.usingTenant().createTenant(adminTenantUser);
|
||||
restClient.authenticateUser(adminTenantUser).withCoreAPI().usingAuthUser().addSiteMembershipRequest(publicSite);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.RELATIONSHIP_NOT_FOUND, adminTenantUser.getUsername().toLowerCase(), publicSite.getId()));
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify create site membership request returns status code 200 with tenant.")
|
||||
public void addSiteMembershipRequestWithTenant() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser)
|
||||
.usingTenant().createTenant(adminTenantUser);
|
||||
UserModel tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
|
||||
SiteModel tenantPublicSite = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
siteMembershipRequest = restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteMembershipRequest(tenantPublicSite);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
siteMembershipRequest.assertThat().field("id").is(tenantPublicSite.getId())
|
||||
.assertThat().field("site").isNotEmpty();
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify site membership request is automatically rejected when a site is switched from moderated to private")
|
||||
|
||||
-2
@@ -2,14 +2,12 @@ package org.alfresco.rest.sites.membershipRequests;
|
||||
|
||||
import org.alfresco.dataprep.SiteService.Visibility;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestSiteMembershipRequestModelsCollection;
|
||||
import org.alfresco.rest.model.RestTaskModel;
|
||||
import org.alfresco.utility.constants.UserRole;
|
||||
import org.alfresco.utility.data.DataUser.ListUserWithRoles;
|
||||
import org.alfresco.utility.data.RandomData;
|
||||
import org.alfresco.utility.exception.DataPreparationException;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
|
||||
-48
@@ -2,13 +2,11 @@ package org.alfresco.rest.sites.membershipRequests;
|
||||
|
||||
import org.alfresco.dataprep.SiteService;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestSiteMembershipRequestModel;
|
||||
import org.alfresco.rest.model.RestTaskModel;
|
||||
import org.alfresco.utility.constants.UserRole;
|
||||
import org.alfresco.utility.data.DataUser.ListUserWithRoles;
|
||||
import org.alfresco.utility.exception.DataPreparationException;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
@@ -331,50 +329,4 @@ public class GetSiteMembershipRequestTests extends RestTest
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.NETWORKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add process item using by the admin in same network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getSiteMembershipRequestByAdminSameNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser);
|
||||
UserModel tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
|
||||
moderatedSite = dataSite.usingUser(adminTenantUser).createModeratedRandomSite();
|
||||
restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().addSiteMembershipRequest(moderatedSite);
|
||||
|
||||
returnedModel = restClient.authenticateUser(tenantUser).withCoreAPI().usingAuthUser().getSiteMembershipRequest(moderatedSite);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
returnedModel.assertThat().field("id").is(moderatedSite.getId())
|
||||
.and().field("message").is("Please accept me")
|
||||
.and().field("site.title").is(moderatedSite.getTitle())
|
||||
.and().field("site.visibility").is(SiteService.Visibility.MODERATED.toString())
|
||||
.and().field("site.guid").isNotEmpty()
|
||||
.and().field("site.description").is(moderatedSite.getDescription())
|
||||
.and().field("site.preset").is("site-dashboard");
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.NETWORKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add process item using by admin in other network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getSiteMembershipRequestByAdminInOtherNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser);
|
||||
|
||||
UserModel adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.usingTenant().createTenant(adminTenantUser2);
|
||||
moderatedSite = dataSite.usingUser(adminTenantUser2).createModeratedRandomSite();
|
||||
|
||||
restClient.authenticateUser(adminTenantUser).withCoreAPI().usingAuthUser().addSiteMembershipRequest(moderatedSite);
|
||||
returnedModel = restClient.authenticateUser(adminTenantUser2).withCoreAPI().usingAuthUser().getSiteMembershipRequest(moderatedSite);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError()
|
||||
.containsErrorKey(RestErrorModel.RELATIONSHIP_NOT_FOUND_ERRORKEY)
|
||||
.containsSummary(String.format(RestErrorModel.RELATIONSHIP_NOT_FOUND, adminTenantUser2.getUsername().toLowerCase(), moderatedSite.getId()))
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package org.alfresco.rest.workflow;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.rest.NetworkDataPrep;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestDeploymentModel;
|
||||
import org.alfresco.rest.model.RestDeploymentModelsCollection;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
public class WorkflowNetworkDeploymentsTests extends NetworkDataPrep
|
||||
{
|
||||
private RestDeploymentModel expectedDeployment, actualDeployment;
|
||||
private RestDeploymentModelsCollection deployments;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify if network admin user gets a network deployment using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void adminGetsNetworkDeploymentWithSuccess() throws Exception
|
||||
{
|
||||
|
||||
expectedDeployment = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getDeployments().getOneRandomEntry().onModel();
|
||||
actualDeployment = restClient.withWorkflowAPI().usingDeployment(expectedDeployment).getDeployment();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
actualDeployment.assertThat().field("deployedAt").isNotEmpty()
|
||||
.and().field("name").is(expectedDeployment.getName())
|
||||
.and().field("id").is(expectedDeployment.getId());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify non admin user is forbidden to get a network deployment using REST API (403)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void nonAdminUserIsForbiddenToGetNetworkDeployment() throws Exception
|
||||
{
|
||||
expectedDeployment = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getDeployments().getOneRandomEntry().onModel();
|
||||
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI().usingDeployment(expectedDeployment).getDeployment();
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsSummary(RestErrorModel.PERMISSION_WAS_DENIED);
|
||||
}
|
||||
|
||||
@Bug(id = "MNT-16996")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify get deployments returns an empty list after deleting all network deployments.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void getNetworkDeploymentsAfterDeletingAllNetworkDeployments() throws Exception
|
||||
{
|
||||
|
||||
List<RestDeploymentModel> networkDeployments = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getDeployments().getEntries();
|
||||
for (RestDeploymentModel networkDeployment: networkDeployments)
|
||||
{
|
||||
restClient.withWorkflowAPI().usingDeployment(networkDeployment.onModel()).deleteDeployment();
|
||||
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
deployments = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getDeployments();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
deployments.assertThat().entriesListIsEmpty();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify non admin user is not able to get network deployments using REST API and status code is Forbidden")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void nonAdminUserCanNotGetNetworkDeployments() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI().getDeployments();
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsSummary(RestErrorModel.PERMISSION_WAS_DENIED);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that network admin user is not able to get a deployment from other network using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void adminDoesNotGetDeploymentFromOtherNetwork() throws Exception
|
||||
{
|
||||
expectedDeployment = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getDeployments().getOneRandomEntry().onModel();
|
||||
actualDeployment = restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI().usingDeployment(expectedDeployment).getDeployment();
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError()
|
||||
.containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, expectedDeployment.getId()))
|
||||
.containsErrorKey(RestErrorModel.ENTITY_NOT_FOUND_ERRORKEY)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that network admin user is not able to get a deployment from other network using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void adminDoesNotGetDeploymentsFromOtherNetwork() throws Exception
|
||||
{
|
||||
RestDeploymentModel deployment = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getDeployments().getOneRandomEntry().onModel();
|
||||
deployments = restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI().getDeployments();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
deployments.assertThat().entriesListDoesNotContain("id", deployment.getId());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Tenant Admin user gets network deployments using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS, TestGroup.SANITY, TestGroup.NETWORKS})
|
||||
public void getNetworkDeploymentsWithAdmin() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
deployments = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getDeployments();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
deployments.assertThat().entriesListIsNotEmpty();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
package org.alfresco.rest.workflow;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.NetworkDataPrep;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestProcessDefinitionModel;
|
||||
import org.alfresco.rest.model.RestProcessDefinitionModelsCollection;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
public class WorkflowNetworkProcessDefinitionsTests extends NetworkDataPrep
|
||||
{
|
||||
private RestProcessDefinitionModel randomProcessDefinition, returnedProcessDefinition;
|
||||
private RestProcessModel addedProcess;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify network admin is able to get a process definition using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void networkAdminGetProcessDefinition() throws Exception
|
||||
{
|
||||
randomProcessDefinition = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
returnedProcessDefinition = restClient.withWorkflowAPI().usingProcessDefinitions(randomProcessDefinition).getProcessDefinition();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
returnedProcessDefinition.assertThat().field("name").is(randomProcessDefinition.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify network user is able to get a process definition using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void networkUserGetProcessDefinition() throws Exception
|
||||
{
|
||||
randomProcessDefinition = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
returnedProcessDefinition = restClient.authenticateUser(tenantUser).withWorkflowAPI()
|
||||
.usingProcessDefinitions(randomProcessDefinition).getProcessDefinition();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
returnedProcessDefinition.assertThat().field("name").is(randomProcessDefinition.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify get process definitions using any network user for network enabled deployments with REST API status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void networkUserGetsProcessDefinitions() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(tenantUser)
|
||||
.withWorkflowAPI()
|
||||
.getAllProcessDefinitions()
|
||||
.assertThat().entriesListIsNotEmpty();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Network user is not able to get a process definition from another network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.NETWORKS, TestGroup.REGRESSION })
|
||||
public void getProcessDefinitionFromAnotherNetwork() throws Exception
|
||||
{
|
||||
randomProcessDefinition = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI()
|
||||
.usingProcessDefinitions(randomProcessDefinition).getProcessDefinition();
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, randomProcessDefinition.getId()))
|
||||
.containsErrorKey(RestErrorModel.ENTITY_NOT_FOUND_ERRORKEY)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Tenant User doesn't get process definitions for another network deployment using REST API")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void networkUserIsNotAbleToGetProcessDefinitionsForAnotherNetwork() throws Exception
|
||||
{
|
||||
RestProcessDefinitionModel randomProcessDefinitionTenant1 = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
RestProcessDefinitionModelsCollection processDefinitionsTenant2 = restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI()
|
||||
.getAllProcessDefinitions();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
processDefinitionsTenant2.assertThat().entriesListDoesNotContain("id", randomProcessDefinitionTenant1.getId());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify network admin is able to get a process definition image using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
@Bug(id = "MNT-17243")
|
||||
public void networkAdminGetProcessDefinitionImage() throws Exception
|
||||
{
|
||||
randomProcessDefinition = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
restClient.withWorkflowAPI().usingProcessDefinitions(randomProcessDefinition).getProcessDefinitionImage()
|
||||
.assertResponseContainsImage();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify network user is able to get a process definition image using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
@Bug(id = "MNT-17243")
|
||||
public void networkUserGetProcessDefinitionImage() throws Exception
|
||||
{
|
||||
randomProcessDefinition = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI()
|
||||
.usingProcessDefinitions(randomProcessDefinition).getProcessDefinitionImage()
|
||||
.assertResponseContainsImage();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.SANITY, description = "Verify Tenant Admin user gets process definitions for network deployments using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.SANITY, TestGroup.NETWORKS})
|
||||
public void networkAdminGetsProcessDefinitions() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminTenantUser);
|
||||
restClient.withWorkflowAPI().getAllProcessDefinitions().assertThat().entriesListIsNotEmpty();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Tenant User doesn't get process definition image for another network deployment using REST API")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void networkUserIsNotAbleToGetProcessDefinitionImageForAnotherNetwork() throws Exception
|
||||
{
|
||||
RestProcessDefinitionModel randomProcessDefinition = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI()
|
||||
.usingProcessDefinitions(randomProcessDefinition).getProcessDefinitionImage();
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, randomProcessDefinition.getId()));
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Tenant User gets a model of the start form type definition for network deployments using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void networkUserGetsStartFormModel() throws Exception
|
||||
{
|
||||
randomProcessDefinition = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI()
|
||||
.usingProcessDefinitions(randomProcessDefinition).getProcessDefinitionStartFormModel()
|
||||
.assertThat().entriesListIsNotEmpty();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Tenant User doesn't get a model of the start form type definition for another network deployment using REST API")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void networkUserIsNotAbleToGetStartFormModelForAnotherNetwork() throws Exception
|
||||
{
|
||||
RestProcessDefinitionModel randomProcessDefinition = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI()
|
||||
.usingProcessDefinitions(randomProcessDefinition).getProcessDefinitionStartFormModel();
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, randomProcessDefinition.getId()));
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.SANITY,
|
||||
description = "Verify Tenant Admin gets a model of the start form type definition for network deployments using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.SANITY, TestGroup.NETWORKS })
|
||||
public void networkAdminGetsStartFormModel() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminTenantUser);
|
||||
randomProcessDefinition = restClient.withWorkflowAPI().getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
restClient.withWorkflowAPI().usingProcessDefinitions(randomProcessDefinition).getProcessDefinitionStartFormModel().assertThat().entriesListIsNotEmpty();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify network user can start new process with processDefinitionKey from same network using REST API and status code is 201")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void networkUserCanStartNewProcessWithProcessDefinitionFromSameNetwork() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
RestProcessDefinitionModel firstProcessDefTenant1 = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getAllProcessDefinitions().getEntries().get(0).onModel();
|
||||
|
||||
String processDefinitionKey = firstProcessDefTenant1.getKey();
|
||||
addedProcess = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess(processDefinitionKey, secondTenantUser, false, Priority.Normal);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
addedProcess.assertThat().field("processDefinitionId").is(firstProcessDefTenant1.getId())
|
||||
.and().field("startUserId").is(tenantUser.getEmailAddress().substring(0,2)+tenantUser.getEmailAddress().substring(2).toLowerCase())
|
||||
.and().field("processDefinitionKey").is(processDefinitionKey);
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify network user cannot start new process with processDefinitionKey from another network using REST API and status code is 400")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void networkUserCannotStartNewProcessWithProcessDefinitionFromAnotherNetwork() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
RestProcessDefinitionModel firstProcessDefTenant1 = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getAllProcessDefinitions().getEntries().get(0).onModel();
|
||||
|
||||
String processDefinitionKey = firstProcessDefTenant1.getId().substring(0,firstProcessDefTenant1.getId().indexOf(":"));
|
||||
addedProcess = restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI().addProcess(processDefinitionKey, differentNetworkTenantUser, false, Priority.Normal);
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError()
|
||||
.containsErrorKey(String.format(RestErrorModel.NO_WORKFLOW_DEFINITION_FOUND, processDefinitionKey))
|
||||
.containsSummary(String.format(RestErrorModel.NO_WORKFLOW_DEFINITION_FOUND, processDefinitionKey))
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,529 @@
|
||||
package org.alfresco.rest.workflow;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.NetworkDataPrep;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestItemModel;
|
||||
import org.alfresco.rest.model.RestItemModelsCollection;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.rest.model.RestProcessModelsCollection;
|
||||
import org.alfresco.rest.model.RestProcessVariableCollection;
|
||||
import org.alfresco.rest.model.RestProcessVariableModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
public class WorkflowNetworkProcessesTests extends NetworkDataPrep
|
||||
{
|
||||
private RestProcessModel processModel;
|
||||
private RestProcessModelsCollection processes;
|
||||
private RestItemModel processItem;
|
||||
private RestItemModelsCollection processItems;
|
||||
private RestProcessVariableModel variableModel, processVariable;
|
||||
private RestProcessVariableCollection variables;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.WORKFLOW,
|
||||
TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify network user is able to start new process using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY, TestGroup.NETWORKS })
|
||||
public void networkUserStartsNewProcess() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Normal);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
processModel.assertThat().field("id").is(processModel.getId())
|
||||
.and().field("startUserId").is(processModel.getStartUserId());
|
||||
|
||||
processes = restClient.withWorkflowAPI().getProcesses();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
processes.assertThat().entriesListContains("id", processModel.getId());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that non network user cannot get process from a network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@Bug(id = "REPO-2092")
|
||||
public void nonNetworkUserCannotAccessNetworkProcess() throws Exception
|
||||
{
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().addProcess("activitiReview", tenantUser, false, CMISUtil.Priority.High);
|
||||
|
||||
restClient.authenticateUser(adminUserModel).withWorkflowAPI().usingProcess(networkProcess1).getProcess();
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED)
|
||||
.assertLastError().containsErrorKey(RestErrorModel.API_DEFAULT_ERRORKEY)
|
||||
.containsSummary(RestErrorModel.AUTHENTICATION_FAILED);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that tenant user can get process from the same network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void tenantUserCanGetProcessFromTheSameNetwork() throws Exception
|
||||
{
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().addProcess("activitiReview", tenantUser, false, CMISUtil.Priority.High);
|
||||
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI().usingProcess(networkProcess1).getProcess();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
networkProcess1.assertThat().field("id").is(networkProcess1.getId())
|
||||
.and().field("startUserId").is(networkProcess1.getStartUserId());;
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that tenant user cannot get process from another network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@Bug(id = "REPO-2092")
|
||||
public void tenantUserCannotGetProcessFromAnotherNetwork() throws Exception
|
||||
{
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().addProcess("activitiReview", tenantUser, false, CMISUtil.Priority.High);
|
||||
|
||||
restClient.authenticateUser(differentNetworkTenantUser).withWorkflowAPI().usingProcess(networkProcess1).getProcess();
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED)
|
||||
.assertLastError().containsErrorKey(RestErrorModel.API_DEFAULT_ERRORKEY)
|
||||
.containsSummary(RestErrorModel.AUTHENTICATION_FAILED);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin user can get process started by a network user")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void adminUserCanGetProcessFromANetwork() throws Exception
|
||||
{
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiReview", adminTenantUser, false, CMISUtil.Priority.High);
|
||||
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).withWorkflowAPI().usingProcess(networkProcess1).getProcess();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
networkProcess1.assertThat().field("processDefinitionId").contains(String.format("@%s%s", tenantUser.getDomain().toLowerCase(), "@activitiReview:1"))
|
||||
.and().field("startUserId").is(tenantUser.getEmailAddress().toLowerCase())
|
||||
.and().field("startActivityId").is("start")
|
||||
.and().field("startedAt").isNotEmpty()
|
||||
.and().field("id").is(networkProcess1.getId())
|
||||
.and().field("completed").is(false)
|
||||
.and().field("processDefinitionKey").is("activitiReview");
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add multiple process items using by admin in other network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void addMultipleProcessItemsByAdminInOtherNetwork() throws Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUser, false, Priority.Normal);
|
||||
restClient.authenticateUser(secondAdminTenantUser);
|
||||
|
||||
processItems = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItems(document, document2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError()
|
||||
.containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add multiple process items using by the admin in same network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void addMultipleProcessItemsByAdminSameNetwork() throws Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Normal);
|
||||
processItems = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().usingProcess(processModel).addProcessItems(document, document2);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
processItems.getEntries().get(0).onModel().assertThat()
|
||||
.field("createdAt").isNotEmpty().and()
|
||||
.field("size").is("19").and()
|
||||
.field("createdBy").is(adminTenantUser.getUsername().toLowerCase()).and()
|
||||
.field("modifiedAt").isNotEmpty().and()
|
||||
.field("name").is(document.getName()).and()
|
||||
.field("modifiedBy").is(adminTenantUser.getUsername().toLowerCase()).and()
|
||||
.field("id").isNotEmpty().and()
|
||||
.field("mimeType").is(document.getFileType().mimeType);
|
||||
processItems.getEntries().get(1).onModel().assertThat()
|
||||
.field("createdAt").isNotEmpty().and()
|
||||
.field("size").is("19").and()
|
||||
.field("createdBy").is(adminTenantUser.getUsername().toLowerCase()).and()
|
||||
.field("modifiedAt").isNotEmpty().and()
|
||||
.field("name").is(document2.getName()).and()
|
||||
.field("modifiedBy").is(adminTenantUser.getUsername().toLowerCase()).and()
|
||||
.field("id").isNotEmpty().and()
|
||||
.field("mimeType").is(document2.getFileType().mimeType);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add process item using by admin in other network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void addProcessItemByAdminInOtherNetwork() throws Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUser, false, Priority.Normal);
|
||||
restClient.authenticateUser(secondAdminTenantUser);
|
||||
processItem = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document);
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError().containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add process item using by the admin in same network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void addProcessItemByAdminSameNetwork() throws Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Normal);
|
||||
|
||||
processItem = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().usingProcess(processModel).addProcessItem(document);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
processItem.assertThat().field("createdAt").isNotEmpty().and().field("size").is("19").and().field("createdBy").is(adminTenantUser.getUsername().toLowerCase()).and()
|
||||
.field("modifiedAt").isNotEmpty().and().field("name").is(document.getName()).and().field("modifiedBy").is(adminTenantUser.getUsername().toLowerCase()).and()
|
||||
.field("id").isNotEmpty().and().field("mimeType").is(document.getFileType().mimeType);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Delete process item using by admin in other network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void deleteProcessItemByAdminInOtherNetwork() throws Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, CMISUtil.Priority.Normal);
|
||||
processItem = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI().usingProcess(processModel)
|
||||
.deleteProcessItem(processItem);
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError()
|
||||
.containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.containsErrorKey(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
|
||||
//restore document
|
||||
document = dataContent.usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Delete process item using by the admin in same network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void deleteProcessItemByAdminSameNetwork() throws Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, CMISUtil.Priority.Normal);
|
||||
|
||||
processItem = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
restClient.authenticateUser(adminTenantUser).withWorkflowAPI().usingProcess(processModel)
|
||||
.deleteProcessItem(processItem);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
restClient.withWorkflowAPI().usingProcess(processModel).getProcessVariables()
|
||||
.assertThat().entriesListDoesNotContain("name", processItem.getName());
|
||||
|
||||
//restore document
|
||||
document = dataContent.usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Get process items using admin from different network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getProcessItemsReturnsOnlyItemsInsideNetwork() throws Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, CMISUtil.Priority.Normal);
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
document = dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
RestProcessModel processModel2 = restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondAdminTenantUser, false, CMISUtil.Priority.Normal);
|
||||
|
||||
SiteModel siteModel2 = dataSite.usingUser(secondAdminTenantUser).createPublicRandomSite();
|
||||
document2 = dataContent.usingUser(secondAdminTenantUser).usingSite(siteModel2).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI().usingProcess(processModel2).addProcessItem(document2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
processItems = restClient.withWorkflowAPI().usingProcess(processModel2).getProcessItems();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
processItems.assertThat().entriesListDoesNotContain("name", document.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Get process items using admin from different network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getProcessItemsUsingAdminUserFromDifferentNetwork() throws Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, CMISUtil.Priority.Normal);
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
document = dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI().usingProcess(processModel).getProcessItems();
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add process variable using by admin in other network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void addProcessVariableByAdminInOtherNetwork() throws Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Normal);
|
||||
|
||||
restClient.authenticateUser(secondAdminTenantUser);
|
||||
variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processVariable = restClient.withWorkflowAPI().usingProcess(processModel).updateProcessVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError()
|
||||
.containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT);
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
description = "Add process variable using admin user from same network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY, TestGroup.NETWORKS })
|
||||
public void addProcessVariableByAdmin() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Normal);
|
||||
variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processModel = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getProcesses().getOneRandomEntry().onModel();
|
||||
|
||||
processVariable = restClient.withWorkflowAPI().usingProcess(processModel).updateProcessVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
processVariable.assertThat().field("name").is(variableModel.getName())
|
||||
.and().field("type").is(variableModel.getType())
|
||||
.and().field("value").is(variableModel.getValue());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES, TestGroup.NETWORKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from different network is not able to delete network process variables")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void deleteProcessVariablesWithAdminFromDifferentNetwork() throws Exception
|
||||
{
|
||||
RestProcessModel processModel = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.addProcess("activitiAdhoc", tenantUser, false, Priority.Normal);
|
||||
variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser).withWorkflowAPI()
|
||||
.getProcesses().getProcessModelByProcessDefId(processModel.getId());
|
||||
restClient.withWorkflowAPI().usingProcess(networkProcess1).addProcessVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
restClient.authenticateUser(adminUserModel).withWorkflowAPI().usingProcess(networkProcess1)
|
||||
.deleteProcessVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN);
|
||||
restClient.assertLastError().containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.containsErrorKey(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI().usingProcess(networkProcess1).getProcessVariables().assertThat()
|
||||
.entriesListContains("name", variableModel.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES, TestGroup.NETWORKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from the same network is able to delete network process variables")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void deleteProcessVariablesWithAdminFromSameNetwork() throws Exception
|
||||
{
|
||||
RestProcessModel processModel = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.addProcess("activitiAdhoc", tenantUser, false, Priority.Normal);
|
||||
variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser).withWorkflowAPI()
|
||||
.getProcesses().getProcessModelByProcessDefId(processModel.getId());
|
||||
restClient.withWorkflowAPI().usingProcess(networkProcess1).addProcessVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
restClient.authenticateUser(adminTenantUser).withWorkflowAPI().usingProcess(networkProcess1)
|
||||
.deleteProcessVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
restClient.withWorkflowAPI().usingProcess(networkProcess1).getProcessVariables()
|
||||
.assertThat()
|
||||
.entriesListDoesNotContain("name", variableModel.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from different network is not able to retrieve network process variables")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getProcessVariablesWithAdminFromDifferentNetwork() throws Exception
|
||||
{
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser, false, CMISUtil.Priority.High);
|
||||
|
||||
variables = restClient.authenticateUser(adminUserModel).withWorkflowAPI().usingProcess(networkProcess1).getProcessVariables();
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError().containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT);
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API,TestGroup.WORKFLOW, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from the same network is able to retrieve network process variables")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getProcessVariablesWithAdminFromSameNetwork() throws Exception
|
||||
{
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser, false, CMISUtil.Priority.High);
|
||||
|
||||
variables = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().usingProcess(networkProcess1).getProcessVariables();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
variables.assertThat().entriesListIsNotEmpty();
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify admin gets all processes from same network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getProcessFromSameNetworkUsingAdmin() throws Exception
|
||||
{
|
||||
RestProcessModel process = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Normal);
|
||||
|
||||
RestProcessModelsCollection tenantProcesses = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getProcesses();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
tenantProcesses.assertThat().entriesListContains("id", process.getId());
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
description = "Get process items using admin from same network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY, TestGroup.NETWORKS })
|
||||
public void getProcessItemsUsingAdminUserFromSameNetwork() throws Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Normal);
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
document = dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
processItems = restClient.withWorkflowAPI().usingProcess(processModel).getProcessItems();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
processItems.assertThat().entriesListContains("name", document.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
description = "Add multiple process variables using admin user from same network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY, TestGroup.NETWORKS })
|
||||
public void addMultipleProcessVariablesByAdminSameNetwork() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Normal);
|
||||
variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processVariable = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processModel = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getProcesses().getOneRandomEntry().onModel();
|
||||
|
||||
variables = restClient.withWorkflowAPI().usingProcess(processModel).addProcessVariables(variableModel, processVariable);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
variables.assertThat().entriesListContains("name", variableModel.getName())
|
||||
.assertThat().entriesListContains("name", processVariable.getName());
|
||||
|
||||
variables.getEntries().get(0).onModel().assertThat()
|
||||
.field("name").is(variableModel.getName()).and()
|
||||
.field("value").is(variableModel.getValue()).and()
|
||||
.field("type").is(variableModel.getType());
|
||||
variables.getEntries().get(1).onModel().assertThat()
|
||||
.field("name").is(processVariable.getName()).and()
|
||||
.field("value").is(processVariable.getValue()).and()
|
||||
.field("type").is(processVariable.getType());
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
description = "Add process variables using admin user from same network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY, TestGroup.NETWORKS })
|
||||
public void addProcessVariableByAdminSameNetwork() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Normal);
|
||||
variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processModel = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getProcesses().getOneRandomEntry().onModel();
|
||||
|
||||
processVariable = restClient.withWorkflowAPI().usingProcess(processModel).addProcessVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
processVariable.assertThat().field("name").is(variableModel.getName())
|
||||
.and().field("type").is(variableModel.getType())
|
||||
.and().field("value").is(variableModel.getValue());
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify any user cannot get processes from same network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getProcessFromSameNetworkUsingAnyUser() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Normal);
|
||||
|
||||
RestProcessModelsCollection tenantProcesses = restClient.authenticateUser(tenantUser).withWorkflowAPI().getProcesses();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
tenantProcesses.assertThat().entriesListIsEmpty().and().paginationField("count").is("0");
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify getProcessTasks using admin from different network with REST API and status code is FORBIDDEN (403)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getProcessTasksWithAdminFromDifferentNetwork() throws Exception
|
||||
{
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
RestProcessModel processModel = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, CMISUtil.Priority.Normal);
|
||||
|
||||
restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI()
|
||||
.usingProcess(processModel).getProcessTasks().assertThat().entriesListIsEmpty();
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify getProcessTasks using admin from same network with REST API and status code is OK")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getProcessTasksWithAdminFromSameNetwork() throws Exception
|
||||
{
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
|
||||
RestProcessModel processModel = restClient.authenticateUser(secondTenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, CMISUtil.Priority.Normal);
|
||||
|
||||
restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.usingProcess(processModel).getProcessTasks().assertThat().entriesListIsNotEmpty();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.WORKFLOW,TestGroup.PROCESSES}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add multiple process variables using by Admin in other network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void addMultipleProcessVariablesByAdminInOtherNetwork() throws Exception
|
||||
{
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
dataWorkflow.usingUser(tenantUser).usingSite(siteModel).usingResource(document)
|
||||
.createNewTaskAndAssignTo(secondTenantUser);
|
||||
|
||||
variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processVariable = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Normal);
|
||||
restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI().usingProcess(processModel)
|
||||
.addProcessVariables(variableModel, processVariable);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError()
|
||||
.containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.containsErrorKey(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.WORKFLOW, TestGroup.PROCESSES}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add process variables using by Admin in other network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void addProcessVariablesByAdminInOtherNetwork() throws Exception
|
||||
{
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
dataWorkflow.usingUser(tenantUser).usingSite(siteModel).usingResource(document)
|
||||
.createNewTaskAndAssignTo(secondTenantUser);
|
||||
|
||||
variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Normal);
|
||||
processVariable = restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI().usingProcess(processModel)
|
||||
.addProcessVariable(variableModel);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError()
|
||||
.containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.containsErrorKey(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,575 @@
|
||||
package org.alfresco.rest.workflow;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.NetworkDataPrep;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestFormModelsCollection;
|
||||
import org.alfresco.rest.model.RestItemModel;
|
||||
import org.alfresco.rest.model.RestItemModelsCollection;
|
||||
import org.alfresco.rest.model.RestProcessDefinitionModel;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.rest.model.RestTaskModel;
|
||||
import org.alfresco.rest.model.RestTaskModelsCollection;
|
||||
import org.alfresco.rest.model.RestVariableModel;
|
||||
import org.alfresco.rest.model.RestVariableModelsCollection;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TaskModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
public class WorkflowNetworkTasksTests extends NetworkDataPrep
|
||||
{
|
||||
private TaskModel taskModel;
|
||||
private RestFormModelsCollection returnedCollection;
|
||||
private RestTaskModel restTaskModel;
|
||||
private RestTaskModelsCollection taskModels;
|
||||
private RestVariableModel variableModel, variableModel1;
|
||||
private RestVariableModelsCollection restVariableCollection;
|
||||
private RestProcessModel restProcessModel;
|
||||
private RestItemModelsCollection itemModels;
|
||||
private RestItemModel restTaskItem;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS },
|
||||
executionType = ExecutionType.REGRESSION, description = "Verify network admin user gets all task form models inside his network with Rest API and response is successful (200)")
|
||||
public void networkAdminGetsTaskFormModels() throws Exception
|
||||
{
|
||||
FileModel fileModel = dataContent.usingSite(siteModel).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
taskModel = dataWorkflow.usingUser(userModel).usingSite(siteModel).usingResource(fileModel).createNewTaskAndAssignTo(userModel);
|
||||
|
||||
RestProcessModel networkProcess = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser, false, CMISUtil.Priority.High);
|
||||
RestTaskModel networkTask = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.usingProcess(networkProcess).getProcessTasks().getOneRandomEntry().onModel();
|
||||
|
||||
restClient.authenticateUser(adminUserModel).withWorkflowAPI().usingTask(networkTask).getTaskFormModel();
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError().containsSummary(RestErrorModel.PERMISSION_WAS_DENIED);
|
||||
|
||||
returnedCollection = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().usingTask(networkTask).getTaskFormModel();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
returnedCollection.assertThat().entriesListIsNotEmpty();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add multiple task item using by admin in other network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void addMultipleTaskItemByAdminInOtherNetwork() throws Exception
|
||||
{
|
||||
|
||||
document = dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(DocumentType.XML);
|
||||
document2 = dataContent.usingSite(siteModel).createContent(DocumentType.XML);
|
||||
|
||||
RestProcessModel addedProcess = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Normal);
|
||||
RestTaskModel addedTask = restClient.withWorkflowAPI().getTasks().getTaskModelByProcess(addedProcess);
|
||||
restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI().usingTask(addedTask).addTaskItems(document, document2);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError()
|
||||
.containsSummary(RestErrorModel.PERMISSION_WAS_DENIED)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.containsErrorKey(RestErrorModel.PERMISSION_DENIED_ERRORKEY)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);;
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add task item using by admin in other network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void addTaskItemByAdminInOtherNetwork() throws Exception
|
||||
{
|
||||
document = dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(DocumentType.XML);
|
||||
RestProcessModel addedProcess = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Normal);
|
||||
RestTaskModel addedTask = restClient.withWorkflowAPI().getTasks().getTaskModelByProcess(addedProcess);
|
||||
restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI().usingTask(addedTask).addTaskItem(document);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError()
|
||||
.containsSummary(RestErrorModel.PERMISSION_WAS_DENIED)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.containsErrorKey(RestErrorModel.PERMISSION_DENIED_ERRORKEY)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@Bug(id = "REPO-1980")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant admin can update only task from its network and response is 200")
|
||||
public void adminTenantCanUpdateOnlyTaskInItsNetwork() throws Exception
|
||||
{
|
||||
FileModel fileModel1 = dataContent.usingUser(tenantUser).usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
RestProcessDefinitionModel def1 = restClient.authenticateUser(tenantUser).withWorkflowAPI().getAllProcessDefinitions().getEntries().get(0).onModel();
|
||||
TaskModel taskModel1 = dataWorkflow.usingUser(tenantUser).usingSite(siteModel).usingResource(fileModel1)
|
||||
.createTaskWithProcessDefAndAssignTo(def1.getId(), secondTenantUser);
|
||||
|
||||
SiteModel siteModel2 = dataSite.usingUser(differentNetworkTenantUser).createPublicRandomSite();
|
||||
FileModel fileModel2 = dataContent.usingUser(differentNetworkTenantUser).usingSite(siteModel2).createContent(DocumentType.TEXT_PLAIN);
|
||||
RestProcessDefinitionModel def2 = restClient.authenticateUser(differentNetworkTenantUser).withWorkflowAPI().getAllProcessDefinitions().getEntries().get(0).onModel();
|
||||
TaskModel taskModel2 = dataWorkflow.usingUser(differentNetworkTenantUser).usingSite(siteModel2).usingResource(fileModel2)
|
||||
.createTaskWithProcessDefAndAssignTo(def2.getId(), secondAdminTenantUser);
|
||||
|
||||
restTaskModel = restClient.authenticateUser(secondAdminTenantUser).withParams("select=state").withWorkflowAPI().usingTask(taskModel2).updateTask("completed");
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restTaskModel.assertThat().field("id").is(taskModel2.getId())
|
||||
.and().field("state").is("completed");
|
||||
|
||||
restTaskModel = restClient.authenticateUser(secondAdminTenantUser).withParams("select=state").withWorkflowAPI().usingTask(taskModel1).updateTask("completed");
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError()
|
||||
.containsErrorKey(RestErrorModel.PERMISSION_DENIED_ERRORKEY)
|
||||
.containsSummary(RestErrorModel.PERMISSION_WAS_DENIED)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from the same network is able to add multiple task variables")
|
||||
public void addMultipleTaskVariablesByTenantAdmin() throws Exception
|
||||
{
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser, false, CMISUtil.Priority.High);
|
||||
RestTaskModel task = restClient.authenticateUser(adminTenantUser)
|
||||
.withWorkflowAPI().usingProcess(networkProcess1).getProcessTasks().getOneRandomEntry();
|
||||
restClient.authenticateUser(adminTenantUser);
|
||||
|
||||
variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
variableModel1 = RestVariableModel.getRandomTaskVariableModel("global", "d:text");
|
||||
|
||||
restVariableCollection = restClient.withWorkflowAPI().usingTask(task.onModel())
|
||||
.addTaskVariables(variableModel, variableModel1);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
restVariableCollection.getEntries().get(0).onModel().assertThat()
|
||||
.field("scope").is(variableModel.getScope())
|
||||
.and().field("name").is(variableModel.getName())
|
||||
.and().field("value").is(variableModel.getValue())
|
||||
.and().field("type").is(variableModel.getType());
|
||||
|
||||
restVariableCollection.getEntries().get(1).onModel().assertThat()
|
||||
.field("scope").is(variableModel1.getScope())
|
||||
.and().field("name").is(variableModel1.getName())
|
||||
.and().field("value").is(variableModel1.getValue())
|
||||
.and().field("type").is(variableModel1.getType());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from the same network is able to add and remove task variables")
|
||||
public void addAndRemoveTaskVariablesByTenantAdmin() throws Exception
|
||||
{
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.addProcess("activitiReview", adminTenantUser, false, CMISUtil.Priority.High);
|
||||
RestTaskModel task = restClient.authenticateUser(adminTenantUser)
|
||||
.withWorkflowAPI().usingProcess(networkProcess1).getProcessTasks().getOneRandomEntry();
|
||||
restClient.authenticateUser(adminTenantUser);
|
||||
RestVariableModel variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
variableModel = restClient.withWorkflowAPI()
|
||||
.usingTask(task.onModel())
|
||||
.addTaskVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
variableModel.assertThat()
|
||||
.field("scope").is(variableModel.getScope())
|
||||
.and().field("name").is(variableModel.getName())
|
||||
.and().field("value").is(variableModel.getValue())
|
||||
.and().field("type").is(variableModel.getType());
|
||||
|
||||
restClient.withWorkflowAPI().usingTask(task.onModel()).deleteTaskVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
restClient.withWorkflowAPI().usingTask(task.onModel()).getTaskVariables()
|
||||
.assertThat().entriesListDoesNotContain("name", variableModel.getName());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from the other network is not able to remove task variables")
|
||||
public void addTaskVariablesByTenantAdminOtherNetwork() throws Exception
|
||||
{
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.addProcess("activitiReview", adminTenantUser, false, CMISUtil.Priority.High);
|
||||
RestTaskModel task = restClient.authenticateUser(adminTenantUser)
|
||||
.withWorkflowAPI().usingProcess(networkProcess1).getProcessTasks().getOneRandomEntry();
|
||||
restClient.authenticateUser(adminTenantUser);
|
||||
RestVariableModel variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
restClient.withWorkflowAPI()
|
||||
.usingTask(task.onModel())
|
||||
.addTaskVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI().usingTask(task.onModel()).deleteTaskVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsErrorKey(RestErrorModel.PERMISSION_DENIED_ERRORKEY)
|
||||
.containsSummary(RestErrorModel.PERMISSION_WAS_DENIED)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from another network is not able to add task variables")
|
||||
public void addTaskVariablesByTenantFromAnotherNetwork() throws Exception
|
||||
{
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser, false, CMISUtil.Priority.High);
|
||||
RestTaskModel task = restClient.authenticateUser(adminTenantUser)
|
||||
.withWorkflowAPI().usingProcess(networkProcess1).getProcessTasks().getOneRandomEntry();
|
||||
RestVariableModel variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
variableModel = restClient.authenticateUser(secondTenantUser).withWorkflowAPI()
|
||||
.usingTask(task.onModel())
|
||||
.addTaskVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsErrorKey(RestErrorModel.PERMISSION_DENIED_ERRORKEY)
|
||||
.containsSummary(RestErrorModel.PERMISSION_WAS_DENIED)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from another network is not able to add multiple task variables")
|
||||
public void addMultipleTaskVariablesByTenantFromAnotherNetwork() throws Exception
|
||||
{
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser, false, CMISUtil.Priority.High);
|
||||
RestTaskModel task = restClient.authenticateUser(adminTenantUser)
|
||||
.withWorkflowAPI().usingProcess(networkProcess1).getProcessTasks().getOneRandomEntry();
|
||||
restClient.authenticateUser(adminTenantUser);
|
||||
|
||||
variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
variableModel1 = RestVariableModel.getRandomTaskVariableModel("global", "d:text");
|
||||
restVariableCollection = restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI()
|
||||
.usingTask(task.onModel())
|
||||
.addTaskVariables(variableModel,variableModel1);
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsErrorKey(RestErrorModel.PERMISSION_DENIED_ERRORKEY)
|
||||
.containsSummary(RestErrorModel.PERMISSION_WAS_DENIED)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from another network is not able to update task variables")
|
||||
public void updateTaskVariablesByTenantFromAnotherNetwork() throws Exception
|
||||
{
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser, false, CMISUtil.Priority.High);
|
||||
RestTaskModel task = restClient.authenticateUser(adminTenantUser)
|
||||
.withWorkflowAPI().usingProcess(networkProcess1).getProcessTasks().getOneRandomEntry();
|
||||
restClient.authenticateUser(adminTenantUser);
|
||||
RestVariableModel variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
variableModel = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().usingTask(task.onModel())
|
||||
.addTaskVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI().usingTask(task.onModel())
|
||||
.updateTaskVariable(variableModel);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsErrorKey(RestErrorModel.PERMISSION_DENIED_ERRORKEY)
|
||||
.containsSummary(RestErrorModel.PERMISSION_WAS_DENIED)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS },
|
||||
executionType = ExecutionType.REGRESSION, description = "Check that for admin network gets tasks only from its network.")
|
||||
public void adminTenantGetsTasksOnlyFromItsNetwork() throws Exception
|
||||
{
|
||||
RestProcessModel processOnTenant1 = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Low);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
RestProcessModel processOnTenant2 = restClient.authenticateUser(differentNetworkTenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondAdminTenantUser, false, Priority.Normal);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
RestTaskModelsCollection tenantTasks1 = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getTasks();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
tenantTasks1.assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListCountIs(1)
|
||||
.and().entriesListContains("assignee", String.format("userTenantAssignee1@%s", secondTenantUser.getDomain().toLowerCase()))
|
||||
.and().entriesListContains("processId", processOnTenant1.getId())
|
||||
.and().entriesListDoesNotContain("assignee", String.format("userTenantAssignee2@%s", secondAdminTenantUser.getDomain().toLowerCase()))
|
||||
.and().entriesListDoesNotContain("processId", processOnTenant2.getId());
|
||||
|
||||
RestTaskModelsCollection tenantTasks2 = restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI().getTasks();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
tenantTasks2.assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListCountIs(1)
|
||||
.and().entriesListContains("assignee", String.format("userTenantAssignee2@%s", secondAdminTenantUser.getDomain().toLowerCase()))
|
||||
.and().entriesListContains("processId", processOnTenant2.getId())
|
||||
.and().entriesListDoesNotContain("assignee", String.format("userTenantAssignee1@%s", secondTenantUser.getDomain().toLowerCase()))
|
||||
.and().entriesListDoesNotContain("processId", processOnTenant1.getId());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,
|
||||
TestGroup.TASKS }, executionType = ExecutionType.REGRESSION, description = "Check that for network enabled only that network tasks are returned.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.REGRESSION })
|
||||
public void networkEnabledTasksReturned() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Normal);
|
||||
|
||||
taskModels = restClient.authenticateUser(secondTenantUser).withWorkflowAPI().getTasks();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
taskModels.assertThat().entriesListIsNotEmpty().and().entriesListCountIs(1).and().entriesListContains("assignee",
|
||||
String.format("userTenantAssignee@%s", secondTenantUser.getDomain().toLowerCase()));
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify gets task items call with admin from different network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getTaskItemsByAdminFromAnotherNetwork() throws Exception
|
||||
{
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
document = dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(DocumentType.XML);
|
||||
restProcessModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Normal);
|
||||
restTaskModel = restClient.withWorkflowAPI().getTasks().getTaskModelByProcess(restProcessModel);
|
||||
restClient.withWorkflowAPI().usingTask(restTaskModel).addTaskItem(document);
|
||||
|
||||
restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI().usingTask(restTaskModel).getTaskItems();
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsSummary(RestErrorModel.PERMISSION_WAS_DENIED);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify gets task items call returns only task items inside network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getTaskItemsReturnsOnlyItemsFromThatNetwork() throws Exception
|
||||
{
|
||||
SiteModel siteModel1 = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
FileModel fileModel1 = dataContent.usingUser(adminTenantUser).usingSite(siteModel1).createContent(DocumentType.XML);
|
||||
|
||||
RestProcessModel addedProcess1 = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUser, false, Priority.Normal);
|
||||
RestTaskModel addedTask1 = restClient.withWorkflowAPI().getTasks().getTaskModelByProcess(addedProcess1);
|
||||
RestItemModel taskItem1 = restClient.withWorkflowAPI().usingTask(addedTask1).addTaskItem(fileModel1);
|
||||
|
||||
SiteModel siteModel2 = dataSite.usingUser(secondAdminTenantUser).createPublicRandomSite();
|
||||
FileModel fileModel2 = dataContent.usingUser(secondAdminTenantUser).usingSite(siteModel2).createContent(DocumentType.XML);
|
||||
|
||||
RestProcessModel addedProcess2 = restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI().addProcess("activitiAdhoc", differentNetworkTenantUser, false, Priority.Normal);
|
||||
RestTaskModel addedTask2 = restClient.withWorkflowAPI().getTasks().getTaskModelByProcess(addedProcess2);
|
||||
RestItemModel taskItem2 = restClient.withWorkflowAPI().usingTask(addedTask2).addTaskItem(fileModel2);
|
||||
|
||||
itemModels = restClient.withWorkflowAPI().usingTask(addedTask2).getTaskItems();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
itemModels.assertThat()
|
||||
.entriesListIsNotEmpty().and()
|
||||
.entriesListContains("id", taskItem2.getId()).and()
|
||||
.entriesListContains("name", fileModel2.getName()).and()
|
||||
.entriesListDoesNotContain("id", taskItem1.getId()).and()
|
||||
.entriesListDoesNotContain("name", fileModel1.getName());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS },
|
||||
executionType = ExecutionType.REGRESSION, description = "Check that for admin network gets task only from its network.")
|
||||
public void adminTenantGetsTaskOnlyFromItsNetwork() throws Exception
|
||||
{
|
||||
RestProcessModel processOnTenant1 = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Low);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
RestProcessModel processOnTenant2 = restClient.authenticateUser(differentNetworkTenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondAdminTenantUser, false, Priority.Normal);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
RestTaskModelsCollection tenantTasks2 = restClient.authenticateUser(differentNetworkTenantUser).withWorkflowAPI().getTasks();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
tenantTasks2.assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListCountIs(1)
|
||||
.and().entriesListContains("assignee", String.format("admin@%s", secondAdminTenantUser.getDomain().toLowerCase()))
|
||||
.and().entriesListContains("processId", processOnTenant2.getId())
|
||||
.and().entriesListDoesNotContain("assignee", String.format("admin@%s", secondTenantUser.getDomain().toLowerCase()))
|
||||
.and().entriesListDoesNotContain("processId", processOnTenant1.getId());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,
|
||||
TestGroup.TASKS }, executionType = ExecutionType.REGRESSION, description = "Verify that in a network only tasks inside network are returned.")
|
||||
@Test(groups = {TestGroup.NETWORKS,TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION })
|
||||
public void tasksInsideNetworkReturned() throws Exception
|
||||
{
|
||||
|
||||
RestProcessModel addedProcess = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false,
|
||||
Priority.Normal);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
taskModel = restClient.withWorkflowAPI().getTasks().getTaskModelByProcess(addedProcess);
|
||||
restTaskModel = restClient.authenticateUser(secondTenantUser).withWorkflowAPI().usingTask(taskModel).getTask();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restTaskModel.assertThat().field("assignee").is(String.format("sTenant@%s", secondTenantUser.getDomain().toLowerCase())).and()
|
||||
.field("processId").is(addedProcess.getId());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify that user that started the process gets task items")
|
||||
@Test(groups = { TestGroup.NETWORKS,TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.SANITY})
|
||||
public void getTaskItemsByAdminInSameNetwork() throws Exception
|
||||
{
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
document = dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(DocumentType.XML);
|
||||
RestProcessModel addedProcess = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Normal);
|
||||
RestTaskModel addedTask = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getTasks().getTaskModelByProcess(addedProcess);
|
||||
restTaskItem = restClient.withWorkflowAPI().usingTask(addedTask).addTaskItem(document);
|
||||
|
||||
itemModels = restClient.withWorkflowAPI().usingTask(addedTask).getTaskItems();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
itemModels.assertThat()
|
||||
.entriesListIsNotEmpty().and()
|
||||
.entriesListContains("id", restTaskItem.getId()).and()
|
||||
.entriesListContains("name", document.getName());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from the same network is able to retrieve network task variables")
|
||||
public void getTaskVariablesByTenantAdmin() throws Exception
|
||||
{
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser, false, CMISUtil.Priority.High);
|
||||
RestTaskModel task = restClient.authenticateUser(adminTenantUser)
|
||||
.withWorkflowAPI().usingProcess(networkProcess1).getProcessTasks().getOneRandomEntry();
|
||||
|
||||
restVariableCollection = restClient.withWorkflowAPI().usingTask(task.onModel()).getTaskVariables();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restVariableCollection.assertThat().entriesListIsNotEmpty();
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from another network is not able to retrieve network task variables")
|
||||
public void getTaskVariablesByTenantFromAnotherNetwork() throws Exception
|
||||
{
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser, false, CMISUtil.Priority.High);
|
||||
RestTaskModel task = restClient.authenticateUser(adminTenantUser)
|
||||
.withWorkflowAPI().usingProcess(networkProcess1).getProcessTasks().getOneRandomEntry();
|
||||
|
||||
restVariableCollection = restClient.authenticateUser(secondAdminTenantUser).withWorkflowAPI().usingTask(task.onModel()).getTaskVariables();
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsSummary(RestErrorModel.PERMISSION_WAS_DENIED)
|
||||
.containsErrorKey(RestErrorModel.PERMISSION_DENIED_ERRORKEY)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.NETWORKS,TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add task item using admin user from same network")
|
||||
public void addMultipleTaskItemByAdminSameNetwork() throws Exception
|
||||
{
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
document = dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(DocumentType.XML);
|
||||
document2 = dataContent.usingUser(adminTenantUser).usingUser(adminTenantUser).usingSite(siteModel).createContent(DocumentType.XML);
|
||||
RestProcessModel addedProcess = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Normal);
|
||||
RestTaskModel addedTask = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getTasks().getTaskModelByProcess(addedProcess);
|
||||
|
||||
itemModels = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().usingTask(addedTask)
|
||||
.addTaskItems(document2,document);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
itemModels.getEntries().get(0).onModel()
|
||||
.assertThat().field("createdAt").is(itemModels.getEntries().get(0).onModel().getCreatedAt())
|
||||
.assertThat().field("size").is(itemModels.getEntries().get(0).onModel().getSize())
|
||||
.assertThat().field("createdBy").is(itemModels.getEntries().get(0).onModel().getCreatedBy())
|
||||
.assertThat().field("modifiedAt").is(itemModels.getEntries().get(0).onModel().getModifiedAt())
|
||||
.assertThat().field("name").is(itemModels.getEntries().get(0).onModel().getName())
|
||||
.assertThat().field("modifiedBy").is(itemModels.getEntries().get(0).onModel().getModifiedBy())
|
||||
.assertThat().field("id").is(itemModels.getEntries().get(0).onModel().getId())
|
||||
.assertThat().field("mimeType").is(itemModels.getEntries().get(0).onModel().getMimeType());
|
||||
|
||||
itemModels.getEntries().get(1).onModel()
|
||||
.assertThat().field("createdAt").is(itemModels.getEntries().get(1).onModel().getCreatedAt())
|
||||
.assertThat().field("size").is(itemModels.getEntries().get(1).onModel().getSize())
|
||||
.assertThat().field("createdBy").is(itemModels.getEntries().get(1).onModel().getCreatedBy())
|
||||
.assertThat().field("modifiedAt").is(itemModels.getEntries().get(1).onModel().getModifiedAt())
|
||||
.assertThat().field("name").is(itemModels.getEntries().get(1).onModel().getName())
|
||||
.assertThat().field("modifiedBy").is(itemModels.getEntries().get(1).onModel().getModifiedBy())
|
||||
.assertThat().field("id").is(itemModels.getEntries().get(1).onModel().getId());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.NETWORKS,TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add task item using admin user from same network")
|
||||
public void addTaskItemByAdminSameNetwork() throws Exception
|
||||
{
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
document = dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(DocumentType.XML);
|
||||
RestProcessModel addedProcess = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", secondTenantUser, false, Priority.Normal);
|
||||
RestTaskModel addedTask = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getTasks().getTaskModelByProcess(addedProcess);
|
||||
|
||||
restTaskItem = restClient.withWorkflowAPI().usingTask(addedTask).addTaskItem(document);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
restTaskItem.assertThat().field("createdAt").is(restTaskItem.getCreatedAt())
|
||||
.and().field("size").is(restTaskItem.getSize())
|
||||
.and().field("createdBy").is(restTaskItem.getCreatedBy())
|
||||
.and().field("modifiedAt").is(restTaskItem.getModifiedAt())
|
||||
.and().field("name").is(restTaskItem.getName())
|
||||
.and().field("modifiedBy").is(restTaskItem.getModifiedBy())
|
||||
.and().field("id").is(restTaskItem.getId())
|
||||
.and().field("mimeType").is(restTaskItem.getMimeType());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Update existing task variable by admin in the same network")
|
||||
public void updateTaskVariableByAdminInSameNetwork() throws Exception
|
||||
{
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser, false, CMISUtil.Priority.High);
|
||||
RestTaskModel task = restClient.authenticateUser(adminTenantUser)
|
||||
.withWorkflowAPI().usingProcess(networkProcess1).getProcessTasks().getOneRandomEntry();
|
||||
|
||||
variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
variableModel1 = restClient.withWorkflowAPI().usingTask(task.onModel())
|
||||
.updateTaskVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
variableModel1.assertThat().field("scope").is(variableModel1.getScope())
|
||||
.and().field("name").is(variableModel1.getName())
|
||||
.and().field("type").is(variableModel1.getType())
|
||||
.and().field("value").is(variableModel1.getValue());
|
||||
|
||||
variableModel.setValue("updatedValue");
|
||||
variableModel1 = restClient.withWorkflowAPI().usingTask(task.onModel()).updateTaskVariable(variableModel).and().field("value").is("updatedValue");
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user that created the task can update task only in its network and response is 200, for other networks is 403")
|
||||
public void ownerTenantCanUpdatedTaskOnlyInItsNetwork() throws Exception
|
||||
{
|
||||
|
||||
|
||||
SiteModel siteModel1 = dataSite.usingUser(tenantUser).createPublicRandomSite();
|
||||
FileModel fileModel1 = dataContent.usingUser(tenantUser).usingSite(siteModel1).createContent(DocumentType.TEXT_PLAIN);
|
||||
RestProcessDefinitionModel def1 = restClient.authenticateUser(tenantUser).withWorkflowAPI().getAllProcessDefinitions().getEntries().get(0).onModel();
|
||||
TaskModel taskModel1 = dataWorkflow.usingUser(tenantUser).usingSite(siteModel1).usingResource(fileModel1)
|
||||
.createTaskWithProcessDefAndAssignTo(def1.getId(), secondTenantUser);
|
||||
|
||||
SiteModel siteModel2 = dataSite.usingUser(differentNetworkTenantUser).createPublicRandomSite();
|
||||
FileModel fileModel2 = dataContent.usingUser(differentNetworkTenantUser).usingSite(siteModel2).createContent(DocumentType.TEXT_PLAIN);
|
||||
RestProcessDefinitionModel def2 = restClient.authenticateUser(differentNetworkTenantUser).withWorkflowAPI().getAllProcessDefinitions().getEntries().get(0).onModel();
|
||||
TaskModel taskModel2 = dataWorkflow.usingUser(differentNetworkTenantUser).usingSite(siteModel2).usingResource(fileModel2)
|
||||
.createTaskWithProcessDefAndAssignTo(def2.getId(), secondAdminTenantUser);
|
||||
|
||||
restTaskModel = restClient.authenticateUser(differentNetworkTenantUser).withParams("select=state").withWorkflowAPI().usingTask(taskModel2).updateTask("completed");
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restTaskModel.assertThat().field("id").is(taskModel2.getId())
|
||||
.and().field("state").is("completed");
|
||||
|
||||
restTaskModel = restClient.authenticateUser(differentNetworkTenantUser).withParams("select=state").withWorkflowAPI().usingTask(taskModel1).updateTask("completed");
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError()
|
||||
.containsErrorKey(RestErrorModel.PERMISSION_DENIED_ERRORKEY)
|
||||
.containsSummary(RestErrorModel.PERMISSION_WAS_DENIED)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -16,8 +16,8 @@ import org.testng.annotations.Test;
|
||||
*/
|
||||
public class GetDeploymentCoreTests extends RestTest
|
||||
{
|
||||
private UserModel adminUser, adminTenantUser;
|
||||
private RestDeploymentModel expectedDeployment, actualDeployment;
|
||||
private UserModel adminUser;
|
||||
private RestDeploymentModel expectedDeployment;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
@@ -39,38 +39,4 @@ public class GetDeploymentCoreTests extends RestTest
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "invalidId"));
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify if network admin user gets a network deployment using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void adminGetsNetworkDeploymentWithSuccess() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser)
|
||||
.usingTenant().createTenant(adminTenantUser);
|
||||
|
||||
expectedDeployment = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getDeployments().getOneRandomEntry().onModel();
|
||||
actualDeployment = restClient.withWorkflowAPI().usingDeployment(expectedDeployment).getDeployment();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
actualDeployment.assertThat().field("deployedAt").isNotEmpty()
|
||||
.and().field("name").is(expectedDeployment.getName())
|
||||
.and().field("id").is(expectedDeployment.getId());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify non admin user is forbidden to get a network deployment using REST API (403)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void nonAdminUserIsForbiddenToGetNetworkDeployment() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser)
|
||||
.usingTenant().createTenant(adminTenantUser);
|
||||
expectedDeployment = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getDeployments().getOneRandomEntry().onModel();
|
||||
UserModel tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI().usingDeployment(expectedDeployment).getDeployment();
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsSummary(RestErrorModel.PERMISSION_WAS_DENIED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.core.RestRequest;
|
||||
import org.alfresco.rest.model.RestDeploymentModel;
|
||||
import org.alfresco.rest.model.RestDeploymentModelsCollection;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
@@ -55,26 +54,4 @@ public class GetDeploymentFullTests extends RestTest
|
||||
.field("deployedAt").isNull().and()
|
||||
.field("name").is(expectedDeployment.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that network admin user is not able to get a deployment from other network using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void adminDoesNotGetDeploymentFromOtherNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
UserModel adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser1);
|
||||
restClient.usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
expectedDeployment = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI().getDeployments().getOneRandomEntry().onModel();
|
||||
actualDeployment = restClient.authenticateUser(adminTenantUser2).withWorkflowAPI().usingDeployment(expectedDeployment).getDeployment();
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError()
|
||||
.containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, expectedDeployment.getId()))
|
||||
.containsErrorKey(RestErrorModel.ENTITY_NOT_FOUND_ERRORKEY)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,18 +1,12 @@
|
||||
package org.alfresco.rest.workflow.deployments;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestDeploymentModel;
|
||||
import org.alfresco.rest.model.RestDeploymentModelsCollection;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
@@ -20,14 +14,6 @@ import org.testng.annotations.Test;
|
||||
*/
|
||||
public class GetDeploymentsCoreTests extends RestTest
|
||||
{
|
||||
private UserModel adminUser, adminTenantUser;
|
||||
private RestDeploymentModelsCollection deployments;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
adminUser = dataUser.getAdminUser();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
@@ -41,41 +27,4 @@ public class GetDeploymentsCoreTests extends RestTest
|
||||
.assertLastError().containsSummary(RestErrorModel.PERMISSION_WAS_DENIED);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify non admin user is not able to get network deployments using REST API and status code is Forbidden")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void nonAdminUserCanNotGetNetworkDeployments() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser)
|
||||
.usingTenant().createTenant(adminTenantUser);
|
||||
|
||||
UserModel tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI().getDeployments();
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsSummary(RestErrorModel.PERMISSION_WAS_DENIED);
|
||||
}
|
||||
|
||||
@Bug(id = "MNT-16996")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify get deployments returns an empty list after deleting all network deployments.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void getNetworkDeploymentsAfterDeletingAllNetworkDeployments() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser)
|
||||
.usingTenant().createTenant(adminTenantUser);
|
||||
List<RestDeploymentModel> networkDeployments = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getDeployments().getEntries();
|
||||
for (RestDeploymentModel networkDeployment: networkDeployments)
|
||||
{
|
||||
restClient.withWorkflowAPI().usingDeployment(networkDeployment.onModel()).deleteDeployment();
|
||||
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
deployments = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getDeployments();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
deployments.assertThat().entriesListIsEmpty();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -143,21 +143,4 @@ public class GetDeploymentsFullTests extends RestTest
|
||||
.field("name").isNull();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that network admin user is not able to get a deployment from other network using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void adminDoesNotGetDeploymentsFromOtherNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
UserModel adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUserModel).usingTenant().createTenant(adminTenantUser1);
|
||||
restClient.usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
RestDeploymentModel deployment = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI().getDeployments().getOneRandomEntry().onModel();
|
||||
deployments = restClient.authenticateUser(adminTenantUser2).withWorkflowAPI().getDeployments();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
deployments.assertThat().entriesListDoesNotContain("id", deployment.getId());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-12
@@ -16,14 +16,13 @@ import org.testng.annotations.Test;
|
||||
*/
|
||||
public class GetDeploymentsSanityTests extends RestTest
|
||||
{
|
||||
private UserModel adminUserModel, adminTenantUser;
|
||||
private UserModel adminUserModel;
|
||||
private RestDeploymentModelsCollection deployments;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
adminUserModel = dataUser.getAdminUser();
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
}
|
||||
|
||||
@@ -42,14 +41,4 @@ public class GetDeploymentsSanityTests extends RestTest
|
||||
.field("name").isNotEmpty();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Tenant Admin user gets network deployments using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS, TestGroup.SANITY, TestGroup.NETWORKS})
|
||||
public void getNetworkDeploymentsWithAdmin() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.usingTenant().createTenant(adminTenantUser);
|
||||
deployments = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getDeployments();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
deployments.assertThat().entriesListIsNotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
+2
-35
@@ -16,8 +16,8 @@ import org.testng.annotations.Test;
|
||||
*/
|
||||
public class GetProcessDefinitionCoreTests extends RestTest
|
||||
{
|
||||
private UserModel adminUser, adminTenantUser;
|
||||
private RestProcessDefinitionModel randomProcessDefinition, returnedProcessDefinition;
|
||||
private UserModel adminUser;
|
||||
private RestProcessDefinitionModel randomProcessDefinition;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
@@ -42,37 +42,4 @@ public class GetProcessDefinitionCoreTests extends RestTest
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify network admin is able to get a process definition using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void networkAdminGetProcessDefinition() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser)
|
||||
.usingTenant().createTenant(adminTenantUser);
|
||||
randomProcessDefinition = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
returnedProcessDefinition = restClient.withWorkflowAPI().usingProcessDefinitions(randomProcessDefinition).getProcessDefinition();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
returnedProcessDefinition.assertThat().field("name").is(randomProcessDefinition.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify network user is able to get a process definition using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void networkUserGetProcessDefinition() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser)
|
||||
.usingTenant().createTenant(adminTenantUser);
|
||||
UserModel tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
randomProcessDefinition = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
returnedProcessDefinition = restClient.authenticateUser(tenantUser).withWorkflowAPI()
|
||||
.usingProcessDefinitions(randomProcessDefinition).getProcessDefinition();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
returnedProcessDefinition.assertThat().field("name").is(randomProcessDefinition.getName());
|
||||
}
|
||||
}
|
||||
|
||||
-23
@@ -2,7 +2,6 @@ package org.alfresco.rest.workflow.processDefinitions;
|
||||
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.core.RestRequest;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestProcessDefinitionModel;
|
||||
import org.alfresco.rest.model.RestProcessDefinitionModelsCollection;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
@@ -65,26 +64,4 @@ public class GetProcessDefinitionFullTests extends RestTest
|
||||
.field("key").isNull().and()
|
||||
.field("name").is(randomProcessDefinition.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Network user is not able to get a process definition from another network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.NETWORKS, TestGroup.REGRESSION })
|
||||
public void getProcessDefinitionFromAnotherNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
UserModel adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser1);
|
||||
restClient.usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
randomProcessDefinition = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI()
|
||||
.getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
restClient.authenticateUser(adminTenantUser2).withWorkflowAPI()
|
||||
.usingProcessDefinitions(randomProcessDefinition).getProcessDefinition();
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, randomProcessDefinition.getId()))
|
||||
.containsErrorKey(RestErrorModel.ENTITY_NOT_FOUND_ERRORKEY)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-38
@@ -5,7 +5,6 @@ import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestProcessDefinitionModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -17,7 +16,7 @@ import org.testng.annotations.Test;
|
||||
*/
|
||||
public class GetProcessDefinitionImageCoreTests extends RestTest
|
||||
{
|
||||
private UserModel adminUser, adminTenantUser;
|
||||
private UserModel adminUser;
|
||||
private RestProcessDefinitionModel randomProcessDefinition;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
@@ -44,40 +43,4 @@ public class GetProcessDefinitionImageCoreTests extends RestTest
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify network admin is able to get a process definition image using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
@Bug(id = "MNT-17243")
|
||||
public void networkAdminGetProcessDefinitionImage() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser)
|
||||
.usingTenant().createTenant(adminTenantUser);
|
||||
|
||||
randomProcessDefinition = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
restClient.withWorkflowAPI().usingProcessDefinitions(randomProcessDefinition).getProcessDefinitionImage()
|
||||
.assertResponseContainsImage();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify network user is able to get a process definition image using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
@Bug(id = "MNT-17243")
|
||||
public void networkUserGetProcessDefinitionImage() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser)
|
||||
.usingTenant().createTenant(adminTenantUser);
|
||||
UserModel tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
randomProcessDefinition = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI()
|
||||
.usingProcessDefinitions(randomProcessDefinition).getProcessDefinitionImage()
|
||||
.assertResponseContainsImage();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
-20
@@ -1,7 +1,6 @@
|
||||
package org.alfresco.rest.workflow.processDefinitions;
|
||||
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestProcessDefinitionModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
@@ -40,23 +39,4 @@ public class GetProcessDefinitionImageFullTests extends RestTest
|
||||
.usingProcessDefinitions(randomProcessDefinition).getProcessDefinitionImage();
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Tenant User doesn't get process definition image for another network deployment using REST API")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void networkUserIsNotAbleToGetProcessDefinitionImageForAnotherNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
UserModel adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser1);
|
||||
restClient.usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
RestProcessDefinitionModel randomProcessDefinition = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI()
|
||||
.getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
restClient.authenticateUser(adminTenantUser2).withWorkflowAPI()
|
||||
.usingProcessDefinitions(randomProcessDefinition).getProcessDefinitionImage();
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, randomProcessDefinition.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
+1
-19
@@ -18,7 +18,7 @@ import org.testng.annotations.Test;
|
||||
*/
|
||||
public class GetProcessDefinitionStartFormModelCoreTests extends RestTest
|
||||
{
|
||||
private UserModel adminUser, adminTenantUser;
|
||||
private UserModel adminUser;
|
||||
private RestProcessDefinitionModel randomProcessDefinition;
|
||||
private RestProcessDefinitionModelsCollection allProcessDefinitions;
|
||||
|
||||
@@ -77,22 +77,4 @@ public class GetProcessDefinitionStartFormModelCoreTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary("no deployed process definition found with id ''");
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Tenant User gets a model of the start form type definition for network deployments using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void networkUserGetsStartFormModel() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser)
|
||||
.usingTenant().createTenant(adminTenantUser);
|
||||
UserModel tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
randomProcessDefinition = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI()
|
||||
.usingProcessDefinitions(randomProcessDefinition).getProcessDefinitionStartFormModel()
|
||||
.assertThat().entriesListIsNotEmpty();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
-21
@@ -3,7 +3,6 @@ package org.alfresco.rest.workflow.processDefinitions;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestFormModelsCollection;
|
||||
import org.alfresco.rest.model.RestProcessDefinitionModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
@@ -69,24 +68,4 @@ public class GetProcessDefinitionStartFormModelFullTests extends RestTest
|
||||
.and().field("required").isNull()
|
||||
.and().field("allowedValues").isNull();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Tenant User doesn't get a model of the start form type definition for another network deployment using REST API")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void networkUserIsNotAbleToGetStartFormModelForAnotherNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
UserModel adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser1);
|
||||
restClient.usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
RestProcessDefinitionModel randomProcessDefinition = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI()
|
||||
.getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
restClient.authenticateUser(adminTenantUser2).withWorkflowAPI()
|
||||
.usingProcessDefinitions(randomProcessDefinition).getProcessDefinitionStartFormModel();
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, randomProcessDefinition.getId()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-15
@@ -15,14 +15,13 @@ import org.testng.annotations.Test;
|
||||
*/
|
||||
public class GetProcessDefinitionStartFormModelSanityTests extends RestTest
|
||||
{
|
||||
private UserModel adminUserModel, adminTenantUser;
|
||||
private UserModel adminUserModel;
|
||||
private RestProcessDefinitionModel randomProcessDefinition;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
adminUserModel = dataUser.getAdminUser();
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
}
|
||||
|
||||
@@ -36,17 +35,4 @@ public class GetProcessDefinitionStartFormModelSanityTests extends RestTest
|
||||
restClient.withWorkflowAPI().usingProcessDefinitions(randomProcessDefinition).getProcessDefinitionStartFormModel().assertThat().entriesListIsNotEmpty();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.SANITY,
|
||||
description = "Verify Tenant Admin gets a model of the start form type definition for network deployments using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.SANITY, TestGroup.NETWORKS })
|
||||
public void networkAdminGetsStartFormModel() throws Exception
|
||||
{
|
||||
restClient.usingTenant().createTenant(adminTenantUser);
|
||||
restClient.authenticateUser(adminTenantUser);
|
||||
randomProcessDefinition = restClient.withWorkflowAPI().getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
restClient.withWorkflowAPI().usingProcessDefinitions(randomProcessDefinition).getProcessDefinitionStartFormModel().assertThat().entriesListIsNotEmpty();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
-19
@@ -12,31 +12,12 @@ import org.testng.annotations.Test;
|
||||
|
||||
public class GetProcessDefinitionsCoreTests extends RestTest
|
||||
{
|
||||
private UserModel adminUserModel;
|
||||
private UserModel userModel;
|
||||
private UserModel adminTenantUser;
|
||||
private UserModel tenantUser;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
adminUserModel = dataUser.getAdminUser();
|
||||
userModel = dataUser.createRandomTestUser();
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify get process definitions using any network user for network enabled deployments with REST API status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void networkUserGetsProcessDefinitions() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
restClient.authenticateUser(tenantUser)
|
||||
.withWorkflowAPI()
|
||||
.getAllProcessDefinitions()
|
||||
.assertThat().entriesListIsNotEmpty();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION }, executionType = ExecutionType.REGRESSION,
|
||||
|
||||
-19
@@ -171,23 +171,4 @@ public class GetProcessDefinitionsFullTests extends RestTest
|
||||
.assertThat().entriesListContains("key", "activitiParallelGroupReview");
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify Tenant User doesn't get process definitions for another network deployment using REST API")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void networkUserIsNotAbleToGetProcessDefinitionsForAnotherNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
UserModel adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUserModel).usingTenant().createTenant(adminTenantUser1);
|
||||
restClient.usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
RestProcessDefinitionModel randomProcessDefinitionTenant1 = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI()
|
||||
.getAllProcessDefinitions().getOneRandomEntry().onModel();
|
||||
RestProcessDefinitionModelsCollection processDefinitionsTenant2 = restClient.authenticateUser(adminTenantUser2).withWorkflowAPI()
|
||||
.getAllProcessDefinitions();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
processDefinitionsTenant2.assertThat().entriesListDoesNotContain("id", randomProcessDefinitionTenant1.getId());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-13
@@ -15,13 +15,12 @@ import org.testng.annotations.Test;
|
||||
*/
|
||||
public class GetProcessDefinitionsSanityTests extends RestTest
|
||||
{
|
||||
private UserModel adminUserModel, adminTenantUser;
|
||||
private UserModel adminUserModel;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
adminUserModel = dataUser.getAdminUser();
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
}
|
||||
|
||||
@@ -46,15 +45,4 @@ public class GetProcessDefinitionsSanityTests extends RestTest
|
||||
.field("graphicNotationDefined").is("true").and()
|
||||
.field("key").is("activitiAdhoc");
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
|
||||
executionType = ExecutionType.SANITY, description = "Verify Tenant Admin user gets process definitions for network deployments using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.SANITY, TestGroup.NETWORKS})
|
||||
public void networkAdminGetsProcessDefinitions() throws Exception
|
||||
{
|
||||
restClient.usingTenant().createTenant(adminTenantUser);
|
||||
restClient.authenticateUser(adminTenantUser);
|
||||
restClient.withWorkflowAPI().getAllProcessDefinitions().assertThat().entriesListIsNotEmpty();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.core.JsonBodyGenerator;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestProcessDefinitionModel;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
@@ -33,50 +32,7 @@ public class AddProcessFullTests extends RestTest
|
||||
{
|
||||
assignee = dataUser.createRandomTestUser();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify network user cannot start new process with processDefinitionKey from another network using REST API and status code is 400")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void networkUserCannotStartNewProcessWithProcessDefinitionFromAnotherNetwork() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
UserModel adminTenant1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenant1);
|
||||
RestProcessDefinitionModel firstProcessDefTenant1 = restClient.authenticateUser(adminTenant1).withWorkflowAPI().getAllProcessDefinitions().getEntries().get(0).onModel();
|
||||
|
||||
UserModel adminTenant2 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenant2);
|
||||
UserModel assigneeTenant2 = dataUser.usingUser(adminTenant2).createUserWithTenant("assigneeT2");
|
||||
|
||||
String processDefinitionKey = firstProcessDefTenant1.getId().substring(0,firstProcessDefTenant1.getId().indexOf(":"));
|
||||
addedProcess = restClient.authenticateUser(adminTenant2).withWorkflowAPI().addProcess(processDefinitionKey, assigneeTenant2, false, Priority.Normal);
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError()
|
||||
.containsErrorKey(String.format(RestErrorModel.NO_WORKFLOW_DEFINITION_FOUND, processDefinitionKey))
|
||||
.containsSummary(String.format(RestErrorModel.NO_WORKFLOW_DEFINITION_FOUND, processDefinitionKey))
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify network user can start new process with processDefinitionKey from same network using REST API and status code is 201")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
public void networkUserCanStartNewProcessWithProcessDefinitionFromSameNetwork() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
UserModel adminTenant1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenant1);
|
||||
RestProcessDefinitionModel firstProcessDefTenant1 = restClient.authenticateUser(adminTenant1).withWorkflowAPI().getAllProcessDefinitions().getEntries().get(0).onModel();
|
||||
|
||||
UserModel processStarterTenant1 = dataUser.usingUser(adminTenant1).createUserWithTenant("startert1");
|
||||
UserModel assigneeTenant1 = dataUser.usingUser(adminTenant1).createUserWithTenant("assigneet1");
|
||||
|
||||
|
||||
String processDefinitionKey = firstProcessDefTenant1.getKey();
|
||||
addedProcess = restClient.authenticateUser(processStarterTenant1).withWorkflowAPI().addProcess(processDefinitionKey, assigneeTenant1, false, Priority.Normal);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
addedProcess.assertThat().field("processDefinitionId").is(firstProcessDefTenant1.getId())
|
||||
.and().field("startUserId").is(processStarterTenant1.getEmailAddress().toLowerCase())
|
||||
.and().field("processDefinitionKey").is(processDefinitionKey);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user cannot start new process with invalid processDefinitionKey using REST API and status code is 400")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION })
|
||||
|
||||
@@ -18,7 +18,6 @@ import org.testng.annotations.Test;
|
||||
public class AddProcessSanityTests extends RestTest
|
||||
{
|
||||
private UserModel userWhoStartsProcess, assignee;
|
||||
private UserModel adminTenantUser, tenantUserWhoStartsProcess, tenantAssignee;
|
||||
private RestProcessModel addedProcess;
|
||||
private RestProcessModelsCollection processes;
|
||||
|
||||
@@ -42,25 +41,4 @@ public class AddProcessSanityTests extends RestTest
|
||||
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.WORKFLOW,
|
||||
TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify network user is able to start new process using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY, TestGroup.NETWORKS })
|
||||
public void networkUserStartsNewProcess() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser())
|
||||
.usingTenant().createTenant(adminTenantUser);
|
||||
tenantUserWhoStartsProcess = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
tenantAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("u2Tenant");
|
||||
|
||||
addedProcess = restClient.authenticateUser(tenantUserWhoStartsProcess).withWorkflowAPI().addProcess("activitiAdhoc", tenantAssignee, false, Priority.Normal);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
addedProcess.assertThat().field("id").is(addedProcess.getId())
|
||||
.and().field("startUserId").is(addedProcess.getStartUserId());
|
||||
|
||||
processes = restClient.withWorkflowAPI().getProcesses();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
processes.assertThat().entriesListContains("id", addedProcess.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.apache.commons.lang.RandomStringUtils;
|
||||
@@ -16,12 +15,11 @@ import org.testng.annotations.Test;
|
||||
|
||||
public class GetProcessCoreTests extends RestTest
|
||||
{
|
||||
private UserModel userWhoStartsProcess, assignee, adminUser;
|
||||
private UserModel userWhoStartsProcess, assignee;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
adminUser = dataUser.getAdminUser();
|
||||
userWhoStartsProcess = dataUser.createRandomTestUser();
|
||||
assignee = dataUser.createRandomTestUser();
|
||||
}
|
||||
@@ -43,62 +41,4 @@ public class GetProcessCoreTests extends RestTest
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that tenant user cannot get process from another network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@Bug(id = "REPO-2092")
|
||||
public void tenantUserCannotGetProcessFromAnotherNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser1);
|
||||
|
||||
UserModel adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant1");
|
||||
UserModel tenantUser2 = dataUser.usingUser(adminTenantUser2).createUserWithTenant("uTenant2");
|
||||
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI().addProcess("activitiReview", tenantUser1, false, CMISUtil.Priority.High);
|
||||
|
||||
restClient.authenticateUser(tenantUser2).withWorkflowAPI().usingProcess(networkProcess1).getProcess();
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED)
|
||||
.assertLastError().containsErrorKey(RestErrorModel.API_DEFAULT_ERRORKEY)
|
||||
.containsSummary(RestErrorModel.AUTHENTICATION_FAILED);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that tenant user can get process from the same network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void tenantUserCanGetProcessFromTheSameNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser1);
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant1");
|
||||
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI().addProcess("activitiReview", tenantUser1, false, CMISUtil.Priority.High);
|
||||
|
||||
restClient.authenticateUser(tenantUser1).withWorkflowAPI().usingProcess(networkProcess1).getProcess();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
networkProcess1.assertThat().field("id").is(networkProcess1.getId())
|
||||
.and().field("startUserId").is(networkProcess1.getStartUserId());;
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that non network user cannot get process from a network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@Bug(id = "REPO-2092")
|
||||
public void nonNetworkUserCannotAccessNetworkProcess() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser1);
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant1");
|
||||
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI().addProcess("activitiReview", tenantUser1, false, CMISUtil.Priority.High);
|
||||
|
||||
restClient.authenticateUser(adminUser).withWorkflowAPI().usingProcess(networkProcess1).getProcess();
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED)
|
||||
.assertLastError().containsErrorKey(RestErrorModel.API_DEFAULT_ERRORKEY)
|
||||
.containsSummary(RestErrorModel.AUTHENTICATION_FAILED);
|
||||
}
|
||||
}
|
||||
@@ -29,28 +29,6 @@ public class GetProcessFullTests extends RestTest
|
||||
addedProcess = restClient.authenticateUser(userWhoStartsProcess).withWorkflowAPI().addProcess("activitiAdhoc", assignee, false, CMISUtil.Priority.High);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin user can get process started by a network user")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void adminUserCanGetProcessFromANetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser1);
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("utenant1");
|
||||
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser1).withWorkflowAPI().addProcess("activitiReview", adminTenantUser1, false, CMISUtil.Priority.High);
|
||||
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).withWorkflowAPI().usingProcess(networkProcess1).getProcess();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
networkProcess1.assertThat().field("processDefinitionId").contains(String.format("@%s%s", tenantUser1.getDomain().toLowerCase(), "@activitiReview:1"))
|
||||
.and().field("startUserId").is(tenantUser1.getEmailAddress().toLowerCase())
|
||||
.and().field("startActivityId").is("start")
|
||||
.and().field("startedAt").isNotEmpty()
|
||||
.and().field("id").is(networkProcess1.getId())
|
||||
.and().field("completed").is(false)
|
||||
.and().field("processDefinitionKey").is("activitiReview");
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user is able to get the process with properties parameter applied using REST API")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION })
|
||||
|
||||
@@ -3,7 +3,6 @@ package org.alfresco.rest.workflow.processes;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
@@ -29,7 +28,7 @@ public class GetProcessesCoreTests extends RestTest
|
||||
{
|
||||
private FileModel document;
|
||||
private SiteModel siteModel;
|
||||
private UserModel adminUser, userWhoStartsTask, assignee, adminTenantUser;
|
||||
private UserModel adminUser, userWhoStartsTask, assignee ;
|
||||
private TaskModel task1, task2;
|
||||
private ProcessModel process3;
|
||||
|
||||
@@ -46,23 +45,6 @@ public class GetProcessesCoreTests extends RestTest
|
||||
process3 = dataWorkflow.usingUser(userWhoStartsTask).usingSite(siteModel).usingResource(document).createSingleReviewerTaskAndAssignTo(assignee);
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify admin gets all processes from same network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getProcessFromSameNetworkUsingAdmin() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser);
|
||||
UserModel tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
UserModel tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
RestProcessModel process = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, Priority.Normal);
|
||||
|
||||
RestProcessModelsCollection tenantProcesses = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getProcesses();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
tenantProcesses.assertThat().entriesListContains("id", process.getId());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user gets all processes started by him ordered descending by id")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION })
|
||||
|
||||
@@ -3,7 +3,6 @@ package org.alfresco.rest.workflow.processes;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
@@ -47,23 +46,6 @@ public class GetProcessesFullTests extends RestTest
|
||||
process3 = dataWorkflow.usingUser(userWhoStartsTask).usingSite(siteModel).usingResource(document).createSingleReviewerTaskAndAssignTo(assignee);
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify any user cannot get processes from same network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getProcessFromSameNetworkUsingAnyUser() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser);
|
||||
UserModel tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
UserModel tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, Priority.Normal);
|
||||
|
||||
UserModel otherTenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("otherTenant");
|
||||
RestProcessModelsCollection tenantProcesses = restClient.authenticateUser(otherTenantUser).withWorkflowAPI().getProcesses();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
tenantProcesses.assertThat().entriesListIsEmpty().and().paginationField("count").is("0");
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user gets processes when skipCount parameter is applied")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION })
|
||||
|
||||
+1
-99
@@ -1,7 +1,6 @@
|
||||
package org.alfresco.rest.workflow.processes.items;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.core.RestRequest;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
@@ -25,7 +24,7 @@ public class AddProcessItemCoreTests extends RestTest
|
||||
{
|
||||
private FileModel document, document2;
|
||||
private SiteModel siteModel;
|
||||
private UserModel userWhoStartsProcess, assignee, adminUser, anotherUser, adminTenantUser, tenantUserAssignee, adminTenantUser2, tenantUser;
|
||||
private UserModel userWhoStartsProcess, assignee, adminUser, anotherUser;
|
||||
private RestProcessModel processModel;
|
||||
private RestItemModel processItem;
|
||||
private RestItemModelsCollection processItems;
|
||||
@@ -116,103 +115,6 @@ public class AddProcessItemCoreTests extends RestTest
|
||||
.containsSummary(String.format(RestErrorModel.ACCESS_INFORMATION_NOT_ALLOWED, processModel.getId()));
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add process item using by the admin in same network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void addProcessItemByAdminSameNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, Priority.Normal);
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
document = dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
processItem = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().usingProcess(processModel).addProcessItem(document);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
processItem.assertThat().field("createdAt").isNotEmpty().and().field("size").is("19").and().field("createdBy").is(adminTenantUser.getUsername().toLowerCase()).and()
|
||||
.field("modifiedAt").isNotEmpty().and().field("name").is(document.getName()).and().field("modifiedBy").is(adminTenantUser.getUsername().toLowerCase()).and()
|
||||
.field("id").isNotEmpty().and().field("mimeType").is(document.getFileType().mimeType);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add multiple process items using by the admin in same network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void addMultipleProcessItemsByAdminSameNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, Priority.Normal);
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
document = dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
document2 = dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
processItems = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().usingProcess(processModel).addProcessItems(document, document2);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
processItems.getEntries().get(0).onModel().assertThat()
|
||||
.field("createdAt").isNotEmpty().and()
|
||||
.field("size").is("19").and()
|
||||
.field("createdBy").is(adminTenantUser.getUsername().toLowerCase()).and()
|
||||
.field("modifiedAt").isNotEmpty().and()
|
||||
.field("name").is(document.getName()).and()
|
||||
.field("modifiedBy").is(adminTenantUser.getUsername().toLowerCase()).and()
|
||||
.field("id").isNotEmpty().and()
|
||||
.field("mimeType").is(document.getFileType().mimeType);
|
||||
processItems.getEntries().get(1).onModel().assertThat()
|
||||
.field("createdAt").isNotEmpty().and()
|
||||
.field("size").is("19").and()
|
||||
.field("createdBy").is(adminTenantUser.getUsername().toLowerCase()).and()
|
||||
.field("modifiedAt").isNotEmpty().and()
|
||||
.field("name").is(document2.getName()).and()
|
||||
.field("modifiedBy").is(adminTenantUser.getUsername().toLowerCase()).and()
|
||||
.field("id").isNotEmpty().and()
|
||||
.field("mimeType").is(document2.getFileType().mimeType);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add process item using by admin in other network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void addProcessItemByAdminInOtherNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
|
||||
adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
processModel = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, Priority.Normal);
|
||||
restClient.authenticateUser(adminTenantUser2);
|
||||
processItem = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document);
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError().containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add multiple process items using by admin in other network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void addMultipleProcessItemsByAdminInOtherNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
|
||||
adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
processModel = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, Priority.Normal);
|
||||
restClient.authenticateUser(adminTenantUser2);
|
||||
|
||||
processItems = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItems(document, document2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError()
|
||||
.containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Adding process item is falling in case of invalid process id is provided")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION })
|
||||
|
||||
+1
-55
@@ -1,6 +1,5 @@
|
||||
package org.alfresco.rest.workflow.processes.items;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.RestTest;
|
||||
@@ -23,7 +22,7 @@ public class DeleteProcessItemFullTests extends RestTest
|
||||
{
|
||||
private FileModel document, document2;
|
||||
private SiteModel siteModel;
|
||||
private UserModel userWhoStartsProcess, assignee, adminUser, anotherUser, adminTenantUser, tenantUser, tenantUserAssignee, adminTenantUser2;
|
||||
private UserModel userWhoStartsProcess, assignee, adminUser, anotherUser;
|
||||
private ProcessModel processModel;
|
||||
private RestItemModelsCollection items;
|
||||
private RestItemModel processItem;
|
||||
@@ -213,57 +212,4 @@ public class DeleteProcessItemFullTests extends RestTest
|
||||
restClient.authenticateUser(userWhoStartsProcess).withWorkflowAPI().usingProcess(processModel)
|
||||
.deleteProcessItem(items.getOneRandomEntry());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Delete process item using by the admin in same network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void deleteProcessItemByAdminSameNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, CMISUtil.Priority.Normal);
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
document = dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
processItem = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
restClient.authenticateUser(adminTenantUser).withWorkflowAPI().usingProcess(processModel)
|
||||
.deleteProcessItem(processItem);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
restClient.withWorkflowAPI().usingProcess(processModel).getProcessVariables()
|
||||
.assertThat().entriesListDoesNotContain("name", processItem.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Delete process item using by admin in other network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void deleteProcessItemByAdminInOtherNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
|
||||
adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, CMISUtil.Priority.Normal);
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
document = dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
processItem = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
restClient.authenticateUser(adminTenantUser2).withWorkflowAPI().usingProcess(processModel)
|
||||
.deleteProcessItem(processItem);
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError()
|
||||
.containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.containsErrorKey(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-55
@@ -23,7 +23,7 @@ public class GetProcessItemsFullTests extends RestTest
|
||||
{
|
||||
private FileModel document1, document2, document3;
|
||||
private SiteModel siteModel;
|
||||
private UserModel userWhoStartsTask, assignee, adminTenantUser, tenantUser, tenantUserAssignee;
|
||||
private UserModel userWhoStartsTask, assignee;
|
||||
private RestProcessModel processModel;
|
||||
private RestItemModelsCollection items;
|
||||
|
||||
@@ -38,60 +38,6 @@ public class GetProcessItemsFullTests extends RestTest
|
||||
document3 = dataContent.usingUser(userWhoStartsTask).usingSite(siteModel).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Get process items using admin from different network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getProcessItemsUsingAdminUserFromDifferentNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, CMISUtil.Priority.Normal);
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
document1 = dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document1);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
UserModel adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
restClient.authenticateUser(adminTenantUser2).withWorkflowAPI().usingProcess(processModel).getProcessItems();
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Get process items using admin from different network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getProcessItemsReturnsOnlyItemsInsideNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, CMISUtil.Priority.Normal);
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
document1 = dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document1);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
UserModel adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser2);
|
||||
RestProcessModel processModel2 = restClient.authenticateUser(adminTenantUser2).withWorkflowAPI().addProcess("activitiAdhoc", adminTenantUser2, false, CMISUtil.Priority.Normal);
|
||||
|
||||
SiteModel siteModel2 = dataSite.usingUser(adminTenantUser2).createPublicRandomSite();
|
||||
document2 = dataContent.usingUser(adminTenantUser2).usingSite(siteModel2).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
restClient.authenticateUser(adminTenantUser2).withWorkflowAPI().usingProcess(processModel2).addProcessItem(document2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
items = restClient.withWorkflowAPI().usingProcess(processModel2).getProcessItems();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
items.assertThat().entriesListDoesNotContain("name", document1.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Get process items for process without items")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION})
|
||||
|
||||
+1
-24
@@ -1,7 +1,6 @@
|
||||
package org.alfresco.rest.workflow.processes.items;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestItemModelsCollection;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
@@ -22,7 +21,7 @@ public class GetProcessItemsSanityTests extends RestTest
|
||||
{
|
||||
private FileModel document;
|
||||
private SiteModel siteModel;
|
||||
private UserModel userWhoStartsTask, assignee, adminTenantUser, tenantUser, tenantUserAssignee;
|
||||
private UserModel userWhoStartsTask, assignee;
|
||||
private RestProcessModel processModel;
|
||||
private RestItemModelsCollection items;
|
||||
|
||||
@@ -57,26 +56,4 @@ public class GetProcessItemsSanityTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
items.assertThat().entriesListIsNotEmpty();
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
description = "Get process items using admin from same network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY, TestGroup.NETWORKS })
|
||||
public void getProcessItemsUsingAdminUserFromSameNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, Priority.Normal);
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
document = dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
items = restClient.withWorkflowAPI().usingProcess(processModel).getProcessItems();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
items.assertThat().entriesListContains("name", document.getName());
|
||||
}
|
||||
}
|
||||
|
||||
+1
-43
@@ -3,7 +3,6 @@ package org.alfresco.rest.workflow.processes.tasks;
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.rest.model.RestTaskModel;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.GroupModel;
|
||||
@@ -21,14 +20,13 @@ public class GetProcessTasksCoreTests extends RestTest
|
||||
{
|
||||
private FileModel document, document1, document2;
|
||||
private SiteModel siteModel;
|
||||
private UserModel adminUser, userWhoStartsProcess, candidate, anotherAssignee, assignee;
|
||||
private UserModel userWhoStartsProcess, candidate, anotherAssignee, assignee;
|
||||
private ProcessModel process;
|
||||
private GroupModel group;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
adminUser = dataUser.getAdminUser();
|
||||
userWhoStartsProcess = dataUser.createRandomTestUser();
|
||||
candidate = dataUser.createRandomTestUser();
|
||||
anotherAssignee = dataUser.createRandomTestUser();
|
||||
@@ -57,46 +55,6 @@ public class GetProcessTasksCoreTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify getProcessTasks using admin from same network with REST API and status code is OK")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getProcessTasksWithAdminFromSameNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenant = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenant);
|
||||
SiteModel siteModel = dataSite.usingUser(adminTenant).createPublicRandomSite();
|
||||
UserModel tenantAssignee = dataUser.usingUser(adminTenant).createUserWithTenant("uTenant");
|
||||
dataContent.usingUser(adminTenant).usingSite(siteModel).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
|
||||
RestProcessModel processModel = restClient.authenticateUser(tenantAssignee).withWorkflowAPI().addProcess("activitiAdhoc", tenantAssignee, false, CMISUtil.Priority.Normal);
|
||||
|
||||
restClient.authenticateUser(adminTenant).withWorkflowAPI()
|
||||
.usingProcess(processModel).getProcessTasks().assertThat().entriesListIsNotEmpty();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify getProcessTasks using admin from different network with REST API and status code is FORBIDDEN (403)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getProcessTasksWithAdminFromDifferentNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenant, secondAdminTenant, tenantAssignee;
|
||||
adminTenant = UserModel.getAdminTenantUser();
|
||||
secondAdminTenant = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenant);
|
||||
|
||||
SiteModel siteModel = dataSite.usingUser(adminTenant).createPublicRandomSite();
|
||||
dataContent.usingUser(adminTenant).usingSite(siteModel).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
tenantAssignee = dataUser.usingUser(adminTenant).createUserWithTenant("uTenant");
|
||||
RestProcessModel processModel = restClient.authenticateUser(adminTenant).withWorkflowAPI().addProcess("activitiAdhoc", tenantAssignee, false, CMISUtil.Priority.Normal);
|
||||
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(secondAdminTenant);
|
||||
restClient.authenticateUser(secondAdminTenant).withWorkflowAPI()
|
||||
.usingProcess(processModel).getProcessTasks().assertThat().entriesListIsEmpty();
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "getProcessTasks for invalid processId with REST API and status code is NOT_FOUND (404)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION })
|
||||
|
||||
+1
-23
@@ -23,7 +23,7 @@ public class AddProcessVariableCoreTests extends RestTest
|
||||
{
|
||||
private FileModel document;
|
||||
private SiteModel siteModel;
|
||||
private UserModel userWhoStartsProcess, assignee, adminUser, anotherUser, adminTenantUser, adminTenantUser2, tenantUserAssignee;
|
||||
private UserModel userWhoStartsProcess, assignee, adminUser, anotherUser;
|
||||
private RestProcessModel processModel;
|
||||
private RestProcessVariableModel variableModel, processVariable;
|
||||
|
||||
@@ -185,26 +185,4 @@ public class AddProcessVariableCoreTests extends RestTest
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add process variable using by admin in other network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void addProcessVariableByAdminInOtherNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
|
||||
adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
processModel = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, Priority.Normal);
|
||||
|
||||
restClient.authenticateUser(adminTenantUser2);
|
||||
variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processVariable = restClient.withWorkflowAPI().usingProcess(processModel).updateProcessVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError()
|
||||
.containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-23
@@ -1,7 +1,6 @@
|
||||
package org.alfresco.rest.workflow.processes.variables;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
@@ -24,7 +23,7 @@ public class AddProcessVariableSanityTests extends RestTest
|
||||
{
|
||||
private FileModel document;
|
||||
private SiteModel siteModel;
|
||||
private UserModel userWhoStartsTask, assignee, adminUser, adminTenantUser, tenantUser, tenantUserAssignee;
|
||||
private UserModel userWhoStartsTask, assignee, adminUser;
|
||||
private RestProcessModel processModel;
|
||||
private RestProcessVariableModel variableModel, processVariable;
|
||||
|
||||
@@ -77,27 +76,6 @@ public class AddProcessVariableSanityTests extends RestTest
|
||||
processVariable.assertThat().field("value").is(newValue);
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
description = "Add process variable using admin user from same network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY, TestGroup.NETWORKS })
|
||||
public void addProcessVariableByAdmin() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, Priority.Normal);
|
||||
variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processModel = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getProcesses().getOneRandomEntry().onModel();
|
||||
|
||||
processVariable = restClient.withWorkflowAPI().usingProcess(processModel).updateProcessVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
processVariable.assertThat().field("name").is(variableModel.getName())
|
||||
.and().field("type").is(variableModel.getType())
|
||||
.and().field("value").is(variableModel.getValue());
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
description = "Adding process variable is falling in case invalid variableBody is provided")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY })
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@ import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.rest.model.RestProcessVariableCollection;
|
||||
import org.alfresco.rest.model.RestProcessVariableModel;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
@@ -23,7 +22,7 @@ public class AddProcessVariablesCoreTests extends RestTest
|
||||
private UserModel userWhoStartsProcess, assignee;
|
||||
private RestProcessModel processModel;
|
||||
private RestProcessVariableModel variableModel, processVariable, variableModel1;
|
||||
private RestProcessVariableCollection processVariableCollection;
|
||||
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
|
||||
+1
-62
@@ -25,7 +25,7 @@ public class AddProcessVariablesFullTests extends RestTest
|
||||
{
|
||||
private FileModel document;
|
||||
private SiteModel siteModel;
|
||||
private UserModel userWhoStartsProcess, assignee, adminUser, adminTenantUser, adminTenantUser2, tenantUser, tenantUserAssignee;
|
||||
private UserModel userWhoStartsProcess, assignee, adminUser;
|
||||
private ProcessModel processModel;
|
||||
private RestProcessModel restProcessModel;
|
||||
private RestProcessVariableModel variableModel, processVariable, variableModel1, variableModel2, variableModel3;
|
||||
@@ -392,65 +392,4 @@ public class AddProcessVariablesFullTests extends RestTest
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.WORKFLOW, TestGroup.PROCESSES}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add process variables using by Admin in other network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void addProcessVariablesByAdminInOtherNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
|
||||
adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
dataWorkflow.usingUser(tenantUser).usingSite(siteModel).usingResource(document)
|
||||
.createNewTaskAndAssignTo(tenantUserAssignee);
|
||||
|
||||
variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, Priority.Normal);
|
||||
processVariable = restClient.authenticateUser(adminTenantUser2).withWorkflowAPI().usingProcess(processModel)
|
||||
.addProcessVariable(variableModel);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError()
|
||||
.containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.containsErrorKey(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.WORKFLOW,TestGroup.PROCESSES}, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add multiple process variables using by Admin in other network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void addMultipleProcessVariablesByAdminInOtherNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
|
||||
adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
dataWorkflow.usingUser(tenantUser).usingSite(siteModel).usingResource(document)
|
||||
.createNewTaskAndAssignTo(tenantUserAssignee);
|
||||
|
||||
variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
variableModel1 = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, Priority.Normal);
|
||||
restClient.authenticateUser(adminTenantUser2).withWorkflowAPI().usingProcess(processModel)
|
||||
.addProcessVariables(variableModel, variableModel1);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError()
|
||||
.containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.containsErrorKey(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-55
@@ -1,7 +1,6 @@
|
||||
package org.alfresco.rest.workflow.processes.variables;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.rest.model.RestProcessVariableCollection;
|
||||
@@ -21,7 +20,7 @@ public class AddProcessVariablesSanityTests extends RestTest
|
||||
{
|
||||
private FileModel document;
|
||||
private SiteModel siteModel;
|
||||
private UserModel userWhoStartsProcess, assignee, adminUser, adminTenantUser, tenantUserAssignee, tenantUser;
|
||||
private UserModel userWhoStartsProcess, assignee, adminUser;
|
||||
private RestProcessModel processModel;
|
||||
private RestProcessVariableModel variableModel, variableModel1, variableModel2, processVariable;
|
||||
private RestProcessVariableCollection processVariableCollection;
|
||||
@@ -156,57 +155,4 @@ public class AddProcessVariablesSanityTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
||||
.assertLastError().containsSummary("Unsupported type of variable: 'incorrect type'.");
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
description = "Add process variables using admin user from same network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY, TestGroup.NETWORKS })
|
||||
public void addProcessVariableByAdminSameNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, Priority.Normal);
|
||||
variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processModel = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getProcesses().getOneRandomEntry().onModel();
|
||||
|
||||
processVariable = restClient.withWorkflowAPI().usingProcess(processModel).addProcessVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
processVariable.assertThat().field("name").is(variableModel.getName())
|
||||
.and().field("type").is(variableModel.getType())
|
||||
.and().field("value").is(variableModel.getValue());
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
description = "Add multiple process variables using admin user from same network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY, TestGroup.NETWORKS })
|
||||
public void addMultipleProcessVariablesByAdminSameNetwork() throws Exception
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, Priority.Normal);
|
||||
variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
variableModel1 = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processModel = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getProcesses().getOneRandomEntry().onModel();
|
||||
|
||||
processVariableCollection = restClient.withWorkflowAPI().usingProcess(processModel).addProcessVariables(variableModel, variableModel1);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
processVariableCollection.assertThat().entriesListContains("name", variableModel.getName())
|
||||
.assertThat().entriesListContains("name", variableModel1.getName());
|
||||
|
||||
processVariableCollection.getEntries().get(0).onModel().assertThat()
|
||||
.field("name").is(variableModel.getName()).and()
|
||||
.field("value").is(variableModel.getValue()).and()
|
||||
.field("type").is(variableModel.getType());
|
||||
processVariableCollection.getEntries().get(1).onModel().assertThat()
|
||||
.field("name").is(variableModel1.getName()).and()
|
||||
.field("value").is(variableModel1.getValue()).and()
|
||||
.field("type").is(variableModel1.getType());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-59
@@ -21,15 +21,13 @@ public class DeleteProcessVariableFullTests extends RestTest
|
||||
{
|
||||
private FileModel document;
|
||||
private SiteModel siteModel;
|
||||
private UserModel userWhoStartsTask, assignee, adminUser;
|
||||
private UserModel userWhoStartsTask, assignee;
|
||||
private RestProcessModel restProcessModel;
|
||||
private ProcessModel processModel;
|
||||
private RestProcessVariableModel variableModel, updatedVariable;
|
||||
|
||||
private RestProcessVariableModel variableModel;
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
adminUser = dataUser.getAdminUser();
|
||||
userWhoStartsTask = dataUser.createRandomTestUser();
|
||||
assignee = dataUser.createRandomTestUser();
|
||||
siteModel = dataSite.usingUser(userWhoStartsTask).createPublicRandomSite();
|
||||
@@ -195,59 +193,4 @@ public class DeleteProcessVariableFullTests extends RestTest
|
||||
.containsErrorKey(RestErrorModel.API_DEFAULT_ERRORKEY)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES, TestGroup.NETWORKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from the same network is able to delete network process variables")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void deleteProcessVariablesWithAdminFromSameNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser1);
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant1");
|
||||
|
||||
RestProcessModel processModel = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI()
|
||||
.addProcess("activitiAdhoc", tenantUser1, false, Priority.Normal);
|
||||
variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser1).withWorkflowAPI()
|
||||
.getProcesses().getProcessModelByProcessDefId(processModel.getId());
|
||||
restClient.withWorkflowAPI().usingProcess(networkProcess1).addProcessVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
restClient.authenticateUser(adminTenantUser1).withWorkflowAPI().usingProcess(networkProcess1)
|
||||
.deleteProcessVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
restClient.withWorkflowAPI().usingProcess(networkProcess1).getProcessVariables()
|
||||
.assertThat()
|
||||
.entriesListDoesNotContain("name", variableModel.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES, TestGroup.NETWORKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from different network is not able to delete network process variables")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void deleteProcessVariablesWithAdminFromDifferentNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser1);
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant1");
|
||||
|
||||
RestProcessModel processModel = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI()
|
||||
.addProcess("activitiAdhoc", tenantUser1, false, Priority.Normal);
|
||||
variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser1).withWorkflowAPI()
|
||||
.getProcesses().getProcessModelByProcessDefId(processModel.getId());
|
||||
restClient.withWorkflowAPI().usingProcess(networkProcess1).addProcessVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
restClient.authenticateUser(adminUser).withWorkflowAPI().usingProcess(networkProcess1)
|
||||
.deleteProcessVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN);
|
||||
restClient.assertLastError().containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.containsErrorKey(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
|
||||
restClient.authenticateUser(tenantUser1).withWorkflowAPI().usingProcess(networkProcess1).getProcessVariables().assertThat()
|
||||
.entriesListContains("name", variableModel.getName());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-34
@@ -1,6 +1,5 @@
|
||||
package org.alfresco.rest.workflow.processes.variables;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.RestTest;
|
||||
@@ -27,6 +26,7 @@ public class GetProcessVariablesCoreTests extends RestTest
|
||||
private RestProcessModel processModel;
|
||||
private RestProcessVariableCollection variables;
|
||||
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
@@ -38,39 +38,6 @@ public class GetProcessVariablesCoreTests extends RestTest
|
||||
dataWorkflow.usingUser(userWhoStartsTask).usingSite(siteModel).usingResource(document).createNewTaskAndAssignTo(assignee);
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API,TestGroup.WORKFLOW, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from the same network is able to retrieve network process variables")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getProcessVariablesWithAdminFromSameNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(admin).usingTenant().createTenant(adminTenantUser1);
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant1");
|
||||
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser1).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser1, false, CMISUtil.Priority.High);
|
||||
|
||||
variables = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI().usingProcess(networkProcess1).getProcessVariables();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
variables.assertThat().entriesListIsNotEmpty();
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from different network is not able to retrieve network process variables")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getProcessVariablesWithAdminFromDifferentNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(admin).usingTenant().createTenant(adminTenantUser1);
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant1");
|
||||
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser1, false, CMISUtil.Priority.High);
|
||||
|
||||
variables = restClient.authenticateUser(admin).withWorkflowAPI().usingProcess(networkProcess1).getProcessVariables();
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError().containsSummary(RestErrorModel.PROCESS_RUNNING_IN_ANOTHER_TENANT);
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Get process variables using invalid process ID")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION })
|
||||
|
||||
@@ -253,27 +253,4 @@ public class GetTaskFormModelTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError()
|
||||
.containsSummary(String.format(RestErrorModel.INVALID_MAXITEMS, "A"));
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS },
|
||||
executionType = ExecutionType.REGRESSION, description = "Verify network admin user gets all task form models inside his network with Rest API and response is successful (200)")
|
||||
public void networkAdminGetsTaskFormModels() throws Exception
|
||||
{
|
||||
taskModel = dataWorkflow.usingUser(userModel).usingSite(siteModel).usingResource(fileModel).createNewTaskAndAssignTo(userModel);
|
||||
UserModel adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser);
|
||||
UserModel tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant1");
|
||||
|
||||
RestProcessModel networkProcess = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser, false, CMISUtil.Priority.High);
|
||||
RestTaskModel networkTask = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
|
||||
.usingProcess(networkProcess).getProcessTasks().getOneRandomEntry().onModel();
|
||||
|
||||
restClient.authenticateUser(adminUser).withWorkflowAPI().usingTask(networkTask).getTaskFormModel();
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError().containsSummary(RestErrorModel.PERMISSION_WAS_DENIED);
|
||||
|
||||
returnedCollection = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().usingTask(networkTask).getTaskFormModel();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
returnedCollection.assertThat().entriesListIsNotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
package org.alfresco.rest.workflow.tasks;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.core.RestRequest;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.rest.model.RestTaskModel;
|
||||
import org.alfresco.rest.model.RestTaskModelsCollection;
|
||||
import org.alfresco.utility.model.*;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.GroupModel;
|
||||
import org.alfresco.utility.model.ProcessModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TaskModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
@@ -182,41 +186,6 @@ public class GetTaskTests extends RestTest
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS },
|
||||
executionType = ExecutionType.REGRESSION, description = "Check that for admin network gets task only from its network.")
|
||||
public void adminTenantGetsTaskOnlyFromItsNetwork() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUser);
|
||||
|
||||
UserModel adminTenant1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenant1);
|
||||
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenant1).createUserWithTenant("userTenant1");
|
||||
UserModel tenantUserAssignee1 = dataUser.usingUser(adminTenant1).createUserWithTenant("userTenantAssignee1");
|
||||
|
||||
RestProcessModel processOnTenant1 = restClient.authenticateUser(tenantUser1).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee1, false, Priority.Low);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
UserModel adminTenant2 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenant2);
|
||||
|
||||
UserModel tenantUser2 = dataUser.usingUser(adminTenant2).createUserWithTenant("userTenant2");
|
||||
UserModel tenantUserAssignee2 = dataUser.usingUser(adminTenant2).createUserWithTenant("userTenantAssignee2");
|
||||
|
||||
RestProcessModel processOnTenant2 = restClient.authenticateUser(tenantUser2).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee2, false, Priority.Normal);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
RestTaskModelsCollection tenantTasks2 = restClient.authenticateUser(tenantUser2).withWorkflowAPI().getTasks();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
tenantTasks2.assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListCountIs(1)
|
||||
.and().entriesListContains("assignee", String.format("userTenantAssignee2@%s", tenantUserAssignee2.getDomain().toLowerCase()))
|
||||
.and().entriesListContains("processId", processOnTenant2.getId())
|
||||
.and().entriesListDoesNotContain("assignee", String.format("userTenantAssignee1@%s", tenantUserAssignee1.getDomain().toLowerCase()))
|
||||
.and().entriesListDoesNotContain("processId", processOnTenant1.getId());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,
|
||||
TestGroup.TASKS }, executionType = ExecutionType.REGRESSION, description = "Verify if using invalid taskId status code 404 is returned.")
|
||||
@@ -240,27 +209,4 @@ public class GetTaskTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
taskModels.assertThat().entriesListIsNotEmpty();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,
|
||||
TestGroup.TASKS }, executionType = ExecutionType.REGRESSION, description = "Verify that in a network only tasks inside network are returned.")
|
||||
@Test(groups = {TestGroup.NETWORKS,TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION })
|
||||
public void tasksInsideNetworkReturned() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUser);
|
||||
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.usingTenant().createTenant(adminTenantUser);
|
||||
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("userTenant");
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("userTenantAssignee");
|
||||
|
||||
RestProcessModel addedProcess = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false,
|
||||
Priority.Normal);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
taskModel = restClient.withWorkflowAPI().getTasks().getTaskModelByProcess(addedProcess);
|
||||
tenantTask = restClient.authenticateUser(tenantUserAssignee).withWorkflowAPI().usingTask(taskModel).getTask();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
tenantTask.assertThat().field("assignee").is(String.format("userTenantAssignee@%s", tenantUserAssignee.getDomain().toLowerCase())).and()
|
||||
.field("processId").is(addedProcess.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,10 +4,14 @@ import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.rest.model.RestTaskModel;
|
||||
import org.alfresco.rest.model.RestTaskModelsCollection;
|
||||
import org.alfresco.utility.model.*;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.GroupModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TaskModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
@@ -175,48 +179,6 @@ public class GetTasksTests extends RestTest
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS },
|
||||
executionType = ExecutionType.REGRESSION, description = "Check that for admin network gets tasks only from its network.")
|
||||
public void adminTenantGetsTasksOnlyFromItsNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenant1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenant1);
|
||||
|
||||
UserModel adminTenant2 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenant2);
|
||||
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenant1).createUserWithTenant("userTenant1");
|
||||
UserModel tenantUserAssignee1 = dataUser.usingUser(adminTenant1).createUserWithTenant("userTenantAssignee1");
|
||||
|
||||
UserModel tenantUser2 = dataUser.usingUser(adminTenant2).createUserWithTenant("userTenant2");
|
||||
UserModel tenantUserAssignee2 = dataUser.usingUser(adminTenant2).createUserWithTenant("userTenantAssignee2");
|
||||
|
||||
RestProcessModel processOnTenant1 = restClient.authenticateUser(tenantUser1).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee1, false, Priority.Low);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
RestProcessModel processOnTenant2 = restClient.authenticateUser(tenantUser2).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee2, false, Priority.Normal);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
RestTaskModelsCollection tenantTasks1 = restClient.authenticateUser(adminTenant1).withWorkflowAPI().getTasks();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
tenantTasks1.assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListCountIs(1)
|
||||
.and().entriesListContains("assignee", String.format("userTenantAssignee1@%s", tenantUserAssignee1.getDomain().toLowerCase()))
|
||||
.and().entriesListContains("processId", processOnTenant1.getId())
|
||||
.and().entriesListDoesNotContain("assignee", String.format("userTenantAssignee2@%s", tenantUserAssignee2.getDomain().toLowerCase()))
|
||||
.and().entriesListDoesNotContain("processId", processOnTenant2.getId());
|
||||
|
||||
RestTaskModelsCollection tenantTasks2 = restClient.authenticateUser(adminTenant2).withWorkflowAPI().getTasks();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
tenantTasks2.assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListCountIs(1)
|
||||
.and().entriesListContains("assignee", String.format("userTenantAssignee2@%s", tenantUserAssignee2.getDomain().toLowerCase()))
|
||||
.and().entriesListContains("processId", processOnTenant2.getId())
|
||||
.and().entriesListDoesNotContain("assignee", String.format("userTenantAssignee1@%s", tenantUserAssignee1.getDomain().toLowerCase()))
|
||||
.and().entriesListDoesNotContain("processId", processOnTenant1.getId());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,
|
||||
TestGroup.TASKS }, executionType = ExecutionType.REGRESSION, description = "Verify the request in case of any user which is not involved.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION })
|
||||
@@ -269,26 +231,4 @@ public class GetTasksTests extends RestTest
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).withParams("orderBy=invalidParameter").withWorkflowAPI().getTasks();
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError().containsSummary("invalidParameter is not supported");
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,
|
||||
TestGroup.TASKS }, executionType = ExecutionType.REGRESSION, description = "Check that for network enabled only that network tasks are returned.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.REGRESSION })
|
||||
public void networkEnabledTasksReturned() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUser);
|
||||
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.usingTenant().createTenant(adminTenantUser);
|
||||
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("userTenant");
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("userTenantAssignee");
|
||||
|
||||
restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, Priority.Normal);
|
||||
|
||||
tenantTask = restClient.authenticateUser(tenantUserAssignee).withWorkflowAPI().getTasks();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
tenantTask.assertThat().entriesListIsNotEmpty().and().entriesListCountIs(1).and().entriesListContains("assignee",
|
||||
String.format("userTenantAssignee@%s", tenantUserAssignee.getDomain().toLowerCase()));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,16 +2,23 @@ package org.alfresco.rest.workflow.tasks;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.json.JsonObject;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.core.JsonBodyGenerator;
|
||||
import org.alfresco.rest.core.RestRequest;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestProcessDefinitionModel;
|
||||
import org.alfresco.rest.model.RestTaskModel;
|
||||
import org.alfresco.rest.model.RestVariableModelsCollection;
|
||||
import org.alfresco.utility.model.*;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.GroupModel;
|
||||
import org.alfresco.utility.model.ProcessModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TaskModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
@@ -21,8 +28,6 @@ import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.BeforeMethod;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import javax.json.JsonObject;
|
||||
|
||||
public class UpdateTaskTests extends RestTest
|
||||
{
|
||||
UserModel owner, anyUser;
|
||||
@@ -648,93 +653,6 @@ public class UpdateTaskTests extends RestTest
|
||||
restTaskModel.assertThat().field("id").is(taskModel.getId()).and().field("state").is("completed");
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant user that created the task can update task only in its network and response is 200, for other networks is 403")
|
||||
public void ownerTenantCanUpdatedTaskOnlyInItsNetwork() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUser);
|
||||
|
||||
UserModel adminTenant1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenant1);
|
||||
|
||||
UserModel ownerTenant1 = dataUser.usingUser(adminTenant1).createUserWithTenant("ownerTenant1");
|
||||
UserModel assigneeTenant1 = dataUser.usingUser(adminTenant1).createUserWithTenant("assigneeTenant1");
|
||||
SiteModel siteModel1 = dataSite.usingUser(ownerTenant1).createPublicRandomSite();
|
||||
FileModel fileModel1 = dataContent.usingUser(ownerTenant1).usingSite(siteModel1).createContent(DocumentType.TEXT_PLAIN);
|
||||
RestProcessDefinitionModel def1 = restClient.authenticateUser(ownerTenant1).withWorkflowAPI().getAllProcessDefinitions().getEntries().get(0).onModel();
|
||||
TaskModel taskModel1 = dataWorkflow.usingUser(ownerTenant1).usingSite(siteModel1).usingResource(fileModel1)
|
||||
.createTaskWithProcessDefAndAssignTo(def1.getId(), assigneeTenant1);
|
||||
|
||||
UserModel adminTenant2 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenant2);
|
||||
|
||||
UserModel ownerTenant2 = dataUser.usingUser(adminTenant2).createUserWithTenant("ownerTenant2");
|
||||
UserModel assigneeTenant2 = dataUser.usingUser(adminTenant2).createUserWithTenant("userTenantAssignee2");
|
||||
SiteModel siteModel2 = dataSite.usingUser(ownerTenant2).createPublicRandomSite();
|
||||
FileModel fileModel2 = dataContent.usingUser(ownerTenant2).usingSite(siteModel2).createContent(DocumentType.TEXT_PLAIN);
|
||||
RestProcessDefinitionModel def2 = restClient.authenticateUser(ownerTenant2).withWorkflowAPI().getAllProcessDefinitions().getEntries().get(0).onModel();
|
||||
TaskModel taskModel2 = dataWorkflow.usingUser(ownerTenant2).usingSite(siteModel2).usingResource(fileModel2)
|
||||
.createTaskWithProcessDefAndAssignTo(def2.getId(), assigneeTenant2);
|
||||
|
||||
restTaskModel = restClient.authenticateUser(ownerTenant2).withParams("select=state").withWorkflowAPI().usingTask(taskModel2).updateTask("completed");
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restTaskModel.assertThat().field("id").is(taskModel2.getId())
|
||||
.and().field("state").is("completed");
|
||||
|
||||
restTaskModel = restClient.authenticateUser(ownerTenant2).withParams("select=state").withWorkflowAPI().usingTask(taskModel1).updateTask("completed");
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError()
|
||||
.containsErrorKey(RestErrorModel.PERMISSION_DENIED_ERRORKEY)
|
||||
.containsSummary(RestErrorModel.PERMISSION_WAS_DENIED)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
|
||||
}
|
||||
|
||||
@Bug(id = "REPO-1980")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify tenant admin can update only task from its network and response is 200")
|
||||
public void adminTenantCanUpdateOnlyTaskInItsNetwork() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUser);
|
||||
|
||||
UserModel adminTenant1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenant1);
|
||||
|
||||
UserModel ownerTenant1 = dataUser.usingUser(adminTenant1).createUserWithTenant("ownerTenant1");
|
||||
UserModel assigneeTenant1 = dataUser.usingUser(adminTenant1).createUserWithTenant("assigneeTenant1");
|
||||
SiteModel siteModel1 = dataSite.usingUser(ownerTenant1).createPublicRandomSite();
|
||||
FileModel fileModel1 = dataContent.usingUser(ownerTenant1).usingSite(siteModel1).createContent(DocumentType.TEXT_PLAIN);
|
||||
RestProcessDefinitionModel def1 = restClient.authenticateUser(ownerTenant1).withWorkflowAPI().getAllProcessDefinitions().getEntries().get(0).onModel();
|
||||
TaskModel taskModel1 = dataWorkflow.usingUser(ownerTenant1).usingSite(siteModel1).usingResource(fileModel1)
|
||||
.createTaskWithProcessDefAndAssignTo(def1.getId(), assigneeTenant1);
|
||||
|
||||
UserModel adminTenant2 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenant2);
|
||||
|
||||
UserModel ownerTenant2 = dataUser.usingUser(adminTenant2).createUserWithTenant("ownerTenant2");
|
||||
UserModel assigneeTenant2 = dataUser.usingUser(adminTenant2).createUserWithTenant("userTenantAssignee2");
|
||||
SiteModel siteModel2 = dataSite.usingUser(ownerTenant2).createPublicRandomSite();
|
||||
FileModel fileModel2 = dataContent.usingUser(ownerTenant2).usingSite(siteModel2).createContent(DocumentType.TEXT_PLAIN);
|
||||
RestProcessDefinitionModel def2 = restClient.authenticateUser(ownerTenant2).withWorkflowAPI().getAllProcessDefinitions().getEntries().get(0).onModel();
|
||||
TaskModel taskModel2 = dataWorkflow.usingUser(ownerTenant2).usingSite(siteModel2).usingResource(fileModel2)
|
||||
.createTaskWithProcessDefAndAssignTo(def2.getId(), assigneeTenant2);
|
||||
|
||||
restTaskModel = restClient.authenticateUser(adminTenant2).withParams("select=state").withWorkflowAPI().usingTask(taskModel2).updateTask("completed");
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restTaskModel.assertThat().field("id").is(taskModel2.getId())
|
||||
.and().field("state").is("completed");
|
||||
|
||||
restTaskModel = restClient.authenticateUser(adminTenant2).withParams("select=state").withWorkflowAPI().usingTask(taskModel1).updateTask("completed");
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError()
|
||||
.containsErrorKey(RestErrorModel.PERMISSION_DENIED_ERRORKEY)
|
||||
.containsSummary(RestErrorModel.PERMISSION_WAS_DENIED)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify owner cannot update task from status completed to delegated and response is 404")
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
package org.alfresco.rest.workflow.tasks.items;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestItemModel;
|
||||
import org.alfresco.rest.model.RestItemModelsCollection;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.rest.model.RestTaskModel;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TaskModel;
|
||||
@@ -25,7 +21,7 @@ public class AddTaskItemTestsBulk1 extends RestTest
|
||||
{
|
||||
private UserModel userModel, userWhoStartsTask, assigneeUser;
|
||||
private SiteModel siteModel;
|
||||
private FileModel fileModel, document2, document3, document4;
|
||||
private FileModel fileModel, document2, document3;
|
||||
private TaskModel taskModel;
|
||||
private RestItemModelsCollection taskItems;
|
||||
private RestItemModel taskItem;
|
||||
@@ -159,77 +155,4 @@ public class AddTaskItemTestsBulk1 extends RestTest
|
||||
taskItems = restClient.withWorkflowAPI().usingTask(taskModel).addTaskItems(document3, document2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.NETWORKS,TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add task item using admin user from same network")
|
||||
public void addTaskItemByAdminSameNetwork() throws Exception
|
||||
{
|
||||
UserModel adminUser = dataUser.getAdminUser();
|
||||
restClient.authenticateUser(adminUser);
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser1);
|
||||
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant");
|
||||
UserModel tenantUserAssignee1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenantAssignee");
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser1).createPublicRandomSite();
|
||||
document4 = dataContent.usingUser(adminTenantUser1).usingSite(siteModel).createContent(DocumentType.XML);
|
||||
RestProcessModel addedProcess = restClient.authenticateUser(tenantUser1).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee1, false, Priority.Normal);
|
||||
RestTaskModel addedTask = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI().getTasks().getTaskModelByProcess(addedProcess);
|
||||
|
||||
taskItem = restClient.withWorkflowAPI().usingTask(addedTask).addTaskItem(document4);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
taskItem.assertThat().field("createdAt").is(taskItem.getCreatedAt())
|
||||
.and().field("size").is(taskItem.getSize())
|
||||
.and().field("createdBy").is(taskItem.getCreatedBy())
|
||||
.and().field("modifiedAt").is(taskItem.getModifiedAt())
|
||||
.and().field("name").is(taskItem.getName())
|
||||
.and().field("modifiedBy").is(taskItem.getModifiedBy())
|
||||
.and().field("id").is(taskItem.getId())
|
||||
.and().field("mimeType").is(taskItem.getMimeType());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.NETWORKS,TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add task item using admin user from same network")
|
||||
public void addMultipleTaskItemByAdminSameNetwork() throws Exception
|
||||
{
|
||||
UserModel adminUser = dataUser.getAdminUser();
|
||||
restClient.authenticateUser(adminUser);
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser1);
|
||||
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant");
|
||||
UserModel tenantUserAssignee1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenantAssignee");
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser1).createPublicRandomSite();
|
||||
document3 = dataContent.usingUser(adminTenantUser1).usingSite(siteModel).createContent(DocumentType.XML);
|
||||
document4 = dataContent.usingUser(adminTenantUser1).usingUser(adminTenantUser1).usingSite(siteModel).createContent(DocumentType.XML);
|
||||
RestProcessModel addedProcess = restClient.authenticateUser(tenantUser1).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee1, false, Priority.Normal);
|
||||
RestTaskModel addedTask = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI().getTasks().getTaskModelByProcess(addedProcess);
|
||||
|
||||
taskItems = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI().usingTask(addedTask)
|
||||
.addTaskItems(document4,document3);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
taskItems.getEntries().get(0).onModel()
|
||||
.assertThat().field("createdAt").is(taskItems.getEntries().get(0).onModel().getCreatedAt())
|
||||
.assertThat().field("size").is(taskItems.getEntries().get(0).onModel().getSize())
|
||||
.assertThat().field("createdBy").is(taskItems.getEntries().get(0).onModel().getCreatedBy())
|
||||
.assertThat().field("modifiedAt").is(taskItems.getEntries().get(0).onModel().getModifiedAt())
|
||||
.assertThat().field("name").is(taskItems.getEntries().get(0).onModel().getName())
|
||||
.assertThat().field("modifiedBy").is(taskItems.getEntries().get(0).onModel().getModifiedBy())
|
||||
.assertThat().field("id").is(taskItems.getEntries().get(0).onModel().getId())
|
||||
.assertThat().field("mimeType").is(taskItems.getEntries().get(0).onModel().getMimeType());
|
||||
|
||||
taskItems.getEntries().get(1).onModel()
|
||||
.assertThat().field("createdAt").is(taskItems.getEntries().get(1).onModel().getCreatedAt())
|
||||
.assertThat().field("size").is(taskItems.getEntries().get(1).onModel().getSize())
|
||||
.assertThat().field("createdBy").is(taskItems.getEntries().get(1).onModel().getCreatedBy())
|
||||
.assertThat().field("modifiedAt").is(taskItems.getEntries().get(1).onModel().getModifiedAt())
|
||||
.assertThat().field("name").is(taskItems.getEntries().get(1).onModel().getName())
|
||||
.assertThat().field("modifiedBy").is(taskItems.getEntries().get(1).onModel().getModifiedBy())
|
||||
.assertThat().field("id").is(taskItems.getEntries().get(1).onModel().getId());
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package org.alfresco.rest.workflow.tasks.items;
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.core.RestRequest;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestVariableModel;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
package org.alfresco.rest.workflow.tasks.items;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestItemModel;
|
||||
import org.alfresco.rest.model.RestItemModelsCollection;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.rest.model.RestTaskModel;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TaskModel;
|
||||
@@ -22,7 +17,7 @@ import org.testng.annotations.Test;
|
||||
|
||||
public class AddTaskItemTestsBulk3 extends RestTest
|
||||
{
|
||||
private UserModel userModel, adminUser,userWhoStartsTask, assigneeUser;
|
||||
private UserModel userModel,userWhoStartsTask, assigneeUser;
|
||||
private SiteModel siteModel;
|
||||
private FileModel fileModel, fileModel1, document1, document2,document3;
|
||||
private TaskModel taskModel;
|
||||
@@ -32,7 +27,6 @@ public class AddTaskItemTestsBulk3 extends RestTest
|
||||
@BeforeClass(alwaysRun=true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
adminUser = dataUser.getAdminUser();
|
||||
userModel = dataUser.createRandomTestUser();
|
||||
siteModel = dataSite.usingUser(userModel).createPublicRandomSite();
|
||||
fileModel = dataContent.usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
@@ -89,63 +83,7 @@ public class AddTaskItemTestsBulk3 extends RestTest
|
||||
.assertThat().field("id").is(taskItems.getEntries().get(1).onModel().getId())
|
||||
.assertThat().field("mimeType").is(taskItems.getEntries().get(1).onModel().getMimeType());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add task item using by admin in other network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void addTaskItemByAdminInOtherNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
UserModel adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser1);
|
||||
restClient.usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant");
|
||||
UserModel tenantUserAssignee1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenantAssignee");
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser1).createPublicRandomSite();
|
||||
fileModel = dataContent.usingUser(adminTenantUser1).usingSite(siteModel).createContent(DocumentType.XML);
|
||||
RestProcessModel addedProcess = restClient.authenticateUser(tenantUser1).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee1, false, Priority.Normal);
|
||||
RestTaskModel addedTask = restClient.withWorkflowAPI().getTasks().getTaskModelByProcess(addedProcess);
|
||||
restClient.authenticateUser(adminTenantUser2).withWorkflowAPI().usingTask(addedTask).addTaskItem(fileModel);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError()
|
||||
.containsSummary(RestErrorModel.PERMISSION_WAS_DENIED)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.containsErrorKey(RestErrorModel.PERMISSION_DENIED_ERRORKEY)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add multiple task item using by admin in other network.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void addMultipleTaskItemByAdminInOtherNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
UserModel adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser1);
|
||||
restClient.usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant");
|
||||
UserModel tenantUserAssignee1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenantAssignee");
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser1).createPublicRandomSite();
|
||||
document1 = dataContent.usingUser(adminTenantUser1).usingSite(siteModel).createContent(DocumentType.XML);
|
||||
document2 = dataContent.usingSite(siteModel).createContent(DocumentType.XML);
|
||||
|
||||
RestProcessModel addedProcess = restClient.authenticateUser(tenantUser1).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee1, false, Priority.Normal);
|
||||
RestTaskModel addedTask = restClient.withWorkflowAPI().getTasks().getTaskModelByProcess(addedProcess);
|
||||
restClient.authenticateUser(adminTenantUser2).withWorkflowAPI().usingTask(addedTask).addTaskItems(document1, document2);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError()
|
||||
.containsSummary(RestErrorModel.PERMISSION_WAS_DENIED)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.containsErrorKey(RestErrorModel.PERMISSION_DENIED_ERRORKEY)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);;
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Delete task item then create it again")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION})
|
||||
|
||||
+1
-65
@@ -25,7 +25,7 @@ import org.testng.annotations.Test;
|
||||
*/
|
||||
public class GetTaskItemsRegressionTests extends RestTest
|
||||
{
|
||||
private UserModel adminUser, userWhoStartsTask, assignee;
|
||||
private UserModel userWhoStartsTask, assignee;
|
||||
private SiteModel siteModel;
|
||||
private FileModel fileModel;
|
||||
private TaskModel taskModel;
|
||||
@@ -41,7 +41,6 @@ public class GetTaskItemsRegressionTests extends RestTest
|
||||
assignee = dataUser.createRandomTestUser();
|
||||
siteModel = dataSite.usingUser(userWhoStartsTask).createPublicRandomSite();
|
||||
fileModel = dataContent.usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
adminUser = dataUser.getAdminUser();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
@@ -97,69 +96,6 @@ public class GetTaskItemsRegressionTests extends RestTest
|
||||
itemModels.assertThat().entriesListIsNotEmpty().and().entriesListContains("name", fileModel.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify gets task items call with admin from different network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getTaskItemsByAdminFromAnotherNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
UserModel adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser1);
|
||||
restClient.usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant");
|
||||
UserModel tenantUserAssignee1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenantAssignee");
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser1).createPublicRandomSite();
|
||||
fileModel = dataContent.usingUser(adminTenantUser1).usingSite(siteModel).createContent(DocumentType.XML);
|
||||
addedProcess = restClient.authenticateUser(tenantUser1).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee1, false, Priority.Normal);
|
||||
addedTask = restClient.withWorkflowAPI().getTasks().getTaskModelByProcess(addedProcess);
|
||||
restClient.withWorkflowAPI().usingTask(addedTask).addTaskItem(fileModel);
|
||||
|
||||
restClient.authenticateUser(adminTenantUser2).withWorkflowAPI().usingTask(addedTask).getTaskItems();
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsSummary(RestErrorModel.PERMISSION_WAS_DENIED);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify gets task items call returns only task items inside network")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
public void getTaskItemsReturnsOnlyItemsFromThatNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
UserModel adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser1);
|
||||
restClient.usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant1");
|
||||
UserModel tenantUser2 = dataUser.usingUser(adminTenantUser2).createUserWithTenant("uTenant2");
|
||||
|
||||
SiteModel siteModel1 = dataSite.usingUser(adminTenantUser1).createPublicRandomSite();
|
||||
FileModel fileModel1 = dataContent.usingUser(adminTenantUser1).usingSite(siteModel1).createContent(DocumentType.XML);
|
||||
|
||||
RestProcessModel addedProcess1 = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI().addProcess("activitiAdhoc", tenantUser1, false, Priority.Normal);
|
||||
RestTaskModel addedTask1 = restClient.withWorkflowAPI().getTasks().getTaskModelByProcess(addedProcess1);
|
||||
RestItemModel taskItem1 = restClient.withWorkflowAPI().usingTask(addedTask1).addTaskItem(fileModel1);
|
||||
|
||||
SiteModel siteModel2 = dataSite.usingUser(adminTenantUser2).createPublicRandomSite();
|
||||
FileModel fileModel2 = dataContent.usingUser(adminTenantUser2).usingSite(siteModel2).createContent(DocumentType.XML);
|
||||
|
||||
RestProcessModel addedProcess2 = restClient.authenticateUser(adminTenantUser2).withWorkflowAPI().addProcess("activitiAdhoc", tenantUser2, false, Priority.Normal);
|
||||
RestTaskModel addedTask2 = restClient.withWorkflowAPI().getTasks().getTaskModelByProcess(addedProcess2);
|
||||
RestItemModel taskItem2 = restClient.withWorkflowAPI().usingTask(addedTask2).addTaskItem(fileModel2);
|
||||
|
||||
itemModels = restClient.withWorkflowAPI().usingTask(addedTask2).getTaskItems();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
itemModels.assertThat()
|
||||
.entriesListIsNotEmpty().and()
|
||||
.entriesListContains("id", taskItem2.getId()).and()
|
||||
.entriesListContains("name", fileModel2.getName()).and()
|
||||
.entriesListDoesNotContain("id", taskItem1.getId()).and()
|
||||
.entriesListDoesNotContain("name", fileModel1.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Check default error model schema for get task items api call")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION })
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
package org.alfresco.rest.workflow.tasks.items;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestItemModel;
|
||||
import org.alfresco.rest.model.RestItemModelsCollection;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.rest.model.RestTaskModel;
|
||||
import org.alfresco.utility.Utility;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
@@ -75,31 +72,4 @@ public class GetTaskItemsSanityTests extends RestTest
|
||||
.entriesListContains("name", document1.getName());
|
||||
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify that user that started the process gets task items")
|
||||
@Test(groups = { TestGroup.NETWORKS,TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.SANITY})
|
||||
public void getTaskItemsByAdminInSameNetwork() throws Exception
|
||||
{
|
||||
UserModel adminUser = dataUser.getAdminUser();
|
||||
restClient.authenticateUser(adminUser);
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser1);
|
||||
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant");
|
||||
UserModel tenantUserAssignee1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenantAssignee");
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser1).createPublicRandomSite();
|
||||
document1 = dataContent.usingUser(adminTenantUser1).usingSite(siteModel).createContent(DocumentType.XML);
|
||||
RestProcessModel addedProcess = restClient.authenticateUser(tenantUser1).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee1, false, Priority.Normal);
|
||||
RestTaskModel addedTask = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI().getTasks().getTaskModelByProcess(addedProcess);
|
||||
taskItem = restClient.withWorkflowAPI().usingTask(addedTask).addTaskItem(document1);
|
||||
|
||||
itemModels = restClient.withWorkflowAPI().usingTask(addedTask).getTaskItems();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
itemModels.assertThat()
|
||||
.entriesListIsNotEmpty().and()
|
||||
.entriesListContains("id", taskItem.getId()).and()
|
||||
.entriesListContains("name", document1.getName());
|
||||
}
|
||||
}
|
||||
-118
@@ -1,12 +1,9 @@
|
||||
package org.alfresco.rest.workflow.tasks.variables;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.core.RestRequest;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.rest.model.RestTaskModel;
|
||||
import org.alfresco.rest.model.RestVariableModel;
|
||||
import org.alfresco.rest.model.RestVariableModelsCollection;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
@@ -155,119 +152,4 @@ public class AddTaskVariablesTestsBulk3 extends RestTest
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from the same network is able to add task variables")
|
||||
public void addTaskVariablesByTenantAdmin() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser1);
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant1");
|
||||
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser1).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser1, false, CMISUtil.Priority.High);
|
||||
RestTaskModel task = restClient.authenticateUser(adminTenantUser1)
|
||||
.withWorkflowAPI().usingProcess(networkProcess1).getProcessTasks().getOneRandomEntry();
|
||||
restClient.authenticateUser(adminTenantUser1);
|
||||
RestVariableModel variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
restVariablemodel = restClient.withWorkflowAPI()
|
||||
.usingTask(task.onModel())
|
||||
.addTaskVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
restVariablemodel.assertThat()
|
||||
.field("scope").is(variableModel.getScope())
|
||||
.and().field("name").is(variableModel.getName())
|
||||
.and().field("value").is(variableModel.getValue())
|
||||
.and().field("type").is(variableModel.getType());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from the same network is able to add multiple task variables")
|
||||
public void addMultipleTaskVariablesByTenantAdmin() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser1);
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant1");
|
||||
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser1).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser1, false, CMISUtil.Priority.High);
|
||||
RestTaskModel task = restClient.authenticateUser(adminTenantUser1)
|
||||
.withWorkflowAPI().usingProcess(networkProcess1).getProcessTasks().getOneRandomEntry();
|
||||
restClient.authenticateUser(adminTenantUser1);
|
||||
|
||||
variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
variableModel1 = RestVariableModel.getRandomTaskVariableModel("global", "d:text");
|
||||
|
||||
restVariableCollection = restClient.withWorkflowAPI().usingTask(task.onModel())
|
||||
.addTaskVariables(variableModel, variableModel1);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
restVariableCollection.getEntries().get(0).onModel().assertThat()
|
||||
.field("scope").is(variableModel.getScope())
|
||||
.and().field("name").is(variableModel.getName())
|
||||
.and().field("value").is(variableModel.getValue())
|
||||
.and().field("type").is(variableModel.getType());
|
||||
|
||||
restVariableCollection.getEntries().get(1).onModel().assertThat()
|
||||
.field("scope").is(variableModel1.getScope())
|
||||
.and().field("name").is(variableModel1.getName())
|
||||
.and().field("value").is(variableModel1.getValue())
|
||||
.and().field("type").is(variableModel1.getType());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from another network is not able to add task variables")
|
||||
public void addTaskVariablesByTenantFromAnotherNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
UserModel adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser1);
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser2);
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant1");
|
||||
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser1).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser1, false, CMISUtil.Priority.High);
|
||||
RestTaskModel task = restClient.authenticateUser(adminTenantUser1)
|
||||
.withWorkflowAPI().usingProcess(networkProcess1).getProcessTasks().getOneRandomEntry();
|
||||
RestVariableModel variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
restVariablemodel = restClient.authenticateUser(adminTenantUser2).withWorkflowAPI()
|
||||
.usingTask(task.onModel())
|
||||
.addTaskVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsErrorKey(RestErrorModel.PERMISSION_DENIED_ERRORKEY)
|
||||
.containsSummary(RestErrorModel.PERMISSION_WAS_DENIED)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from another network is not able to add multiple task variables")
|
||||
public void addMultipleTaskVariablesByTenantFromAnotherNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
UserModel adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser1);
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser2);
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant1");
|
||||
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser1).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser1, false, CMISUtil.Priority.High);
|
||||
RestTaskModel task = restClient.authenticateUser(adminTenantUser1)
|
||||
.withWorkflowAPI().usingProcess(networkProcess1).getProcessTasks().getOneRandomEntry();
|
||||
restClient.authenticateUser(adminTenantUser1);
|
||||
|
||||
variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
variableModel1 = RestVariableModel.getRandomTaskVariableModel("global", "d:text");
|
||||
restVariableCollection = restClient.authenticateUser(adminTenantUser2).withWorkflowAPI()
|
||||
.usingTask(task.onModel())
|
||||
.addTaskVariables(variableModel,variableModel1);
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsErrorKey(RestErrorModel.PERMISSION_DENIED_ERRORKEY)
|
||||
.containsSummary(RestErrorModel.PERMISSION_WAS_DENIED)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
package org.alfresco.rest.workflow.tasks.variables;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.rest.model.RestTaskModel;
|
||||
import org.alfresco.rest.model.RestVariableModel;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TaskModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -232,56 +228,4 @@ public class DeleteTaskVariableTests extends RestTest
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from the same network is able to remove task variables")
|
||||
public void addTaskVariablesByTenantAdmin() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser1);
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI()
|
||||
.addProcess("activitiReview", adminTenantUser1, false, CMISUtil.Priority.High);
|
||||
RestTaskModel task = restClient.authenticateUser(adminTenantUser1)
|
||||
.withWorkflowAPI().usingProcess(networkProcess1).getProcessTasks().getOneRandomEntry();
|
||||
restClient.authenticateUser(adminTenantUser1);
|
||||
RestVariableModel variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
restClient.withWorkflowAPI()
|
||||
.usingTask(task.onModel())
|
||||
.addTaskVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
restClient.withWorkflowAPI().usingTask(task.onModel()).deleteTaskVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
restClient.withWorkflowAPI().usingTask(task.onModel()).getTaskVariables()
|
||||
.assertThat().entriesListDoesNotContain("name", variableModel.getName());
|
||||
}
|
||||
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from the other network is not able to remove task variables")
|
||||
public void addTaskVariablesByTenantAdminOtherNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
UserModel adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser1);
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI()
|
||||
.addProcess("activitiReview", adminTenantUser1, false, CMISUtil.Priority.High);
|
||||
RestTaskModel task = restClient.authenticateUser(adminTenantUser1)
|
||||
.withWorkflowAPI().usingProcess(networkProcess1).getProcessTasks().getOneRandomEntry();
|
||||
restClient.authenticateUser(adminTenantUser1);
|
||||
RestVariableModel variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
restClient.withWorkflowAPI()
|
||||
.usingTask(task.onModel())
|
||||
.addTaskVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
restClient.authenticateUser(adminTenantUser2).withWorkflowAPI().usingTask(task.onModel()).deleteTaskVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsErrorKey(RestErrorModel.PERMISSION_DENIED_ERRORKEY)
|
||||
.containsSummary(RestErrorModel.PERMISSION_WAS_DENIED)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,47 +249,4 @@ public class GetTaskVariablesTests extends RestTest
|
||||
.field("scope").isNull().and()
|
||||
.field("name").isNull();
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from the same network is able to retrieve network task variables")
|
||||
public void getTaskVariablesByTenantAdmin() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser1);
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant1");
|
||||
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser1).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser1, false, CMISUtil.Priority.High);
|
||||
RestTaskModel task = restClient.authenticateUser(adminTenantUser1)
|
||||
.withWorkflowAPI().usingProcess(networkProcess1).getProcessTasks().getOneRandomEntry();
|
||||
|
||||
variableModels = restClient.withWorkflowAPI().usingTask(task.onModel()).getTaskVariables();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
variableModels.assertThat().entriesListIsNotEmpty();
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from another network is not able to retrieve network task variables")
|
||||
public void getTaskVariablesByTenantFromAnotherNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
UserModel adminTenantUser2= UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser1);
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser2);
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant1");
|
||||
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser1).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser1, false, CMISUtil.Priority.High);
|
||||
RestTaskModel task = restClient.authenticateUser(adminTenantUser1)
|
||||
.withWorkflowAPI().usingProcess(networkProcess1).getProcessTasks().getOneRandomEntry();
|
||||
|
||||
variableModels = restClient.authenticateUser(adminTenantUser2).withWorkflowAPI().usingTask(task.onModel()).getTaskVariables();
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsSummary(RestErrorModel.PERMISSION_WAS_DENIED)
|
||||
.containsErrorKey(RestErrorModel.PERMISSION_DENIED_ERRORKEY)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER);
|
||||
}
|
||||
}
|
||||
|
||||
-31
@@ -1,10 +1,7 @@
|
||||
package org.alfresco.rest.workflow.tasks.variables;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.rest.model.RestTaskModel;
|
||||
import org.alfresco.rest.model.RestVariableModel;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
@@ -79,32 +76,4 @@ public class UpdateTaskVariableTestsBulk1 extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
taskVariable.assertThat().field("value").is("updatedValue");
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS})
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Update existing task variable by admin in the same network")
|
||||
public void updateTaskVariableByAdminInSameNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser1);
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant1");
|
||||
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser1).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser1, false, CMISUtil.Priority.High);
|
||||
RestTaskModel task = restClient.authenticateUser(adminTenantUser1)
|
||||
.withWorkflowAPI().usingProcess(networkProcess1).getProcessTasks().getOneRandomEntry();
|
||||
|
||||
variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
taskVariable = restClient.withWorkflowAPI().usingTask(task.onModel())
|
||||
.updateTaskVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
taskVariable.assertThat().field("scope").is(taskVariable.getScope())
|
||||
.and().field("name").is(taskVariable.getName())
|
||||
.and().field("type").is(taskVariable.getType())
|
||||
.and().field("value").is(taskVariable.getValue());
|
||||
|
||||
variableModel.setValue("updatedValue");
|
||||
taskVariable = restClient.withWorkflowAPI().usingTask(task.onModel()).updateTaskVariable(variableModel).and().field("value").is("updatedValue");
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
-1
@@ -9,7 +9,6 @@ import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TaskModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
-34
@@ -1,12 +1,9 @@
|
||||
package org.alfresco.rest.workflow.tasks.variables;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.core.RestRequest;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.rest.model.RestTaskModel;
|
||||
import org.alfresco.rest.model.RestVariableModel;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
@@ -247,35 +244,4 @@ public class UpdateTaskVariableTestsBulk3 extends RestTest
|
||||
updatedTaskVariable.assertThat().field("scope").is("global");
|
||||
updatedTaskVariable.assertThat().field("name").is("newName");
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION, TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that admin from another network is not able to update task variables")
|
||||
public void updateTaskVariablesByTenantFromAnotherNetwork() throws Exception
|
||||
{
|
||||
UserModel adminTenantUser1 = UserModel.getAdminTenantUser();
|
||||
UserModel adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser1);
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser2);
|
||||
UserModel tenantUser1 = dataUser.usingUser(adminTenantUser1).createUserWithTenant("uTenant1");
|
||||
|
||||
RestProcessModel networkProcess1 = restClient.authenticateUser(tenantUser1).withWorkflowAPI()
|
||||
.addProcess("activitiReview", tenantUser1, false, CMISUtil.Priority.High);
|
||||
RestTaskModel task = restClient.authenticateUser(adminTenantUser1)
|
||||
.withWorkflowAPI().usingProcess(networkProcess1).getProcessTasks().getOneRandomEntry();
|
||||
restClient.authenticateUser(adminTenantUser1);
|
||||
RestVariableModel variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
taskVariable = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI().usingTask(task.onModel())
|
||||
.addTaskVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
restClient.authenticateUser(adminTenantUser2).withWorkflowAPI().usingTask(task.onModel())
|
||||
.updateTaskVariable(taskVariable);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN)
|
||||
.assertLastError().containsErrorKey(RestErrorModel.PERMISSION_DENIED_ERRORKEY)
|
||||
.containsSummary(RestErrorModel.PERMISSION_WAS_DENIED)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user