Merge branch 'master' into TAS-2613

This commit is contained in:
Cristina Axinte
2017-01-10 16:03:34 +02:00
3 changed files with 54 additions and 6 deletions
@@ -16,6 +16,7 @@ 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.springframework.social.alfresco.api.entities.Site;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@@ -49,7 +50,11 @@ public class AddSiteMembershipRequestFullTests extends RestTest
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager)).withCoreAPI().usingUser(newMember)
.addSiteMembershipRequest(publicSite);
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, newMember.getUsername()));
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, newMember.getUsername()))
.statusCodeIs(HttpStatus.NOT_FOUND)
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
.stackTraceIs(RestErrorModel.STACKTRACE)
.containsErrorKey(RestErrorModel.ENTITY_NOT_FOUND_ERRORKEY);
}
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.FULL })
@@ -248,4 +253,36 @@ public class AddSiteMembershipRequestFullTests extends RestTest
restClient.assertStatusCodeIs(HttpStatus.OK);
siteMembershipRequests.assertThat().entriesListContains("id", anotherModeratedSite.getId());
}
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.FULL, 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.FULL })
@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")
public void siteMembershipRequestIsRejectedWhenSiteIsSwitchedFromModeratedToPrivate() throws Exception
{
regularUser = dataUser.createRandomTestUser();
SiteModel moderatedThenPrivateSite = dataSite.usingUser(adminUser).createModeratedRandomSite();
siteMembershipRequest = restClient.authenticateUser(regularUser).withCoreAPI().usingMe().addSiteMembershipRequest(moderatedThenPrivateSite);
restClient.assertStatusCodeIs(HttpStatus.CREATED);
siteMembershipRequest.assertThat().field("id").is(moderatedThenPrivateSite.getId())
.assertThat().field("site").isNotEmpty();
dataSite.usingUser(adminUser).updateSiteVisibility(moderatedThenPrivateSite, Site.Visibility.PRIVATE);
siteMembershipRequests = restClient.withCoreAPI().usingAuthUser().getSiteMembershipRequests();
restClient.assertStatusCodeIs(HttpStatus.OK);
siteMembershipRequests.assertThat().entriesListIsEmpty();
}
}
+4 -4
View File
@@ -3,6 +3,10 @@ alfresco.scheme=http
alfresco.server=localhost
alfresco.port=8080
# in containers we cannot access directly JMX, so we will use http://jolokia.org agent
# disabling this we will use direct JMX calls to server
jmx.useJolokiaAgent=false
# credentials
admin.user=admin
admin.password=admin
@@ -34,10 +38,6 @@ testManagement.suiteId=12
# The location of the reports path
reports.path=./target/reports
# in containers we cannot access directly JMX, so we will use http://jolokia.org agent
# disabling this we will use direct JMX calls to server
jmx.useJolokiaAgent=true
#
# Database Section
# You should provide here the database URL, that can be a differed server as alfresco.
+12 -1
View File
@@ -12,4 +12,15 @@ log4j.appender.file.layout.ConversionPattern=%d{HH:mm:ss} %-5p %c{1}:%L - %m%n
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss} %-5p %c{1}:%L - %m%n
log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss} %-5p %c{1}:%L - %m%n
# TestRail particular log file
# Direct log messages to a log file
log4j.appender.testrailLog=org.apache.log4j.RollingFileAppender
log4j.appender.testrailLog.File=./target/reports/alfresco-testrail.log
log4j.appender.testrailLog.MaxBackupIndex=10
log4j.appender.testrailLog.layout=org.apache.log4j.PatternLayout
log4j.appender.testrailLog.layout.ConversionPattern=%d{HH:mm:ss} %-5p %c{1}:%L - %m%n
log4j.category.testrail=INFO, testrailLog
log4j.additivity.testrail=false