mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
WIP: REPO-5266 Remove duplicate TAS code (#2)
This commit is contained in:
46
.travis.yml
46
.travis.yml
@@ -10,7 +10,7 @@ services:
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.m2
|
||||
# the cache can grow constantly
|
||||
|
||||
before_cache:
|
||||
- rm -rf $HOME/.m2/repository/org/alfresco/alfresco-community-repo
|
||||
- rm -rf $HOME/.m2/repository/org/alfresco/alfresco-core
|
||||
@@ -25,6 +25,12 @@ branches:
|
||||
only:
|
||||
- master
|
||||
- /release\/.*/
|
||||
- feature/REPO-5266_dup_tas_code
|
||||
|
||||
env:
|
||||
global:
|
||||
- TAS_SCRIPTS=../alfresco-community-repo/packaging/tests/scripts
|
||||
- TAS_COMMUNITY=../alfresco-community-repo/packaging/tests/environment
|
||||
|
||||
stages:
|
||||
- name: test
|
||||
@@ -176,60 +182,58 @@ jobs:
|
||||
- name: "REST API TAS tests part1"
|
||||
jdk: openjdk11
|
||||
install:
|
||||
- docker images
|
||||
- ./packaging/tests/scripts/start-compose.sh ./packaging/tests/environment/docker-compose-minimal+transforms.yml
|
||||
- docker images
|
||||
- ./packaging/tests/scripts/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_COMMUNITY}/docker-compose-minimal+transforms.yml
|
||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
script:
|
||||
- travis_wait 60 mvn install -f packaging/tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part1 -Denvironment=default -DrunBugs=false
|
||||
|
||||
- name: "REST API TAS tests part2"
|
||||
jdk: openjdk11
|
||||
install:
|
||||
- ./packaging/tests/scripts/start-compose.sh ./packaging/tests/environment/docker-compose-minimal+transforms.yml
|
||||
- ./packaging/tests/scripts/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_COMMUNITY}/docker-compose-minimal+transforms.yml
|
||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
script:
|
||||
- travis_wait 60 mvn install -f packaging/tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part2 -Denvironment=default -DrunBugs=false
|
||||
|
||||
- name: "REST API TAS tests part3"
|
||||
jdk: openjdk11
|
||||
install:
|
||||
- ./packaging/tests/scripts/start-compose.sh ./packaging/tests/environment/docker-compose-minimal+transforms.yml
|
||||
- ./packaging/tests/scripts/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_COMMUNITY}/docker-compose-minimal+transforms.yml
|
||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
script:
|
||||
- travis_wait 60 mvn install -f packaging/tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part3 -Denvironment=default -DrunBugs=false
|
||||
|
||||
- name: "CMIS TAS tests"
|
||||
jdk: openjdk11
|
||||
install:
|
||||
- ./packaging/tests/scripts/start-compose.sh ./packaging/tests/environment/docker-compose-minimal+transforms.yml
|
||||
- ./packaging/tests/scripts/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_COMMUNITY}/docker-compose-minimal+transforms.yml
|
||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
script:
|
||||
- travis_wait 40 mvn install -q -f packaging/tests/tas-cmis/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
||||
- travis_wait 40 mvn install -f packaging/tests/tas-cmis/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
||||
|
||||
- name: "Email TAS tests"
|
||||
jdk: openjdk11
|
||||
install:
|
||||
- ./packaging/tests/scripts/start-compose.sh ./packaging/tests/environment/docker-compose-minimal.yml
|
||||
- ./packaging/tests/scripts/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_COMMUNITY}/docker-compose-minimal.yml
|
||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
script:
|
||||
- travis_wait 30 mvn install -q -f packaging/tests/tas-email/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
||||
- travis_wait 30 mvn install -f packaging/tests/tas-email/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
||||
|
||||
- name: "WebDAV TAS tests"
|
||||
jdk: openjdk11
|
||||
install:
|
||||
- ./packaging/tests/scripts/start-compose.sh ./packaging/tests/environment/docker-compose-minimal.yml
|
||||
- ./packaging/tests/scripts/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_COMMUNITY}/docker-compose-minimal.yml
|
||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
script:
|
||||
- travis_wait 30 mvn install -q -f packaging/tests/tas-webdav/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
||||
- travis_wait 30 mvn install -f packaging/tests/tas-webdav/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
||||
|
||||
- name: "Integration TAS tests"
|
||||
jdk: openjdk11
|
||||
install:
|
||||
- ./packaging/tests/scripts/start-compose.sh ./packaging/tests/environment/docker-compose-minimal.yml
|
||||
- ./packaging/tests/scripts/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_COMMUNITY}/docker-compose-minimal.yml
|
||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
script:
|
||||
- travis_wait 30 mvn install -q -f packaging/tests/tas-integration/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
||||
- travis_wait 30 mvn install -f packaging/tests/tas-integration/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
||||
|
||||
# Comment out for now to avoid pushing 8.300 to nuxus until we are ready
|
||||
# - stage: release
|
||||
|
354
core/pom.xml
354
core/pom.xml
@@ -1,177 +1,177 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>alfresco-core</artifactId>
|
||||
<name>Alfresco Core</name>
|
||||
<description>Alfresco core libraries and utils</description>
|
||||
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>8.300-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:https://github.com/Alfresco/alfresco-core.git</connection>
|
||||
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-core.git</developerConnection>
|
||||
<url>https://github.com/Alfresco/alfresco-core</url>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>alfresco-public</id>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/repositories/releases</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-httpclient</groupId>
|
||||
<artifactId>commons-httpclient</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-math3</artifactId>
|
||||
<version>3.6.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.safehaus.jug</groupId>
|
||||
<artifactId>jug</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<classifier>asl</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.17</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-orm</artifactId>
|
||||
<!-- exclude spring-jcl which is brought in by spring-core -->
|
||||
<!-- see https://issues.alfresco.com/jira/browse/REPO-4774 -->
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jcl</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
<artifactId>quartz</artifactId>
|
||||
<!-- exclude c3p0 -->
|
||||
<!-- see https://issues.alfresco.com/jira/browse/REPO-3447 -->
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.mchange</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.surf</groupId>
|
||||
<artifactId>spring-surf-core-configservice</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.xml.bind</groupId>
|
||||
<artifactId>jakarta.xml.bind-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
<artifactId>jaxb-core</artifactId>
|
||||
<version>2.3.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.guessencoding</groupId>
|
||||
<artifactId>guessencoding</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.transaction</groupId>
|
||||
<artifactId>jakarta.transaction-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- provided dependencies -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Test only dependencies, as popped up while running mvn test -->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-dbcp</groupId>
|
||||
<artifactId>commons-dbcp</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<configuration>
|
||||
<autoVersionSubmodules>true</autoVersionSubmodules>
|
||||
<tagNameFormat>@{project.version}</tagNameFormat>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>alfresco-core</artifactId>
|
||||
<name>Alfresco Core</name>
|
||||
<description>Alfresco core libraries and utils</description>
|
||||
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>8.300-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:https://github.com/Alfresco/alfresco-core.git</connection>
|
||||
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-core.git</developerConnection>
|
||||
<url>https://github.com/Alfresco/alfresco-core</url>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>alfresco-public</id>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/repositories/releases</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-httpclient</groupId>
|
||||
<artifactId>commons-httpclient</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-math3</artifactId>
|
||||
<version>3.6.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.safehaus.jug</groupId>
|
||||
<artifactId>jug</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<classifier>asl</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.17</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-orm</artifactId>
|
||||
<!-- exclude spring-jcl which is brought in by spring-core -->
|
||||
<!-- see https://issues.alfresco.com/jira/browse/REPO-4774 -->
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jcl</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
<artifactId>quartz</artifactId>
|
||||
<!-- exclude c3p0 -->
|
||||
<!-- see https://issues.alfresco.com/jira/browse/REPO-3447 -->
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.mchange</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.surf</groupId>
|
||||
<artifactId>spring-surf-core-configservice</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.xml.bind</groupId>
|
||||
<artifactId>jakarta.xml.bind-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
<artifactId>jaxb-core</artifactId>
|
||||
<version>2.3.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.guessencoding</groupId>
|
||||
<artifactId>guessencoding</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.transaction</groupId>
|
||||
<artifactId>jakarta.transaction-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- provided dependencies -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Test only dependencies, as popped up while running mvn test -->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-dbcp</groupId>
|
||||
<artifactId>commons-dbcp</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<configuration>
|
||||
<autoVersionSubmodules>true</autoVersionSubmodules>
|
||||
<tagNameFormat>@{project.version}</tagNameFormat>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>${dependency.maven-jar-plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
@@ -1,337 +1,337 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>alfresco-data-model</artifactId>
|
||||
<name>Alfresco Data Model</name>
|
||||
<description>Alfresco Data Model classes</description>
|
||||
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>8.300-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:https://github.com/Alfresco/alfresco-data-model.git</connection>
|
||||
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-data-model.git</developerConnection>
|
||||
<url>https://github.com/Alfresco/alfresco-data-model</url>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>alfresco-public</id>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/repositories/releases</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<properties>
|
||||
<dependency.tika.version>1.24.1</dependency.tika.version>
|
||||
<!-- Files to exclude from SonarQube analysis -->
|
||||
<sonar.exclusions>
|
||||
source/java/org/alfresco/repo/search/impl/parsers/CMIS*er.java,
|
||||
source/java/org/alfresco/repo/search/impl/parsers/FTSParser.java,
|
||||
source/java/org/alfresco/repo/search/impl/parsers/FTSLexer.java
|
||||
</sonar.exclusions>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jibx</groupId>
|
||||
<artifactId>maven-jibx-plugin</artifactId>
|
||||
<configuration>
|
||||
<load>true</load>
|
||||
<schemaBindingDirectory>${project.build.sourceDirectory}/org/alfresco/repo/dictionary</schemaBindingDirectory>
|
||||
<includeSchemaBindings>
|
||||
<includeSchemaBinding>m2binding.xml</includeSchemaBinding>
|
||||
</includeSchemaBindings>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>bind-sources</id>
|
||||
<goals>
|
||||
<goal>bind</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- ACE-3329 Create _en.properties message files -->
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>duplicate-english-messages</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<target>
|
||||
<copy todir="${project.build.outputDirectory}">
|
||||
<fileset dir="${basedir}/src/main/resources" includes="alfresco/messages/**/*.properties" />
|
||||
<mapper type="regexp" from="^([^_]*).properties$" to="\1_en.properties" />
|
||||
</copy>
|
||||
</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
|
||||
<plugin>
|
||||
<groupId>org.eclipse.m2e</groupId>
|
||||
<artifactId>lifecycle-mapping</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<configuration>
|
||||
<lifecycleMappingMetadata>
|
||||
<pluginExecutions>
|
||||
<pluginExecution>
|
||||
<pluginExecutionFilter>
|
||||
<groupId>org.jibx</groupId>
|
||||
<artifactId>
|
||||
maven-jibx-plugin
|
||||
</artifactId>
|
||||
<versionRange>
|
||||
[1.2.5,)
|
||||
</versionRange>
|
||||
<goals>
|
||||
<goal>bind</goal>
|
||||
</goals>
|
||||
</pluginExecutionFilter>
|
||||
<action>
|
||||
<execute>
|
||||
<runOnConfiguration>true</runOnConfiguration>
|
||||
<runOnIncremental>true</runOnIncremental>
|
||||
</execute>
|
||||
</action>
|
||||
</pluginExecution>
|
||||
</pluginExecutions>
|
||||
</lifecycleMappingMetadata>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<configuration>
|
||||
<autoVersionSubmodules>true</autoVersionSubmodules>
|
||||
<tagNameFormat>@{project.version}</tagNameFormat>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-core</artifactId>
|
||||
</dependency>
|
||||
<!--
|
||||
| provided dependencies (are not transitive and not included in webapps)
|
||||
| see http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!--
|
||||
| compile dependencies
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>org.jibx</groupId>
|
||||
<artifactId>jibx-run</artifactId>
|
||||
<version>1.3.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>2.11.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr</artifactId>
|
||||
<version>${dependency.antlr.version}</version>
|
||||
</dependency>
|
||||
<!-- REPO-5047 - Replaces org.codehaus.woodstox:woodstox-core-asl -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.woodstox</groupId>
|
||||
<artifactId>woodstox-core</artifactId>
|
||||
<version>5.0.3</version>
|
||||
</dependency>
|
||||
<!-- REPO-5047 - Replaces org.apache.geronimo.specs:geronimo-ws-metadata_2.0_spec -->
|
||||
<dependency>
|
||||
<groupId>jakarta.jws</groupId>
|
||||
<artifactId>jakarta.jws-api</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
<!-- REPO-5047 - Replaces org.apache.geronimo.specs:geronimo-jta_1.1_spec -->
|
||||
<dependency>
|
||||
<groupId>jakarta.transaction</groupId>
|
||||
<artifactId>jakarta.transaction-api</artifactId>
|
||||
</dependency>
|
||||
<!-- REPO-5047 - Replaces javax.annotation:javax.annotation-api -->
|
||||
<dependency>
|
||||
<groupId>jakarta.annotation</groupId>
|
||||
<artifactId>jakarta.annotation-api</artifactId>
|
||||
<version>1.3.5</version>
|
||||
</dependency>
|
||||
<!-- REPO-5047 - Replaces com.sun.activation:javax.activation -->
|
||||
<dependency>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>jakarta.activation</artifactId>
|
||||
<version>1.2.2</version>
|
||||
</dependency>
|
||||
<!-- the cxf libs were updated, see dependencyManagement section -->
|
||||
<dependency>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-commons-impl</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.sun.xml.messaging.saaj</groupId>
|
||||
<artifactId>saaj-impl</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from com.fasterxml.woodstox:woodstox-core -->
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.woodstox</groupId>
|
||||
<artifactId>woodstox-core-asl</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-server-bindings</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from jakarta.jws:jakarta.jws-api -->
|
||||
<exclusion>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from jakarta.transaction:jakarta.transaction-api -->
|
||||
<exclusion>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-jta_1.1_spec</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from jakarta.annotation:jakarta.annotation-api -->
|
||||
<exclusion>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from com.sun.activation:jakarta.activation -->
|
||||
<exclusion>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>javax.activation</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- This is now deployed at:
|
||||
| http://artifacts.alfresco.com/nexus/content/repositories/thirdparty/org/acegisecurity/acegi-security/0.8.2_patched/
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>org.acegisecurity</groupId>
|
||||
<artifactId>acegi-security</artifactId>
|
||||
<version>0.8.2_patched</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-xmlfactory</artifactId>
|
||||
<version>1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
</dependency>
|
||||
<!-- Tika -->
|
||||
<dependency>
|
||||
<groupId>org.apache.tika</groupId>
|
||||
<artifactId>tika-core</artifactId>
|
||||
<version>${dependency.tika.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tika</groupId>
|
||||
<artifactId>tika-parsers</artifactId>
|
||||
<version>${dependency.tika.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.tdunning</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk15on</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>asm</groupId>
|
||||
<artifactId>asm</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicate classes from com.sun.xml.bind:jaxb-core-->
|
||||
<exclusion>
|
||||
<groupId>org.glassfish.jaxb</groupId>
|
||||
<artifactId>txw2</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.sun.istack</groupId>
|
||||
<artifactId>istack-commons-runtime</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from jakarta.jws:jakarta.jws-api -->
|
||||
<exclusion>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from jakarta.transaction:jakarta.transaction-api -->
|
||||
<exclusion>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-jta_1.1_spec</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from jakarta.annotation:jakarta.annotation-api -->
|
||||
<exclusion>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from com.sun.activation:jakarta.activation -->
|
||||
<exclusion>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>javax.activation</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- Test dependencies -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>gunit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>alfresco-data-model</artifactId>
|
||||
<name>Alfresco Data Model</name>
|
||||
<description>Alfresco Data Model classes</description>
|
||||
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>8.300-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:https://github.com/Alfresco/alfresco-data-model.git</connection>
|
||||
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-data-model.git</developerConnection>
|
||||
<url>https://github.com/Alfresco/alfresco-data-model</url>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>alfresco-public</id>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/repositories/releases</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<properties>
|
||||
<dependency.tika.version>1.24.1</dependency.tika.version>
|
||||
<!-- Files to exclude from SonarQube analysis -->
|
||||
<sonar.exclusions>
|
||||
source/java/org/alfresco/repo/search/impl/parsers/CMIS*er.java,
|
||||
source/java/org/alfresco/repo/search/impl/parsers/FTSParser.java,
|
||||
source/java/org/alfresco/repo/search/impl/parsers/FTSLexer.java
|
||||
</sonar.exclusions>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jibx</groupId>
|
||||
<artifactId>maven-jibx-plugin</artifactId>
|
||||
<configuration>
|
||||
<load>true</load>
|
||||
<schemaBindingDirectory>${project.build.sourceDirectory}/org/alfresco/repo/dictionary</schemaBindingDirectory>
|
||||
<includeSchemaBindings>
|
||||
<includeSchemaBinding>m2binding.xml</includeSchemaBinding>
|
||||
</includeSchemaBindings>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>bind-sources</id>
|
||||
<goals>
|
||||
<goal>bind</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- ACE-3329 Create _en.properties message files -->
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>duplicate-english-messages</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<target>
|
||||
<copy todir="${project.build.outputDirectory}">
|
||||
<fileset dir="${basedir}/src/main/resources" includes="alfresco/messages/**/*.properties" />
|
||||
<mapper type="regexp" from="^([^_]*).properties$" to="\1_en.properties" />
|
||||
</copy>
|
||||
</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>${dependency.maven-jar-plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
|
||||
<plugin>
|
||||
<groupId>org.eclipse.m2e</groupId>
|
||||
<artifactId>lifecycle-mapping</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<configuration>
|
||||
<lifecycleMappingMetadata>
|
||||
<pluginExecutions>
|
||||
<pluginExecution>
|
||||
<pluginExecutionFilter>
|
||||
<groupId>org.jibx</groupId>
|
||||
<artifactId>
|
||||
maven-jibx-plugin
|
||||
</artifactId>
|
||||
<versionRange>
|
||||
[1.2.5,)
|
||||
</versionRange>
|
||||
<goals>
|
||||
<goal>bind</goal>
|
||||
</goals>
|
||||
</pluginExecutionFilter>
|
||||
<action>
|
||||
<execute>
|
||||
<runOnConfiguration>true</runOnConfiguration>
|
||||
<runOnIncremental>true</runOnIncremental>
|
||||
</execute>
|
||||
</action>
|
||||
</pluginExecution>
|
||||
</pluginExecutions>
|
||||
</lifecycleMappingMetadata>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<configuration>
|
||||
<autoVersionSubmodules>true</autoVersionSubmodules>
|
||||
<tagNameFormat>@{project.version}</tagNameFormat>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-core</artifactId>
|
||||
</dependency>
|
||||
<!--
|
||||
| provided dependencies (are not transitive and not included in webapps)
|
||||
| see http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!--
|
||||
| compile dependencies
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>org.jibx</groupId>
|
||||
<artifactId>jibx-run</artifactId>
|
||||
<version>1.3.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>2.11.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr</artifactId>
|
||||
<version>${dependency.antlr.version}</version>
|
||||
</dependency>
|
||||
<!-- REPO-5047 - Replaces org.codehaus.woodstox:woodstox-core-asl -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.woodstox</groupId>
|
||||
<artifactId>woodstox-core</artifactId>
|
||||
<version>5.0.3</version>
|
||||
</dependency>
|
||||
<!-- REPO-5047 - Replaces org.apache.geronimo.specs:geronimo-ws-metadata_2.0_spec -->
|
||||
<dependency>
|
||||
<groupId>jakarta.jws</groupId>
|
||||
<artifactId>jakarta.jws-api</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
<!-- REPO-5047 - Replaces org.apache.geronimo.specs:geronimo-jta_1.1_spec -->
|
||||
<dependency>
|
||||
<groupId>jakarta.transaction</groupId>
|
||||
<artifactId>jakarta.transaction-api</artifactId>
|
||||
</dependency>
|
||||
<!-- REPO-5047 - Replaces javax.annotation:javax.annotation-api -->
|
||||
<dependency>
|
||||
<groupId>jakarta.annotation</groupId>
|
||||
<artifactId>jakarta.annotation-api</artifactId>
|
||||
<version>1.3.5</version>
|
||||
</dependency>
|
||||
<!-- REPO-5047 - Replaces com.sun.activation:javax.activation -->
|
||||
<dependency>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>jakarta.activation</artifactId>
|
||||
<version>1.2.2</version>
|
||||
</dependency>
|
||||
<!-- the cxf libs were updated, see dependencyManagement section -->
|
||||
<dependency>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-commons-impl</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.sun.xml.messaging.saaj</groupId>
|
||||
<artifactId>saaj-impl</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from com.fasterxml.woodstox:woodstox-core -->
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.woodstox</groupId>
|
||||
<artifactId>woodstox-core-asl</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-server-bindings</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from jakarta.jws:jakarta.jws-api -->
|
||||
<exclusion>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from jakarta.transaction:jakarta.transaction-api -->
|
||||
<exclusion>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-jta_1.1_spec</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from jakarta.annotation:jakarta.annotation-api -->
|
||||
<exclusion>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from com.sun.activation:jakarta.activation -->
|
||||
<exclusion>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>javax.activation</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- This is now deployed at:
|
||||
| http://artifacts.alfresco.com/nexus/content/repositories/thirdparty/org/acegisecurity/acegi-security/0.8.2_patched/
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>org.acegisecurity</groupId>
|
||||
<artifactId>acegi-security</artifactId>
|
||||
<version>0.8.2_patched</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-xmlfactory</artifactId>
|
||||
<version>1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
</dependency>
|
||||
<!-- Tika -->
|
||||
<dependency>
|
||||
<groupId>org.apache.tika</groupId>
|
||||
<artifactId>tika-core</artifactId>
|
||||
<version>${dependency.tika.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tika</groupId>
|
||||
<artifactId>tika-parsers</artifactId>
|
||||
<version>${dependency.tika.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.tdunning</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk15on</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>asm</groupId>
|
||||
<artifactId>asm</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicate classes from com.sun.xml.bind:jaxb-core-->
|
||||
<exclusion>
|
||||
<groupId>org.glassfish.jaxb</groupId>
|
||||
<artifactId>txw2</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.sun.istack</groupId>
|
||||
<artifactId>istack-commons-runtime</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from jakarta.jws:jakarta.jws-api -->
|
||||
<exclusion>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from jakarta.transaction:jakarta.transaction-api -->
|
||||
<exclusion>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-jta_1.1_spec</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from jakarta.annotation:jakarta.annotation-api -->
|
||||
<exclusion>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from com.sun.activation:jakarta.activation -->
|
||||
<exclusion>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>javax.activation</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- Test dependencies -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>gunit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export DOCKER_COMPOSE_PATH=$1
|
||||
export CLEAN_UP="$2"
|
||||
|
||||
if [ -z "$DOCKER_COMPOSE_PATH" ]
|
||||
then
|
||||
@@ -8,6 +9,22 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Cleans up any generated images. These are created if the docker-compose file has "build:" clauses. They are not
|
||||
# recreated if an image with the same name already exist. Also cleans up existing containers. Generally only needed on
|
||||
# dev systems, however...
|
||||
# The second parameter can be used to avoid doing a clean up if we are doing a restart test.
|
||||
if [ "$CLEAN_UP" != "no-clean-up" ]
|
||||
then
|
||||
docker-compose --file "${DOCKER_COMPOSE_PATH}" kill
|
||||
docker-compose --file "${DOCKER_COMPOSE_PATH}" rm -f
|
||||
|
||||
export GENERATED_IMAGES=$(docker images | grep '^environment_' | awk '{ print $3 }')
|
||||
if [ -n "$GENERATED_IMAGES" ]
|
||||
then
|
||||
docker image rm -f $GENERATED_IMAGES
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Starting ACS stack in ${DOCKER_COMPOSE_PATH}"
|
||||
|
||||
# .env files are picked up from project directory correctly on docker-compose 1.23.0+
|
||||
|
@@ -1,64 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.alfresco.tas</groupId>
|
||||
<artifactId>alfresco-community-repo-cmis-test</artifactId>
|
||||
<name>cmis test</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>8.300-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<name>Paul Brodner</name>
|
||||
<roles>
|
||||
<role>Test Automation Architect</role>
|
||||
</roles>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<properties>
|
||||
<suiteXmlFile>${project.basedir}/src/test/resources/cmis-suite.xml</suiteXmlFile>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.tas</groupId>
|
||||
<artifactId>cmis</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<suiteXmlFiles>
|
||||
<suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
|
||||
</suiteXmlFiles>
|
||||
<argLine>
|
||||
--illegal-access=warn
|
||||
</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- Build only test jar -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.alfresco.tas</groupId>
|
||||
<artifactId>alfresco-community-repo-cmis-test</artifactId>
|
||||
<name>cmis test</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>8.300-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<name>Paul Brodner</name>
|
||||
<roles>
|
||||
<role>Test Automation Architect</role>
|
||||
</roles>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<properties>
|
||||
<suiteXmlFile>${project.basedir}/src/test/resources/cmis-suite.xml</suiteXmlFile>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.tas</groupId>
|
||||
<artifactId>cmis</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<suiteXmlFiles>
|
||||
<suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
|
||||
</suiteXmlFiles>
|
||||
<argLine>
|
||||
--illegal-access=warn
|
||||
</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- Build only test jar -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
@@ -1,100 +1,102 @@
|
||||
package org.alfresco.email;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.alfresco.email.dsl.ServerConfiguration;
|
||||
import org.alfresco.utility.LogFactory;
|
||||
import org.alfresco.utility.data.*;
|
||||
import org.alfresco.utility.model.*;
|
||||
import org.alfresco.utility.network.ServerHealth;
|
||||
import org.alfresco.utility.network.TenantConsole;
|
||||
import org.slf4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
|
||||
import org.testng.annotations.*;
|
||||
|
||||
@ContextConfiguration("classpath:alfresco-email-context.xml")
|
||||
public abstract class EmailTest extends AbstractTestNGSpringContextTests
|
||||
{
|
||||
private static Logger LOG = LogFactory.getLogger();
|
||||
|
||||
@Autowired
|
||||
ServerHealth serverHealth;
|
||||
|
||||
@Autowired
|
||||
protected ImapWrapper imapProtocol;
|
||||
|
||||
@Autowired
|
||||
protected SmtpWrapper smtpProtocol;
|
||||
|
||||
@Autowired
|
||||
public DataUser dataUser;
|
||||
|
||||
@Autowired
|
||||
public DataGroup dataGroup;
|
||||
|
||||
@Autowired
|
||||
public DataSite dataSite;
|
||||
|
||||
@Autowired
|
||||
public DataContent dataContent;
|
||||
|
||||
@Autowired
|
||||
public DataLink dataLink;
|
||||
|
||||
@Autowired
|
||||
public DataCalendarEvent dataCalendarEvent;
|
||||
|
||||
@Autowired
|
||||
public DataWiki dataWiki;
|
||||
|
||||
@Autowired
|
||||
public TenantConsole tenantConsole;
|
||||
|
||||
protected UserModel adminUser;
|
||||
protected UserModel testUser;
|
||||
protected SiteModel adminSite;
|
||||
protected SiteModel testSite;
|
||||
protected FolderModel testFolder;
|
||||
protected FileModel testFile;
|
||||
protected ContentModel contentModel;
|
||||
|
||||
@BeforeSuite(alwaysRun = true)
|
||||
public void checkServerHealth() throws Exception
|
||||
{
|
||||
super.springTestContextPrepareTestInstance();
|
||||
serverHealth.assertServerIsOnline();
|
||||
|
||||
UserModel anonymousUser = new UserModel("anonymous", DataUser.PASSWORD);
|
||||
if (!dataUser.isUserInRepo(anonymousUser.getUsername()))
|
||||
{
|
||||
dataUser.createUser(anonymousUser);
|
||||
dataGroup.usingUser(anonymousUser).addUserToGroup(GroupModel.getEmailContributorsGroup());
|
||||
}
|
||||
|
||||
String jmxUseJolokiaAgent = System.getProperty("jmx.useJolokiaAgent");
|
||||
if ("true".equals(jmxUseJolokiaAgent))
|
||||
{
|
||||
imapProtocol.assertThat().protocolIsEnabled();
|
||||
smtpProtocol.assertThat().protocolIsEnabled();
|
||||
ServerConfiguration.save(smtpProtocol.withJMX(), smtpProtocol.emailProperties);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG.warn("*** Jolokia is not used! To use jolokia, please add next system property when running the tests: jmx.useJolokiaAgent=true ***");
|
||||
}
|
||||
}
|
||||
|
||||
@BeforeMethod(alwaysRun=true)
|
||||
public void showStartTestInfo(Method method)
|
||||
{
|
||||
LOG.info(String.format("*** STARTING Test: [%s] ***",method.getName()));
|
||||
}
|
||||
|
||||
@AfterMethod(alwaysRun=true)
|
||||
public void showEndTestInfo(Method method)
|
||||
{
|
||||
LOG.info(String.format("*** ENDING Test: [%s] ***", method.getName()));
|
||||
}
|
||||
}
|
||||
package org.alfresco.email;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.alfresco.email.dsl.ServerConfiguration;
|
||||
import org.alfresco.utility.LogFactory;
|
||||
import org.alfresco.utility.data.*;
|
||||
import org.alfresco.utility.model.*;
|
||||
import org.alfresco.utility.network.ServerHealth;
|
||||
import org.alfresco.utility.network.TenantConsole;
|
||||
import org.slf4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
|
||||
import org.testng.annotations.*;
|
||||
|
||||
@ContextConfiguration("classpath:alfresco-email-context.xml")
|
||||
public abstract class EmailTest extends AbstractTestNGSpringContextTests
|
||||
{
|
||||
private static Logger LOG = LogFactory.getLogger();
|
||||
|
||||
@Autowired
|
||||
protected EmailProperties emailProperties;
|
||||
|
||||
@Autowired
|
||||
ServerHealth serverHealth;
|
||||
|
||||
@Autowired
|
||||
protected ImapWrapper imapProtocol;
|
||||
|
||||
@Autowired
|
||||
protected SmtpWrapper smtpProtocol;
|
||||
|
||||
@Autowired
|
||||
public DataUser dataUser;
|
||||
|
||||
@Autowired
|
||||
public DataGroup dataGroup;
|
||||
|
||||
@Autowired
|
||||
public DataSite dataSite;
|
||||
|
||||
@Autowired
|
||||
public DataContent dataContent;
|
||||
|
||||
@Autowired
|
||||
public DataLink dataLink;
|
||||
|
||||
@Autowired
|
||||
public DataCalendarEvent dataCalendarEvent;
|
||||
|
||||
@Autowired
|
||||
public DataWiki dataWiki;
|
||||
|
||||
@Autowired
|
||||
public TenantConsole tenantConsole;
|
||||
|
||||
protected UserModel adminUser;
|
||||
protected UserModel testUser;
|
||||
protected SiteModel adminSite;
|
||||
protected SiteModel testSite;
|
||||
protected FolderModel testFolder;
|
||||
protected FileModel testFile;
|
||||
protected ContentModel contentModel;
|
||||
|
||||
@BeforeSuite(alwaysRun = true)
|
||||
public void checkServerHealth() throws Exception
|
||||
{
|
||||
super.springTestContextPrepareTestInstance();
|
||||
serverHealth.assertServerIsOnline();
|
||||
|
||||
UserModel anonymousUser = new UserModel("anonymous", DataUser.PASSWORD);
|
||||
if (!dataUser.isUserInRepo(anonymousUser.getUsername()))
|
||||
{
|
||||
dataUser.createUser(anonymousUser);
|
||||
dataGroup.usingUser(anonymousUser).addUserToGroup(GroupModel.getEmailContributorsGroup());
|
||||
}
|
||||
|
||||
if (emailProperties.getUseJolokiaAgent())
|
||||
{
|
||||
imapProtocol.assertThat().protocolIsEnabled();
|
||||
smtpProtocol.assertThat().protocolIsEnabled();
|
||||
ServerConfiguration.save(smtpProtocol.withJMX(), smtpProtocol.emailProperties);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG.warn("*** Jolokia is not used! To use jolokia, please add next system property when running the tests: jmx.useJolokiaAgent=true ***");
|
||||
}
|
||||
}
|
||||
|
||||
@BeforeMethod(alwaysRun=true)
|
||||
public void showStartTestInfo(Method method)
|
||||
{
|
||||
LOG.info(String.format("*** STARTING Test: [%s] ***",method.getName()));
|
||||
}
|
||||
|
||||
@AfterMethod(alwaysRun=true)
|
||||
public void showEndTestInfo(Method method)
|
||||
{
|
||||
LOG.info(String.format("*** ENDING Test: [%s] ***", method.getName()));
|
||||
}
|
||||
}
|
||||
|
@@ -1,180 +1,171 @@
|
||||
package org.alfresco.email.imap;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.email.EmailTest;
|
||||
import org.alfresco.utility.constants.UserRole;
|
||||
import org.alfresco.utility.data.RandomData;
|
||||
import org.alfresco.utility.model.*;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import javax.mail.Flags;
|
||||
import javax.mail.MessagingException;
|
||||
import java.io.IOException;
|
||||
|
||||
public class ImapReadMessagesTests extends EmailTest
|
||||
{
|
||||
@BeforeClass(alwaysRun=true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
testUser = dataUser.createRandomTestUser();
|
||||
testSite = dataSite.usingUser(testUser).createIMAPSite();
|
||||
adminUser = dataUser.getAdminUser();
|
||||
adminSite = dataSite.usingAdmin().createIMAPSite();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify folders created in repository in other folder via IMAP client by admin user")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.SANITY })
|
||||
public void adminShouldGetFoldersCreatedInRepositoryViaImap() throws Exception
|
||||
{
|
||||
testFolder = dataContent.usingAdmin().usingSite(testSite).createFolder();
|
||||
FolderModel testFolder1 = FolderModel.getRandomFolderModel();
|
||||
FolderModel testFolder2 = FolderModel.getRandomFolderModel();
|
||||
imapProtocol.authenticateUser(adminUser).usingSite(adminSite).usingResource(testFolder).createFolder(testFolder1)
|
||||
.and().assertThat().existsInRepo()
|
||||
.and().assertThat().existsInImap()
|
||||
.then().usingResource(testFolder).createFolder(testFolder2).assertThat().existsInRepo()
|
||||
.and().assertThat().existsInImap();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify file and its content are displayed via IMAP client when the file is created by site manager")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.SANITY })
|
||||
public void siteManagerShouldGetFileAndItsContentsViaImap() throws Exception
|
||||
{
|
||||
FileModel fileModel = dataContent.usingUser(testUser).usingSite(testSite).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
imapProtocol.authenticateUser(testUser).usingSite(testSite).assertThat().containsMessages(fileModel)
|
||||
.and().usingResource(fileModel).assertThat().existsInRepo()
|
||||
.then().assertThat().fileContentIsDisplayed();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify that file content in IMAP client contains creator, title, description, created date, " +
|
||||
"modifier, modified date, size, three links to content folder, to content url, to download url")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.SANITY })
|
||||
public void siteManagerShouldVerifyFileContent() throws Exception
|
||||
{
|
||||
FileModel fileModel = dataContent.usingUser(testUser).usingSite(testSite).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
imapProtocol.authenticateUser(testUser).usingSite(testSite).assertThat().containsMessages(fileModel)
|
||||
.and().usingResource(fileModel).assertThat().existsInRepo()
|
||||
.then().assertThat().messageContentMatchesFileModelData(fileModel);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that the admin user can mark a message as read")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.CORE })
|
||||
public void adminCanMarkMessageAsRead() throws Exception
|
||||
{
|
||||
testFile = dataContent.usingUser(adminUser).usingSite(adminSite).createContent(FileModel.getRandomFileModel(FileType.TEXT_PLAIN));
|
||||
imapProtocol.authenticateUser(adminUser).usingResource(testFile).withMessage().setSeenFlag().updateFlags()
|
||||
.then().assertThat().messageContainsFlags(Flags.Flag.SEEN);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that site manager can see wiki pages via IMAP")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.CORE })
|
||||
public void siteManagerCanViewWikiPages() throws Exception
|
||||
{
|
||||
dataWiki.usingUser(testUser).usingSite(testSite).createRandomWiki();
|
||||
imapProtocol.authenticateUser(testUser).usingSiteWikiContainer(testSite).assertThat().countMessagesIs(1);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that collaborator can see files created by self")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.CORE })
|
||||
public void collaboratorCanViewFileCreatedBySelf() throws Exception
|
||||
{
|
||||
UserModel collaboratorUser = dataUser.createRandomTestUser();
|
||||
dataUser.addUserToSite(collaboratorUser, testSite, UserRole.SiteCollaborator);
|
||||
testFile = dataContent.usingUser(collaboratorUser).usingSite(testSite).createContent(FileModel.getRandomFileModel(FileType.TEXT_PLAIN));
|
||||
imapProtocol.authenticateUser(collaboratorUser).usingSite(testSite).assertThat().containsMessages(testFile);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that contributor can see files created by self")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.CORE })
|
||||
public void contributorCanViewFileCreatedBySelf() throws Exception
|
||||
{
|
||||
UserModel contributorUser = dataUser.createRandomTestUser();
|
||||
dataUser.addUserToSite(contributorUser, testSite, UserRole.SiteContributor);
|
||||
testFile = dataContent.usingUser(contributorUser).usingSite(testSite).createContent(FileModel.getRandomFileModel(FileType.TEXT_PLAIN));
|
||||
imapProtocol.authenticateUser(contributorUser).usingSite(testSite).assertThat().containsMessages(testFile);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify file created with spaces in the name is displayed in IMAP client")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.CORE })
|
||||
public void fileWithSpacesInNameIsDisplayedInImap() throws Exception
|
||||
{
|
||||
testFile = dataContent.usingUser(testUser).usingSite(testSite).createContent(new FileModel("name with spaces.txt", FileType.TEXT_PLAIN));
|
||||
imapProtocol.authenticateUser(testUser).usingSite(testSite).assertThat().containsMessages(testFile);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that a file created with name which contains special characters is visible in IMAP")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.FULL })
|
||||
public void userCanViewFileWithSpecialCharactersInNameViaIMAP() throws Exception
|
||||
{
|
||||
testFile = dataContent.usingUser(testUser).usingSite(testSite).createContent(new FileModel("(a)[b]!#%^.txt", FileType.TEXT_PLAIN));
|
||||
imapProtocol.authenticateUser(testUser)
|
||||
.usingSite(testSite).assertThat().containsMessages(testFile)
|
||||
.usingResource(testFile).assertThat().existsInRepo();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that a file created with name which contains symbols is visible in IMAP")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.FULL })
|
||||
public void userCanViewFileWithSymbolsInNameViaIMAP() throws Exception
|
||||
{
|
||||
testFile = dataContent.usingUser(testUser).usingSite(testSite).createContent(new FileModel("a£¥€$♊♎♏♐♑♒♓Ω.txt", FileType.TEXT_PLAIN));
|
||||
imapProtocol.authenticateUser(testUser)
|
||||
.usingSite(testSite).assertThat().containsMessages(testFile)
|
||||
.usingResource(testFile).assertThat().existsInRepo();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that site manager can see links via IMAP")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.FULL })
|
||||
public void siteManagerCanViewLinks() throws Exception
|
||||
{
|
||||
dataLink.usingUser(testUser).usingSite(testSite).createRandomLink();
|
||||
imapProtocol.authenticateUser(testUser).usingSiteLinksContainer(testSite).assertThat().countMessagesIs(1);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that site manager can see calendar events via IMAP")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.FULL })
|
||||
public void siteManagerCanViewCalendarEvents() throws Exception
|
||||
{
|
||||
dataCalendarEvent.usingUser(testUser).usingSite(testSite).createRandomCalendarEvent();
|
||||
imapProtocol.authenticateUser(testUser).usingSiteCalendarContainer(testSite).assertThat().countMessagesIs(1);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that site manager cannot read file via IMAP if it is already deleted from repository")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.FULL }, expectedExceptions = MessagingException.class,
|
||||
expectedExceptionsMessageRegExp = "No message with subject .* has been found")
|
||||
public void siteManagerCannotReadFileInImapIfItWasDeletedFromRepository() throws Exception
|
||||
{
|
||||
testFile = dataContent.usingUser(testUser).usingSite(testSite)
|
||||
.createContent(new FileModel(RandomData.getRandomName("File"), FileType.TEXT_PLAIN));
|
||||
dataContent.usingUser(testUser).usingSite(testSite).usingResource(testFile).deleteContent();
|
||||
imapProtocol.authenticateUser(testUser).usingSite(testSite).usingResource(testFile).assertThat().fileContentIsDisplayed();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that site manager cannot read file via IMAP client if it is locked by an user in repository")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.FULL }, expectedExceptions = IOException.class,
|
||||
expectedExceptionsMessageRegExp = "No content")
|
||||
public void siteManagerCannotReadFileInImapIfItsLocked() throws Exception
|
||||
{
|
||||
String content = RandomData.getRandomAlphanumeric();
|
||||
testFile = dataContent.usingUser(testUser).usingSite(testSite)
|
||||
.createContent(new FileModel(RandomData.getRandomName("File"), FileType.TEXT_PLAIN, content));
|
||||
dataContent.usingUser(testUser).usingSite(testSite).usingResource(testFile).checkOutDocument();
|
||||
imapProtocol.authenticateUser(testUser).usingSite(testSite).usingResource(testFile).assertThat().fileContentIsDisplayed();
|
||||
}
|
||||
}
|
||||
package org.alfresco.email.imap;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.email.EmailTest;
|
||||
import org.alfresco.utility.constants.UserRole;
|
||||
import org.alfresco.utility.data.RandomData;
|
||||
import org.alfresco.utility.model.*;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import javax.mail.Flags;
|
||||
import javax.mail.MessagingException;
|
||||
import java.io.IOException;
|
||||
|
||||
public class ImapReadMessagesTests extends EmailTest
|
||||
{
|
||||
@BeforeClass(alwaysRun=true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
testUser = dataUser.createRandomTestUser();
|
||||
testSite = dataSite.usingUser(testUser).createIMAPSite();
|
||||
adminUser = dataUser.getAdminUser();
|
||||
adminSite = dataSite.usingAdmin().createIMAPSite();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify folders created in repository in other folder via IMAP client by admin user")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.SANITY })
|
||||
public void adminShouldGetFoldersCreatedInRepositoryViaImap() throws Exception
|
||||
{
|
||||
testFolder = dataContent.usingAdmin().usingSite(testSite).createFolder();
|
||||
FolderModel testFolder1 = FolderModel.getRandomFolderModel();
|
||||
FolderModel testFolder2 = FolderModel.getRandomFolderModel();
|
||||
imapProtocol.authenticateUser(adminUser).usingSite(adminSite).usingResource(testFolder).createFolder(testFolder1)
|
||||
.and().assertThat().existsInRepo()
|
||||
.and().assertThat().existsInImap()
|
||||
.then().usingResource(testFolder).createFolder(testFolder2).assertThat().existsInRepo()
|
||||
.and().assertThat().existsInImap();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify file and its content are displayed via IMAP client when the file is created by site manager")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.SANITY })
|
||||
public void siteManagerShouldGetFileAndItsContentsViaImap() throws Exception
|
||||
{
|
||||
FileModel fileModel = dataContent.usingUser(testUser).usingSite(testSite).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
imapProtocol.authenticateUser(testUser).usingSite(testSite).assertThat().containsMessages(fileModel)
|
||||
.and().usingResource(fileModel).assertThat().existsInRepo()
|
||||
.then().assertThat().fileContentIsDisplayed();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify that file content in IMAP client contains creator, title, description, created date, " +
|
||||
"modifier, modified date, size, three links to content folder, to content url, to download url")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.SANITY })
|
||||
public void siteManagerShouldVerifyFileContent() throws Exception
|
||||
{
|
||||
FileModel fileModel = dataContent.usingUser(testUser).usingSite(testSite).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
imapProtocol.authenticateUser(testUser).usingSite(testSite).assertThat().containsMessages(fileModel)
|
||||
.and().usingResource(fileModel).assertThat().existsInRepo()
|
||||
.then().assertThat().messageContentMatchesFileModelData(fileModel);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that the admin user can mark a message as read")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.CORE })
|
||||
public void adminCanMarkMessageAsRead() throws Exception
|
||||
{
|
||||
testFile = dataContent.usingUser(adminUser).usingSite(adminSite).createContent(FileModel.getRandomFileModel(FileType.TEXT_PLAIN));
|
||||
imapProtocol.authenticateUser(adminUser).usingResource(testFile).withMessage().setSeenFlag().updateFlags()
|
||||
.then().assertThat().messageContainsFlags(Flags.Flag.SEEN);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that collaborator can see files created by self")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.CORE })
|
||||
public void collaboratorCanViewFileCreatedBySelf() throws Exception
|
||||
{
|
||||
UserModel collaboratorUser = dataUser.createRandomTestUser();
|
||||
dataUser.addUserToSite(collaboratorUser, testSite, UserRole.SiteCollaborator);
|
||||
testFile = dataContent.usingUser(collaboratorUser).usingSite(testSite).createContent(FileModel.getRandomFileModel(FileType.TEXT_PLAIN));
|
||||
imapProtocol.authenticateUser(collaboratorUser).usingSite(testSite).assertThat().containsMessages(testFile);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that contributor can see files created by self")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.CORE })
|
||||
public void contributorCanViewFileCreatedBySelf() throws Exception
|
||||
{
|
||||
UserModel contributorUser = dataUser.createRandomTestUser();
|
||||
dataUser.addUserToSite(contributorUser, testSite, UserRole.SiteContributor);
|
||||
testFile = dataContent.usingUser(contributorUser).usingSite(testSite).createContent(FileModel.getRandomFileModel(FileType.TEXT_PLAIN));
|
||||
imapProtocol.authenticateUser(contributorUser).usingSite(testSite).assertThat().containsMessages(testFile);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify file created with spaces in the name is displayed in IMAP client")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.CORE })
|
||||
public void fileWithSpacesInNameIsDisplayedInImap() throws Exception
|
||||
{
|
||||
testFile = dataContent.usingUser(testUser).usingSite(testSite).createContent(new FileModel("name with spaces.txt", FileType.TEXT_PLAIN));
|
||||
imapProtocol.authenticateUser(testUser).usingSite(testSite).assertThat().containsMessages(testFile);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that a file created with name which contains special characters is visible in IMAP")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.FULL })
|
||||
public void userCanViewFileWithSpecialCharactersInNameViaIMAP() throws Exception
|
||||
{
|
||||
testFile = dataContent.usingUser(testUser).usingSite(testSite).createContent(new FileModel("(a)[b]!#%^.txt", FileType.TEXT_PLAIN));
|
||||
imapProtocol.authenticateUser(testUser)
|
||||
.usingSite(testSite).assertThat().containsMessages(testFile)
|
||||
.usingResource(testFile).assertThat().existsInRepo();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that a file created with name which contains symbols is visible in IMAP")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.FULL })
|
||||
public void userCanViewFileWithSymbolsInNameViaIMAP() throws Exception
|
||||
{
|
||||
testFile = dataContent.usingUser(testUser).usingSite(testSite).createContent(new FileModel("a£¥€$♊♎♏♐♑♒♓Ω.txt", FileType.TEXT_PLAIN));
|
||||
imapProtocol.authenticateUser(testUser)
|
||||
.usingSite(testSite).assertThat().containsMessages(testFile)
|
||||
.usingResource(testFile).assertThat().existsInRepo();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that site manager can see links via IMAP")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.FULL })
|
||||
public void siteManagerCanViewLinks() throws Exception
|
||||
{
|
||||
dataLink.usingUser(testUser).usingSite(testSite).createRandomLink();
|
||||
imapProtocol.authenticateUser(testUser).usingSiteLinksContainer(testSite).assertThat().countMessagesIs(1);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that site manager can see calendar events via IMAP")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.FULL })
|
||||
public void siteManagerCanViewCalendarEvents() throws Exception
|
||||
{
|
||||
dataCalendarEvent.usingUser(testUser).usingSite(testSite).createRandomCalendarEvent();
|
||||
imapProtocol.authenticateUser(testUser).usingSiteCalendarContainer(testSite).assertThat().countMessagesIs(1);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that site manager cannot read file via IMAP if it is already deleted from repository")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.FULL }, expectedExceptions = MessagingException.class,
|
||||
expectedExceptionsMessageRegExp = "No message with subject .* has been found")
|
||||
public void siteManagerCannotReadFileInImapIfItWasDeletedFromRepository() throws Exception
|
||||
{
|
||||
testFile = dataContent.usingUser(testUser).usingSite(testSite)
|
||||
.createContent(new FileModel(RandomData.getRandomName("File"), FileType.TEXT_PLAIN));
|
||||
dataContent.usingUser(testUser).usingSite(testSite).usingResource(testFile).deleteContent();
|
||||
imapProtocol.authenticateUser(testUser).usingSite(testSite).usingResource(testFile).assertThat().fileContentIsDisplayed();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.PROTOCOLS, TestGroup.IMAP }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that site manager cannot read file via IMAP client if it is locked by an user in repository")
|
||||
@Test(groups = { TestGroup.PROTOCOLS, TestGroup.IMAP, TestGroup.FULL }, expectedExceptions = IOException.class,
|
||||
expectedExceptionsMessageRegExp = "No content")
|
||||
public void siteManagerCannotReadFileInImapIfItsLocked() throws Exception
|
||||
{
|
||||
String content = RandomData.getRandomAlphanumeric();
|
||||
testFile = dataContent.usingUser(testUser).usingSite(testSite)
|
||||
.createContent(new FileModel(RandomData.getRandomName("File"), FileType.TEXT_PLAIN, content));
|
||||
dataContent.usingUser(testUser).usingSite(testSite).usingResource(testFile).checkOutDocument();
|
||||
imapProtocol.authenticateUser(testUser).usingSite(testSite).usingResource(testFile).assertThat().fileContentIsDisplayed();
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,56 +1,129 @@
|
||||
package org.alfresco.rest.nodes;
|
||||
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestNodeBodyMoveCopyModel;
|
||||
import org.alfresco.rest.model.RestNodeModel;
|
||||
import org.alfresco.rest.model.builder.NodesBuilder;
|
||||
import org.alfresco.rest.model.builder.NodesBuilder.NodeDetail;
|
||||
import org.alfresco.utility.model.ContentModel;
|
||||
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.Test;
|
||||
|
||||
/**
|
||||
* Handles tests related to api-explorer/#!/nodes
|
||||
*/
|
||||
public class NodesTests extends RestTest
|
||||
{
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.NODES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify files can be moved from one folder to another")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NODES, TestGroup.SANITY})
|
||||
public void testMoveFile() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(dataContent.getAdminUser());
|
||||
|
||||
/*
|
||||
* Create the following file structure for preconditions :
|
||||
* - sourceFolder
|
||||
* - file
|
||||
* - destinationFolder
|
||||
*/
|
||||
NodesBuilder nodesBuilder = restClient.withCoreAPI().usingNode(ContentModel.my()).defineNodes();
|
||||
NodeDetail sourceFolder = nodesBuilder.folder("sourceFolder");
|
||||
NodeDetail file = sourceFolder.file("file");
|
||||
NodeDetail destinationFolder = nodesBuilder.folder("destinationFolder");
|
||||
|
||||
// Move file from sourceFolder to destinationFolder
|
||||
RestNodeBodyMoveCopyModel moveDestinationInfo = new RestNodeBodyMoveCopyModel();
|
||||
moveDestinationInfo.setTargetParentId(destinationFolder.getId());
|
||||
|
||||
ContentModel fileToMove = new ContentModel();
|
||||
fileToMove.setNodeRef(file.getId());
|
||||
|
||||
RestNodeModel response = restClient.withParams("autoRename=true").withCoreAPI().usingNode(fileToMove).move(moveDestinationInfo);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
/*
|
||||
* Check file's parent has changed to destinationFolder
|
||||
* - sourceFolder
|
||||
* - destinationFolder
|
||||
* - file
|
||||
*/
|
||||
response.assertThat().field("parentId").is(destinationFolder.getId());
|
||||
}
|
||||
}
|
||||
package org.alfresco.rest.nodes;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import javax.json.Json;
|
||||
import javax.json.JsonObject;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.core.RestRequest;
|
||||
import org.alfresco.rest.core.RestResponse;
|
||||
import org.alfresco.rest.core.RestWrapper;
|
||||
import org.alfresco.rest.model.RestNodeBodyMoveCopyModel;
|
||||
import org.alfresco.rest.model.RestNodeModel;
|
||||
import org.alfresco.rest.model.builder.NodesBuilder;
|
||||
import org.alfresco.rest.model.builder.NodesBuilder.NodeDetail;
|
||||
import org.alfresco.utility.constants.UserRole;
|
||||
import org.alfresco.utility.data.DataUser;
|
||||
import org.alfresco.utility.model.ContentModel;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import io.restassured.RestAssured;
|
||||
|
||||
/**
|
||||
* Handles tests related to api-explorer/#!/nodes
|
||||
*/
|
||||
public class NodesTests extends RestTest
|
||||
{
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.NODES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify files can be moved from one folder to another")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NODES, TestGroup.SANITY})
|
||||
public void testMoveFile() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(dataContent.getAdminUser());
|
||||
|
||||
/*
|
||||
* Create the following file structure for preconditions :
|
||||
* - sourceFolder
|
||||
* - file
|
||||
* - destinationFolder
|
||||
*/
|
||||
NodesBuilder nodesBuilder = restClient.withCoreAPI().usingNode(ContentModel.my()).defineNodes();
|
||||
NodeDetail sourceFolder = nodesBuilder.folder("sourceFolder");
|
||||
NodeDetail file = sourceFolder.file("file");
|
||||
NodeDetail destinationFolder = nodesBuilder.folder("destinationFolder");
|
||||
|
||||
// Move file from sourceFolder to destinationFolder
|
||||
RestNodeBodyMoveCopyModel moveDestinationInfo = new RestNodeBodyMoveCopyModel();
|
||||
moveDestinationInfo.setTargetParentId(destinationFolder.getId());
|
||||
|
||||
ContentModel fileToMove = new ContentModel();
|
||||
fileToMove.setNodeRef(file.getId());
|
||||
|
||||
RestNodeModel response = restClient.withParams("autoRename=true").withCoreAPI().usingNode(fileToMove).move(moveDestinationInfo);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
/*
|
||||
* Check file's parent has changed to destinationFolder
|
||||
* - sourceFolder
|
||||
* - destinationFolder
|
||||
* - file
|
||||
*/
|
||||
response.assertThat().field("parentId").is(destinationFolder.getId());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.SANITY },
|
||||
executionType = ExecutionType.SANITY,
|
||||
description = "Verify 403 is received for files where the user lacks permissions.")
|
||||
@Test(groups = {TestGroup.SANITY})
|
||||
public void siteConsumerWillGet403OnFileWithDisabledInherittedPermissions() throws Exception
|
||||
{
|
||||
// https://issues.alfresco.com/jira/browse/REPO-4859
|
||||
|
||||
// Authenticate as admin to fulfill the preconditions
|
||||
UserModel adminUser = dataContent.getAdminUser();
|
||||
RestWrapper restWrapper = this.restClient.authenticateUser(adminUser);
|
||||
|
||||
// Create the file using CMIS
|
||||
testSite = dataSite.createPublicRandomSite();
|
||||
FileModel file = dataContent
|
||||
.usingUser(adminUser)
|
||||
.usingSite(testSite)
|
||||
.createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
|
||||
// Add a consumer user via CMIS
|
||||
DataUser.ListUserWithRoles listUserWithRoles = dataUser.usingUser(adminUser)
|
||||
.addUsersWithRolesToSite(testSite, UserRole.SiteConsumer);
|
||||
|
||||
// Disable the permission inheritance
|
||||
JsonObject activateModelJson = Json.createObjectBuilder().add("permissions",
|
||||
Json.createObjectBuilder().add("isInheritanceEnabled", false))
|
||||
.build();
|
||||
|
||||
restWrapper.withCoreAPI().usingNode(file).updateNode(activateModelJson.toString());
|
||||
restWrapper.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
// Authenticate as the consumer user
|
||||
UserModel consumerUser = listUserWithRoles.getOneUserWithRole(UserRole.SiteConsumer);
|
||||
|
||||
// Assert the consumer gets a 403 VIA REST Call
|
||||
RestResponse restApiResponse = restClient.authenticateUser(consumerUser).withCoreAPI()
|
||||
.usingNode(file).getNodeContent();
|
||||
|
||||
int restApiStatusCode = restApiResponse.getResponse().getStatusCode();
|
||||
logger.info("REST API call response status code is: " + restApiStatusCode);
|
||||
assertEquals(HttpStatus.FORBIDDEN.value(), restApiStatusCode);
|
||||
|
||||
// Assert the consumer gets a 403 VIA CMIS API
|
||||
// Implement the CMIS call as it is not supported under .withCMISApi()
|
||||
// This is done similar to {@link IntegrationWithCmisTests#verifyGetChildrenReturnsUniqueValues}
|
||||
RestAssured.basePath = "alfresco/api/-default-/public/cmis/versions/1.1/browser";
|
||||
restWrapper.configureRequestSpec().setBasePath(RestAssured.basePath);
|
||||
|
||||
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET,
|
||||
"/root/Sites/" + testSite.getTitle() + "/documentLibrary/" + file.getName() + "?cmisselector=object&succinct=true");
|
||||
RestResponse cmisApiResponse = restWrapper.authenticateUser(consumerUser).process(request);
|
||||
|
||||
int cmisApiStatusCode = cmisApiResponse.getResponse().getStatusCode();
|
||||
logger.info("CMIS API call response status code is: " + cmisApiStatusCode);
|
||||
assertEquals(HttpStatus.FORBIDDEN.value(), cmisApiStatusCode);
|
||||
}
|
||||
}
|
||||
|
@@ -1,88 +1,88 @@
|
||||
package org.alfresco.rest.people;
|
||||
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.core.RestRequest;
|
||||
import org.alfresco.rest.model.RestPersonModel;
|
||||
import org.alfresco.rest.model.RestPersonModelsCollection;
|
||||
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.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
public class GetPeopleFullTests extends RestTest
|
||||
{
|
||||
UserModel userModel;
|
||||
SiteModel siteModel;
|
||||
UserModel searchedUser, managerUser;
|
||||
UserModel adminUser;
|
||||
private RestPersonModel personModel;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
adminUser = dataUser.getAdminUser();
|
||||
userModel = dataUser.createRandomTestUser();
|
||||
siteModel = dataSite.usingUser(userModel).createPublicRandomSite();
|
||||
searchedUser = dataUser.createRandomTestUser();
|
||||
managerUser = dataUser.usingAdmin().createRandomTestUser();
|
||||
dataUser.usingUser(userModel).addUserToSite(managerUser, siteModel, UserRole.SiteManager);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION, description = "Verify entry details for get person response with Rest API")
|
||||
public void checkResponseSchemaForGetPerson() throws Exception
|
||||
{
|
||||
RestPersonModel newUser = RestPersonModel.getRandomPersonModel("aspectNames", "avatarId", "statusUpdatedAt","displayName");
|
||||
newUser = restClient.authenticateUser(adminUser).withCoreAPI().usingAuthUser().createPerson(newUser);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
personModel = restClient.authenticateUser(userModel).withCoreAPI().usingUser(new UserModel(newUser.getId(), newUser.getPassword())).getPerson();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
personModel.assertThat().field("id").is(newUser.getId())
|
||||
.and().field("firstName").is(newUser.getFirstName())
|
||||
.and().field("lastName").is(newUser.getLastName())
|
||||
.and().field("description").is(newUser.getDescription())
|
||||
.and().field("email").is(newUser.getEmail())
|
||||
.and().field("skypeId").is(newUser.getSkypeId())
|
||||
.and().field("googleId").is(newUser.getGoogleId())
|
||||
.and().field("instantMessageId").is(newUser.getInstantMessageId())
|
||||
.and().field("jobTitle").is(newUser.getJobTitle())
|
||||
.and().field("location").is(newUser.getLocation())
|
||||
.and().field("mobile").is(newUser.getMobile())
|
||||
.and().field("telephone").is(newUser.getTelephone())
|
||||
.and().field("userStatus").is(newUser.getUserStatus())
|
||||
.and().field("enabled").is(newUser.getEnabled())
|
||||
.and().field("emailNotificationsEnabled").is(newUser.getEmailNotificationsEnabled());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION, description = "Verify user gets a person with empty personId with Rest API and response is successful")
|
||||
public void userGetPersonWithEmptyPersonId() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(managerUser).withCoreAPI();
|
||||
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "people/{personId}?{parameters}", "", restClient.getParameters());
|
||||
RestPersonModelsCollection persons = restClient.processModels(RestPersonModelsCollection.class, request);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
persons.assertThat().entriesListIsNotEmpty();
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION, description = "Verify user gets admin user with Rest API and response is successful")
|
||||
public void managerUserGetAdminPerson() throws Exception
|
||||
{
|
||||
personModel = restClient.authenticateUser(managerUser).withCoreAPI().usingUser(adminUser).getPerson();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
personModel.assertThat().field("id").is(adminUser.getUsername())
|
||||
.and().field("firstName").is("Administrator")
|
||||
.and().field("email").is("admin@alfresco.com")
|
||||
.and().field("emailNotificationsEnabled").is("true")
|
||||
.and().field("enabled").is("true");
|
||||
}
|
||||
}
|
||||
package org.alfresco.rest.people;
|
||||
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.core.RestRequest;
|
||||
import org.alfresco.rest.model.RestPersonModel;
|
||||
import org.alfresco.rest.model.RestPersonModelsCollection;
|
||||
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.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
public class GetPeopleFullTests extends RestTest
|
||||
{
|
||||
UserModel userModel;
|
||||
SiteModel siteModel;
|
||||
UserModel searchedUser, managerUser;
|
||||
UserModel adminUser;
|
||||
private RestPersonModel personModel;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
adminUser = dataUser.getAdminUser();
|
||||
userModel = dataUser.createRandomTestUser();
|
||||
siteModel = dataSite.usingUser(userModel).createPublicRandomSite();
|
||||
searchedUser = dataUser.createRandomTestUser();
|
||||
managerUser = dataUser.usingAdmin().createRandomTestUser();
|
||||
dataUser.usingUser(userModel).addUserToSite(managerUser, siteModel, UserRole.SiteManager);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION, description = "Verify entry details for get person response with Rest API")
|
||||
public void checkResponseSchemaForGetPerson() throws Exception
|
||||
{
|
||||
RestPersonModel newUser = RestPersonModel.getRandomPersonModel("aspectNames", "avatarId", "statusUpdatedAt","displayName", "quota", "quotaUsed");
|
||||
newUser = restClient.authenticateUser(adminUser).withCoreAPI().usingAuthUser().createPerson(newUser);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
personModel = restClient.authenticateUser(userModel).withCoreAPI().usingUser(new UserModel(newUser.getId(), newUser.getPassword())).getPerson();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
personModel.assertThat().field("id").is(newUser.getId())
|
||||
.and().field("firstName").is(newUser.getFirstName())
|
||||
.and().field("lastName").is(newUser.getLastName())
|
||||
.and().field("description").is(newUser.getDescription())
|
||||
.and().field("email").is(newUser.getEmail())
|
||||
.and().field("skypeId").is(newUser.getSkypeId())
|
||||
.and().field("googleId").is(newUser.getGoogleId())
|
||||
.and().field("instantMessageId").is(newUser.getInstantMessageId())
|
||||
.and().field("jobTitle").is(newUser.getJobTitle())
|
||||
.and().field("location").is(newUser.getLocation())
|
||||
.and().field("mobile").is(newUser.getMobile())
|
||||
.and().field("telephone").is(newUser.getTelephone())
|
||||
.and().field("userStatus").is(newUser.getUserStatus())
|
||||
.and().field("enabled").is(newUser.getEnabled())
|
||||
.and().field("emailNotificationsEnabled").is(newUser.getEmailNotificationsEnabled());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION, description = "Verify user gets a person with empty personId with Rest API and response is successful")
|
||||
public void userGetPersonWithEmptyPersonId() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(managerUser).withCoreAPI();
|
||||
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "people/{personId}?{parameters}", "", restClient.getParameters());
|
||||
RestPersonModelsCollection persons = restClient.processModels(RestPersonModelsCollection.class, request);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
persons.assertThat().entriesListIsNotEmpty();
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION, description = "Verify user gets admin user with Rest API and response is successful")
|
||||
public void managerUserGetAdminPerson() throws Exception
|
||||
{
|
||||
personModel = restClient.authenticateUser(managerUser).withCoreAPI().usingUser(adminUser).getPerson();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
personModel.assertThat().field("id").is(adminUser.getUsername())
|
||||
.and().field("firstName").is("Administrator")
|
||||
.and().field("email").is("admin@alfresco.com")
|
||||
.and().field("emailNotificationsEnabled").is("true")
|
||||
.and().field("enabled").is("true");
|
||||
}
|
||||
}
|
||||
|
@@ -1,395 +1,395 @@
|
||||
package org.alfresco.rest.sites.members;
|
||||
|
||||
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.exception.DataPreparationException;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author iulia.cojocea
|
||||
*/
|
||||
public class GetSiteMemberTests extends RestTest
|
||||
{
|
||||
private UserModel adminUser;
|
||||
private SiteModel publicSiteModel, moderatedSiteModel, privateSiteModel;
|
||||
private ListUserWithRoles usersWithRoles;
|
||||
private UserModel manager, consumer, collaborator, contributor;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws DataPreparationException
|
||||
{
|
||||
adminUser = dataUser.getAdminUser();
|
||||
publicSiteModel = dataSite.usingUser(adminUser).createPublicRandomSite();
|
||||
moderatedSiteModel = dataSite.usingUser(adminUser).createModeratedRandomSite();
|
||||
privateSiteModel = dataSite.usingUser(adminUser).createPrivateRandomSite();
|
||||
usersWithRoles = dataUser.addUsersWithRolesToSite(publicSiteModel, UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer,
|
||||
UserRole.SiteContributor);
|
||||
|
||||
consumer = dataUser.createRandomTestUser();
|
||||
manager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager);
|
||||
collaborator = usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator);
|
||||
contributor = usersWithRoles.getOneUserWithRole(UserRole.SiteContributor);
|
||||
|
||||
dataUser.addUserToSite(consumer, publicSiteModel, UserRole.SiteConsumer);
|
||||
dataUser.addUserToSite(consumer, moderatedSiteModel, UserRole.SiteConsumer);
|
||||
dataUser.addUserToSite(manager, moderatedSiteModel, UserRole.SiteManager);
|
||||
dataUser.addUserToSite(consumer, privateSiteModel, UserRole.SiteConsumer);
|
||||
dataUser.addUserToSite(manager, privateSiteModel, UserRole.SiteManager);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify user with Manager role gets site member and status code is OK (200)")
|
||||
public void getSiteMemberWithManagerRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(consumer)
|
||||
.assertThat().field("id").is(consumer.getUsername())
|
||||
.and().field("role").is(consumer.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Collaborator role gets site member and gets status code OK (200)")
|
||||
public void getSiteMemberWithCollaboratorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(consumer)
|
||||
.and().field("id").is(consumer.getUsername())
|
||||
.and().field("role").is(consumer.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Contributor role gets site member and gets status code OK (200)")
|
||||
public void getSiteMemberWithContributorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor));
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(consumer)
|
||||
.and().field("id").is(consumer.getUsername())
|
||||
.and().field("role").is(consumer.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Consumer role gets site member and gets status code OK (200)")
|
||||
public void getSiteMemberWithConsumerRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(consumer)
|
||||
.and().field("id").is(consumer.getUsername())
|
||||
.and().field("role").is(consumer.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with admin user gets site member and gets status code OK (200)")
|
||||
public void getSiteMemberWithAdminUser() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUser);
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(consumer)
|
||||
.and().field("id").is(consumer.getUsername())
|
||||
.and().field("role").is(consumer.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Failed authentication get site member call returns status code 401")
|
||||
// @Bug(id="MNT-16904", description = "It fails only on environment with tenants")
|
||||
public void unauthenticatedUserIsNotAuthorizedToRetrieveSiteMember() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
UserModel inexistentUser = new UserModel("inexistent user", "inexistent password");
|
||||
restClient.authenticateUser(inexistentUser);
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(consumer);
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Manager role doesn't get a site member of inexistent site and status code is Not Found (404)")
|
||||
public void getSiteMemberOfInexistentSite() throws Exception
|
||||
{
|
||||
SiteModel invalidSite = new SiteModel("invalidSite");
|
||||
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
restClient.withCoreAPI().usingSite(invalidSite).getSiteMember(consumer);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.RELATIONSHIP_NOT_FOUND, consumer.getUsername(), invalidSite.getId()));
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Manager role doesn't get non site member of inexistent site and status code is Not Found (404)")
|
||||
public void getSiteMemberForNonSiteMember() throws Exception
|
||||
{
|
||||
UserModel nonMember = dataUser.createRandomTestUser();
|
||||
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(nonMember);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.RELATIONSHIP_NOT_FOUND, nonMember.getUsername(), publicSiteModel.getId()));
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Manager role doesn't get not existing site member and status code is Not Found (404)")
|
||||
public void getSiteMemberForInexistentSiteMember() throws Exception
|
||||
{
|
||||
UserModel inexistentUser = new UserModel("inexistentUser", "password");
|
||||
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(inexistentUser);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, inexistentUser.getUsername()));
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Manager role can get site member using \"-me-\" in place of personId")
|
||||
public void getSiteMemberUsingMeForPersonId() throws Exception
|
||||
{
|
||||
UserModel meUser = new UserModel("-me-", "password");
|
||||
|
||||
restClient.authenticateUser(manager);
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(meUser)
|
||||
.assertThat().field("id").is(manager.getUsername())
|
||||
.and().field("role").is(manager.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Manager role can get site member for empty siteId")
|
||||
public void getSiteMemberForEmptySiteId() throws Exception
|
||||
{
|
||||
SiteModel emptySite = new SiteModel("");
|
||||
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
restClient.withCoreAPI().usingSite(emptySite).getSiteMember(consumer);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.RELATIONSHIP_NOT_FOUND, consumer.getUsername(), emptySite.getId()));
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Manager role gets site member with Manager role and status code is OK (200)")
|
||||
public void getSiteManagerMemberWithManagerRole() throws Exception
|
||||
{
|
||||
UserModel anotherManager = dataUser.createRandomTestUser();
|
||||
dataUser.addUserToSite(anotherManager, publicSiteModel, UserRole.SiteManager);
|
||||
|
||||
restClient.authenticateUser(manager);
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(anotherManager)
|
||||
.assertThat().field("id").is(anotherManager.getUsername())
|
||||
.and().field("role").is(anotherManager.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Collaborator role gets site member with Manager role and status code is OK (200)")
|
||||
public void getSiteManagerMemberWithCollaboratorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(collaborator);
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(manager)
|
||||
.assertThat().field("id").is(manager.getUsername())
|
||||
.and().field("role").is(manager.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Consumer role gets site member with Manager role and status code is OK (200)")
|
||||
public void getSiteManagerMemberWithConsumerRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(consumer);
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(manager)
|
||||
.assertThat().field("id").is(manager.getUsername())
|
||||
.and().field("role").is(manager.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Contributor role gets site member with Manager role and status code is OK (200)")
|
||||
public void getSiteManagerMemberWithContributorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(contributor);
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(manager)
|
||||
.assertThat().field("id").is(manager.getUsername())
|
||||
.and().field("role").is(manager.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Contributor role gets admin site member and status code is OK (200)")
|
||||
public void getSiteAdminManagerMember() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(contributor);
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(adminUser)
|
||||
.assertThat().field("id").is(adminUser.getUsername())
|
||||
.and().field("role").is(UserRole.SiteManager);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Collaborator role gets site member with Contributor role and status code is OK (200)")
|
||||
public void getSiteContributorMemberWithCollaboratorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(collaborator).withCoreAPI().usingSite(publicSiteModel).getSiteMember(contributor)
|
||||
.assertThat().field("id").is(contributor.getUsername())
|
||||
.and().field("role").is(contributor.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Contributor role gets site member with Collaborator role and status code is OK (200)")
|
||||
public void getSiteCollaboratorMemberWithContributorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(contributor).withCoreAPI().usingSite(publicSiteModel).getSiteMember(collaborator)
|
||||
.assertThat().field("id").is(collaborator.getUsername())
|
||||
.and().field("role").is(collaborator.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Collaborator role gets admin role and status code is OK (200)")
|
||||
public void getAdminWithCollaboratorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(collaborator).withCoreAPI().usingSite(publicSiteModel).getSiteMember(adminUser)
|
||||
.assertThat().field("id").is(adminUser.getUsername())
|
||||
.and().field("role").is(UserRole.SiteManager);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Collaborator role gets site member with Consumer role and status code is OK (200)")
|
||||
public void getSiteConsumerMemberWithCollaboratorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(collaborator).withCoreAPI().usingSite(publicSiteModel).getSiteMember(consumer)
|
||||
.assertThat().field("id").is(consumer.getUsername())
|
||||
.and().field("role").is(consumer.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user gets site member of private site and status code is OK (200)")
|
||||
public void getSiteMemberOfPrivateSite() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(manager).withCoreAPI().usingSite(privateSiteModel).getSiteMember(consumer)
|
||||
.assertThat().field("id").is(consumer.getUsername())
|
||||
.and().field("role").is(consumer.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify not joined user is not is not able to get site member of private site and status code is 404")
|
||||
public void regularUserIsNotAbleToGetSiteMemberOfPrivateSite() throws Exception {
|
||||
UserModel regularUser = dataUser.createRandomTestUser();
|
||||
|
||||
restClient.authenticateUser(regularUser).withCoreAPI().usingSite(privateSiteModel).getSiteMember(consumer);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError()
|
||||
.containsSummary(String.format(RestErrorModel.RELATIONSHIP_NOT_FOUND, consumer.getUsername(), privateSiteModel.getTitle()));
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify admin is not able to get from site a user that created a member request that was not accepted yet")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
public void adminIsNotAbleToGetFromSiteANonExistingMember() throws Exception
|
||||
{
|
||||
UserModel newMember = dataUser.createRandomTestUser();
|
||||
restClient.authenticateUser(newMember).withCoreAPI().usingAuthUser().addSiteMembershipRequest(moderatedSiteModel);
|
||||
|
||||
restClient.authenticateUser(adminUser).withCoreAPI().usingSite(moderatedSiteModel).getSiteMember(newMember);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError()
|
||||
.containsSummary(String.format(RestErrorModel.RELATIONSHIP_NOT_FOUND, newMember.getUsername(), moderatedSiteModel.getTitle()))
|
||||
.containsErrorKey(RestErrorModel.RELATIONSHIP_NOT_FOUND_ERRORKEY)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user gets site creator and status code is OK (200)")
|
||||
public void getSiteCreator() throws Exception
|
||||
{
|
||||
SiteModel newSiteModel = dataSite.usingUser(collaborator).createModeratedRandomSite();
|
||||
dataUser.addUserToSite(consumer, publicSiteModel, UserRole.SiteConsumer);
|
||||
|
||||
restClient.authenticateUser(consumer).withCoreAPI().usingSite(newSiteModel).getSiteMember(collaborator)
|
||||
.assertThat().field("id").is(collaborator.getUsername())
|
||||
.and().field("role").is(UserRole.SiteManager);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Consumer role can get site member using \"-me-\" in place of personId")
|
||||
public void getSiteMemberOfPrivateSiteUsingMeForPersonId() throws Exception
|
||||
{
|
||||
UserModel meUser = new UserModel("-me-", "password");
|
||||
|
||||
restClient.authenticateUser(consumer).withCoreAPI().usingSite(privateSiteModel).getSiteMember(meUser)
|
||||
.assertThat().field("id").is(consumer.getUsername())
|
||||
.and().field("role").is(consumer.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user gets site member of moderated site and status code is OK (200)")
|
||||
public void getSiteMemberOfModeratedSite() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(manager).withCoreAPI().usingSite(moderatedSiteModel).getSiteMember(consumer)
|
||||
.assertThat().field("id").is(consumer.getUsername())
|
||||
.and().field("role").is(consumer.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify not joined user gets site member of moderated site and status code is OK (200)")
|
||||
public void regularUserIsAbleToGetSiteMemberOfModeratedSite() throws Exception
|
||||
{
|
||||
UserModel regularUser = dataUser.createRandomTestUser();
|
||||
|
||||
restClient.authenticateUser(regularUser).withCoreAPI().usingSite(moderatedSiteModel).getSiteMember(consumer);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if get site member request with properties parameter returns status code 200 and parameter is applied")
|
||||
public void getSiteMemberUsingPropertiesParameter() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(manager)
|
||||
.withCoreAPI().usingSite(publicSiteModel).usingParams("properties=id").getSiteMember(consumer)
|
||||
.assertThat().fieldsCount().is(1)
|
||||
.and().field("id").isNotEmpty()
|
||||
.and().field("role").isNull()
|
||||
.and().field("person").isNull();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
package org.alfresco.rest.sites.members;
|
||||
|
||||
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.exception.DataPreparationException;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author iulia.cojocea
|
||||
*/
|
||||
public class GetSiteMemberTests extends RestTest
|
||||
{
|
||||
private UserModel adminUser;
|
||||
private SiteModel publicSiteModel, moderatedSiteModel, privateSiteModel;
|
||||
private ListUserWithRoles usersWithRoles;
|
||||
private UserModel manager, consumer, collaborator, contributor;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws DataPreparationException
|
||||
{
|
||||
adminUser = dataUser.getAdminUser();
|
||||
publicSiteModel = dataSite.usingUser(adminUser).createPublicRandomSite();
|
||||
moderatedSiteModel = dataSite.usingUser(adminUser).createModeratedRandomSite();
|
||||
privateSiteModel = dataSite.usingUser(adminUser).createPrivateRandomSite();
|
||||
usersWithRoles = dataUser.addUsersWithRolesToSite(publicSiteModel, UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer,
|
||||
UserRole.SiteContributor);
|
||||
|
||||
consumer = dataUser.createRandomTestUser();
|
||||
manager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager);
|
||||
collaborator = usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator);
|
||||
contributor = usersWithRoles.getOneUserWithRole(UserRole.SiteContributor);
|
||||
|
||||
dataUser.addUserToSite(consumer, publicSiteModel, UserRole.SiteConsumer);
|
||||
dataUser.addUserToSite(consumer, moderatedSiteModel, UserRole.SiteConsumer);
|
||||
dataUser.addUserToSite(manager, moderatedSiteModel, UserRole.SiteManager);
|
||||
dataUser.addUserToSite(consumer, privateSiteModel, UserRole.SiteConsumer);
|
||||
dataUser.addUserToSite(manager, privateSiteModel, UserRole.SiteManager);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify user with Manager role gets site member and status code is OK (200)")
|
||||
public void getSiteMemberWithManagerRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(consumer)
|
||||
.assertThat().field("id").is(consumer.getUsername())
|
||||
.and().field("role").is(consumer.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Collaborator role gets site member and gets status code OK (200)")
|
||||
public void getSiteMemberWithCollaboratorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(consumer)
|
||||
.and().field("id").is(consumer.getUsername())
|
||||
.and().field("role").is(consumer.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Contributor role gets site member and gets status code OK (200)")
|
||||
public void getSiteMemberWithContributorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor));
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(consumer)
|
||||
.and().field("id").is(consumer.getUsername())
|
||||
.and().field("role").is(consumer.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Consumer role gets site member and gets status code OK (200)")
|
||||
public void getSiteMemberWithConsumerRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(consumer)
|
||||
.and().field("id").is(consumer.getUsername())
|
||||
.and().field("role").is(consumer.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with admin user gets site member and gets status code OK (200)")
|
||||
public void getSiteMemberWithAdminUser() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUser);
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(consumer)
|
||||
.and().field("id").is(consumer.getUsername())
|
||||
.and().field("role").is(consumer.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Failed authentication get site member call returns status code 401")
|
||||
// @Bug(id="MNT-16904", description = "It fails only on environment with tenants")
|
||||
public void unauthenticatedUserIsNotAuthorizedToRetrieveSiteMember() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
UserModel inexistentUser = new UserModel("inexistent user", "inexistent password");
|
||||
restClient.authenticateUser(inexistentUser);
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(consumer);
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Manager role doesn't get a site member of inexistent site and status code is Not Found (404)")
|
||||
public void getSiteMemberOfInexistentSite() throws Exception
|
||||
{
|
||||
SiteModel invalidSite = new SiteModel("invalidSite");
|
||||
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
restClient.withCoreAPI().usingSite(invalidSite).getSiteMember(consumer);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.RELATIONSHIP_NOT_FOUND, consumer.getUsername(), invalidSite.getId()));
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Manager role doesn't get non site member of inexistent site and status code is Not Found (404)")
|
||||
public void getSiteMemberForNonSiteMember() throws Exception
|
||||
{
|
||||
UserModel nonMember = dataUser.createRandomTestUser();
|
||||
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(nonMember);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.RELATIONSHIP_NOT_FOUND, nonMember.getUsername(), publicSiteModel.getId()));
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Manager role doesn't get not existing site member and status code is Not Found (404)")
|
||||
public void getSiteMemberForInexistentSiteMember() throws Exception
|
||||
{
|
||||
UserModel inexistentUser = new UserModel("inexistentUser", "password");
|
||||
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(inexistentUser);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, inexistentUser.getUsername()));
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Manager role can get site member using \"-me-\" in place of personId")
|
||||
public void getSiteMemberUsingMeForPersonId() throws Exception
|
||||
{
|
||||
UserModel meUser = new UserModel("-me-", "password");
|
||||
|
||||
restClient.authenticateUser(manager);
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(meUser)
|
||||
.assertThat().field("id").is(manager.getUsername())
|
||||
.and().field("role").is(manager.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Manager role can get site member for empty siteId")
|
||||
public void getSiteMemberForEmptySiteId() throws Exception
|
||||
{
|
||||
SiteModel emptySite = new SiteModel("");
|
||||
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
restClient.withCoreAPI().usingSite(emptySite).getSiteMember(consumer);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.RELATIONSHIP_NOT_FOUND, consumer.getUsername(), emptySite.getId()));
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Manager role gets site member with Manager role and status code is OK (200)")
|
||||
public void getSiteManagerMemberWithManagerRole() throws Exception
|
||||
{
|
||||
UserModel anotherManager = dataUser.createRandomTestUser();
|
||||
dataUser.addUserToSite(anotherManager, publicSiteModel, UserRole.SiteManager);
|
||||
|
||||
restClient.authenticateUser(manager);
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(anotherManager)
|
||||
.assertThat().field("id").is(anotherManager.getUsername())
|
||||
.and().field("role").is(anotherManager.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Collaborator role gets site member with Manager role and status code is OK (200)")
|
||||
public void getSiteManagerMemberWithCollaboratorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(collaborator);
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(manager)
|
||||
.assertThat().field("id").is(manager.getUsername())
|
||||
.and().field("role").is(manager.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Consumer role gets site member with Manager role and status code is OK (200)")
|
||||
public void getSiteManagerMemberWithConsumerRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(consumer);
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(manager)
|
||||
.assertThat().field("id").is(manager.getUsername())
|
||||
.and().field("role").is(manager.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Contributor role gets site member with Manager role and status code is OK (200)")
|
||||
public void getSiteManagerMemberWithContributorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(contributor);
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(manager)
|
||||
.assertThat().field("id").is(manager.getUsername())
|
||||
.and().field("role").is(manager.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Contributor role gets admin site member and status code is OK (200)")
|
||||
public void getSiteAdminManagerMember() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(contributor);
|
||||
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMember(adminUser)
|
||||
.assertThat().field("id").is(adminUser.getUsername())
|
||||
.and().field("role").is(UserRole.SiteManager);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Collaborator role gets site member with Contributor role and status code is OK (200)")
|
||||
public void getSiteContributorMemberWithCollaboratorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(collaborator).withCoreAPI().usingSite(publicSiteModel).getSiteMember(contributor)
|
||||
.assertThat().field("id").is(contributor.getUsername())
|
||||
.and().field("role").is(contributor.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Contributor role gets site member with Collaborator role and status code is OK (200)")
|
||||
public void getSiteCollaboratorMemberWithContributorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(contributor).withCoreAPI().usingSite(publicSiteModel).getSiteMember(collaborator)
|
||||
.assertThat().field("id").is(collaborator.getUsername())
|
||||
.and().field("role").is(collaborator.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Collaborator role gets admin role and status code is OK (200)")
|
||||
public void getAdminWithCollaboratorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(collaborator).withCoreAPI().usingSite(publicSiteModel).getSiteMember(adminUser)
|
||||
.assertThat().field("id").is(adminUser.getUsername())
|
||||
.and().field("role").is(UserRole.SiteManager);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Collaborator role gets site member with Consumer role and status code is OK (200)")
|
||||
public void getSiteConsumerMemberWithCollaboratorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(collaborator).withCoreAPI().usingSite(publicSiteModel).getSiteMember(consumer)
|
||||
.assertThat().field("id").is(consumer.getUsername())
|
||||
.and().field("role").is(consumer.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user gets site member of private site and status code is OK (200)")
|
||||
public void getSiteMemberOfPrivateSite() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(manager).withCoreAPI().usingSite(privateSiteModel).getSiteMember(consumer)
|
||||
.assertThat().field("id").is(consumer.getUsername())
|
||||
.and().field("role").is(consumer.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify not joined user is not is not able to get site member of private site and status code is 404")
|
||||
public void regularUserIsNotAbleToGetSiteMemberOfPrivateSite() throws Exception {
|
||||
UserModel regularUser = dataUser.createRandomTestUser();
|
||||
|
||||
restClient.authenticateUser(regularUser).withCoreAPI().usingSite(privateSiteModel).getSiteMember(consumer);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError()
|
||||
.containsSummary(String.format(RestErrorModel.RELATIONSHIP_NOT_FOUND, consumer.getUsername(), privateSiteModel.getTitle()));
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify admin is not able to get from site a user that created a member request that was not accepted yet")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
public void adminIsNotAbleToGetFromSiteANonExistingMember() throws Exception
|
||||
{
|
||||
UserModel newMember = dataUser.createRandomTestUser();
|
||||
restClient.authenticateUser(newMember).withCoreAPI().usingAuthUser().addSiteMembershipRequest(moderatedSiteModel);
|
||||
|
||||
restClient.authenticateUser(adminUser).withCoreAPI().usingSite(moderatedSiteModel).getSiteMember(newMember);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError()
|
||||
.containsSummary(String.format(RestErrorModel.RELATIONSHIP_NOT_FOUND, newMember.getUsername(), moderatedSiteModel.getTitle()))
|
||||
.containsErrorKey(RestErrorModel.RELATIONSHIP_NOT_FOUND_ERRORKEY)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user gets site creator and status code is OK (200)")
|
||||
public void getSiteCreator() throws Exception
|
||||
{
|
||||
SiteModel newSiteModel = dataSite.usingUser(collaborator).createModeratedRandomSite();
|
||||
dataUser.addUserToSite(consumer, publicSiteModel, UserRole.SiteConsumer);
|
||||
|
||||
restClient.authenticateUser(consumer).withCoreAPI().usingSite(newSiteModel).getSiteMember(collaborator)
|
||||
.assertThat().field("id").is(collaborator.getUsername())
|
||||
.and().field("role").is(UserRole.SiteManager);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Consumer role can get site member using \"-me-\" in place of personId")
|
||||
public void getSiteMemberOfPrivateSiteUsingMeForPersonId() throws Exception
|
||||
{
|
||||
UserModel meUser = new UserModel("-me-", "password");
|
||||
|
||||
restClient.authenticateUser(consumer).withCoreAPI().usingSite(privateSiteModel).getSiteMember(meUser)
|
||||
.assertThat().field("id").is(consumer.getUsername())
|
||||
.and().field("role").is(consumer.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user gets site member of moderated site and status code is OK (200)")
|
||||
public void getSiteMemberOfModeratedSite() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(manager).withCoreAPI().usingSite(moderatedSiteModel).getSiteMember(consumer)
|
||||
.assertThat().field("id").is(consumer.getUsername())
|
||||
.and().field("role").is(consumer.getUserRole());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify not joined user gets site member of moderated site and status code is OK (200)")
|
||||
public void regularUserIsAbleToGetSiteMemberOfModeratedSite() throws Exception
|
||||
{
|
||||
UserModel regularUser = dataUser.createRandomTestUser();
|
||||
|
||||
restClient.authenticateUser(regularUser).withCoreAPI().usingSite(moderatedSiteModel).getSiteMember(consumer);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if get site member request with properties parameter returns status code 200 and parameter is applied")
|
||||
public void getSiteMemberUsingPropertiesParameter() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(manager)
|
||||
.withCoreAPI().usingSite(publicSiteModel).usingParams("properties=id").getSiteMember(consumer)
|
||||
.assertThat().fieldsCount().is(2)
|
||||
.and().field("id").isNotEmpty()
|
||||
.and().field("role").isNull()
|
||||
.and().field("person").isNull();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
@@ -1,354 +1,354 @@
|
||||
package org.alfresco.rest.sites.members;
|
||||
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestSiteMemberModel;
|
||||
import org.alfresco.rest.model.RestSiteMemberModelsCollection;
|
||||
import org.alfresco.utility.constants.UserRole;
|
||||
import org.alfresco.utility.data.DataUser.ListUserWithRoles;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author iulia.cojocea
|
||||
*/
|
||||
public class GetSiteMembersTests extends RestTest
|
||||
{
|
||||
private SiteModel publicSite, privateSite, moderatedSite, moderatedSite2, moderatedSite3;
|
||||
private RestSiteMemberModelsCollection siteMembers;
|
||||
private ListUserWithRoles usersWithRoles, moderatedSiteUsers;
|
||||
private UserModel regularUser, privateSiteConsumer, siteCreator;
|
||||
private RestSiteMemberModel firstSiteMember, secondSiteMember, thirdSiteMember, fourthSiteMember;
|
||||
|
||||
@BeforeClass(alwaysRun=true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
siteCreator = dataUser.createRandomTestUser();
|
||||
regularUser = dataUser.createRandomTestUser();
|
||||
privateSiteConsumer = dataUser.createRandomTestUser();
|
||||
|
||||
publicSite = dataSite.usingUser(siteCreator).createPublicRandomSite();
|
||||
privateSite = dataSite.usingUser(siteCreator).createPrivateRandomSite();
|
||||
moderatedSite = dataSite.usingUser(siteCreator).createModeratedRandomSite();
|
||||
moderatedSite2 = dataSite.usingUser(siteCreator).createModeratedRandomSite();
|
||||
moderatedSite3 = dataSite.usingUser(siteCreator).createModeratedRandomSite();
|
||||
|
||||
dataUser.addUserToSite(privateSiteConsumer, privateSite, UserRole.SiteConsumer);
|
||||
dataUser.addUserToSite(privateSiteConsumer, moderatedSite3, UserRole.SiteConsumer);
|
||||
usersWithRoles = dataUser.addUsersWithRolesToSite(publicSite,UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor);
|
||||
moderatedSiteUsers = dataUser.addUsersWithRolesToSite(moderatedSite, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor);
|
||||
|
||||
siteMembers = restClient.authenticateUser(siteCreator).withCoreAPI()
|
||||
.usingSite(moderatedSite).usingParams("properties=role,id").getSiteMembers();
|
||||
firstSiteMember = siteMembers.getEntries().get(0).onModel();
|
||||
secondSiteMember = siteMembers.getEntries().get(1).onModel();
|
||||
thirdSiteMember = siteMembers.getEntries().get(2).onModel();
|
||||
fourthSiteMember = siteMembers.getEntries().get(3).onModel();
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify user with Manager role gets site members and gets status code OK (200)")
|
||||
public void getSiteMembersWithManagerRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager))
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers().assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListContains("id", usersWithRoles.getOneUserWithRole(UserRole.SiteManager).getUsername())
|
||||
.and().entriesListContains("role", usersWithRoles.getOneUserWithRole(UserRole.SiteManager).getUserRole().toString());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Collaborator role gets site members and gets status code OK (200)")
|
||||
public void getSiteMembersWithCollaboratorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator))
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers().assertThat().entriesListIsNotEmpty().assertThat()
|
||||
.entriesListContains("id", usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator).getUsername()).and()
|
||||
.entriesListContains("role", usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator).getUserRole().toString());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Contributor role gets site members and gets status code OK (200)")
|
||||
public void getSiteMembersWithContributorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor))
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers().assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListContains("id", usersWithRoles.getOneUserWithRole(UserRole.SiteContributor).getUsername())
|
||||
.and().entriesListContains("role", usersWithRoles.getOneUserWithRole(UserRole.SiteContributor).getUserRole().toString());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Consumer role gets site members and gets status code OK (200)")
|
||||
public void getSiteMembersWithConsumerRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer))
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers().assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListContains("id", usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer).getUsername())
|
||||
.and().entriesListContains("role", usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer).getUserRole().toString());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with admin usere gets site members and gets status code OK (200)")
|
||||
public void getSiteMembersWithAdminUser() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(dataUser.getAdminUser())
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers().assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListContains("id", siteCreator.getUsername())
|
||||
.when().assertThat().entriesListContains("role", "SiteManager");
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Failed authentication get site members call returns status code 401")
|
||||
// @Bug(id="MNT-16904", description = "It fails only on environment with tenants")
|
||||
public void unauthenticatedUserIsNotAuthorizedToRetrieveSiteMembers() throws Exception
|
||||
{
|
||||
UserModel userModel = dataUser.createRandomTestUser();
|
||||
userModel.setPassword("user wrong password");
|
||||
dataUser.addUserToSite(userModel, publicSite, UserRole.SiteManager);
|
||||
restClient.authenticateUser(userModel)
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify get site members call returns status code 404 if siteId does not exist")
|
||||
public void checkStatusCodeForNonExistentSiteId() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(regularUser).withCoreAPI()
|
||||
.usingSite("NonExistentSiteId").getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "NonExistentSiteId"));
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify get site members call returns status code 400 for invalid maxItems")
|
||||
public void checkStatusCodeForInvalidMaxItems() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(regularUser).withParams("maxItems=0")
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
||||
.assertLastError().containsSummary(RestErrorModel.ONLY_POSITIVE_VALUES_MAXITEMS)
|
||||
.containsErrorKey(RestErrorModel.ONLY_POSITIVE_VALUES_MAXITEMS)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
|
||||
restClient.withParams("maxItems=A")
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.INVALID_MAXITEMS, "A"));
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify get site members call returns status code 400 for invalid skipCount ")
|
||||
public void checkStatusCodeForInvalidSkipCount() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(regularUser).withParams("skipCount=A")
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.INVALID_SKIPCOUNT, "A"));
|
||||
|
||||
restClient.withParams("skipCount=-1")
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
||||
.assertLastError().containsSummary(RestErrorModel.NEGATIVE_VALUES_SKIPCOUNT);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if any user gets public site members and status code is 200")
|
||||
public void getPublicSiteMembers() throws Exception
|
||||
{
|
||||
siteMembers = restClient.authenticateUser(regularUser).withCoreAPI()
|
||||
.usingSite(publicSite).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().entriesListContains("id", siteCreator.getUsername())
|
||||
.and().entriesListContains("id", usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer).getUsername())
|
||||
.and().entriesListContains("id", usersWithRoles.getOneUserWithRole(UserRole.SiteContributor).getUsername())
|
||||
.and().entriesListContains("id", usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator).getUsername())
|
||||
.and().entriesListContains("id", usersWithRoles.getOneUserWithRole(UserRole.SiteManager).getUsername())
|
||||
.and().paginationField("count").is("5");
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if any user gets moderated site members and status code is 200")
|
||||
public void getModeratedSiteMembers() throws Exception
|
||||
{
|
||||
siteMembers = restClient.authenticateUser(regularUser).withCoreAPI()
|
||||
.usingSite(moderatedSite).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().entriesListContains("id", siteCreator.getUsername())
|
||||
.and().entriesListContains("id", moderatedSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator).getUsername())
|
||||
.and().entriesListContains("id", moderatedSiteUsers.getOneUserWithRole(UserRole.SiteContributor).getUsername())
|
||||
.and().entriesListContains("id", moderatedSiteUsers.getOneUserWithRole(UserRole.SiteConsumer).getUsername())
|
||||
.and().paginationField("count").is("4");
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if user gets private site members if he is a member of that site and status code is 200")
|
||||
public void getPrivateSiteMembersByASiteMember() throws Exception
|
||||
{
|
||||
siteMembers = restClient.authenticateUser(privateSiteConsumer).withCoreAPI()
|
||||
.usingSite(privateSite).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().entriesListContains("id", siteCreator.getUsername())
|
||||
.and().entriesListContains("id", privateSiteConsumer.getUsername())
|
||||
.and().paginationField("count").is("2");
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if user doesn't get private site members if he is not a member of that site and status code is 404")
|
||||
public void getPrivateSiteMembersByNotASiteMember() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(regularUser).withCoreAPI()
|
||||
.usingSite(privateSite).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, privateSite.getTitle()));
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if user gets moderated site members after the adding of a new member and status code is 200")
|
||||
public void getSiteMembersAfterAddingNewMember() throws Exception
|
||||
{
|
||||
siteMembers = restClient.authenticateUser(regularUser).withCoreAPI()
|
||||
.usingSite(moderatedSite2).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().entriesListContains("id", siteCreator.getUsername())
|
||||
.and().paginationField("count").is("1");
|
||||
|
||||
restClient.authenticateUser(siteCreator).withCoreAPI().usingSite(moderatedSite2).addPerson(privateSiteConsumer);
|
||||
|
||||
siteMembers = restClient.authenticateUser(regularUser).withCoreAPI()
|
||||
.usingSite(moderatedSite2).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().entriesListContains("id", siteCreator.getUsername())
|
||||
.and().entriesListContains("id", privateSiteConsumer.getUsername())
|
||||
.and().paginationField("count").is("2");
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if any user gets moderated site members with properties parameter applied and status code is 200")
|
||||
public void getModeratedSiteMembersUsingPropertiesParameter() throws Exception
|
||||
{
|
||||
siteMembers = restClient.authenticateUser(siteCreator).withCoreAPI()
|
||||
.usingSite(moderatedSite).usingParams("properties=role,id").getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().entriesListCountIs(4)
|
||||
.and().entriesListDoesNotContain("person")
|
||||
.and().entriesListContains("role", UserRole.SiteManager.toString())
|
||||
.and().entriesListContains("id", siteCreator.getUsername())
|
||||
.and().entriesListContains("role", UserRole.SiteContributor.toString())
|
||||
.and().entriesListContains("id", moderatedSiteUsers.getOneUserWithRole(UserRole.SiteContributor).getUsername())
|
||||
.and().entriesListContains("role", UserRole.SiteCollaborator.toString())
|
||||
.and().entriesListContains("id", moderatedSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator).getUsername())
|
||||
.and().entriesListContains("role", UserRole.SiteConsumer.toString())
|
||||
.and().entriesListContains("id", moderatedSiteUsers.getOneUserWithRole(UserRole.SiteConsumer).getUsername());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if any user gets moderated site members with skipCount parameter applied")
|
||||
public void getModeratedSiteMembersUsingSkipCountParameter() throws Exception
|
||||
{
|
||||
siteMembers = restClient.authenticateUser(siteCreator).withCoreAPI()
|
||||
.usingSite(moderatedSite).usingParams("skipCount=2").getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().paginationField("count").is("2");
|
||||
siteMembers.assertThat().paginationField("skipCount").is("2");
|
||||
siteMembers.assertThat().entriesListDoesNotContain("id", firstSiteMember.getId())
|
||||
.and().entriesListDoesNotContain("id", secondSiteMember.getId())
|
||||
.and().entriesListContains("role", thirdSiteMember.getRole().toString())
|
||||
.and().entriesListContains("id", thirdSiteMember.getId())
|
||||
.and().entriesListContains("role", fourthSiteMember.getRole().toString())
|
||||
.and().entriesListContains("id", fourthSiteMember.getId());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if any user gets moderated site members with high skipCount parameter applied")
|
||||
public void getModeratedSiteMembersUsingHighSkipCountParameter() throws Exception
|
||||
{
|
||||
siteMembers = restClient.authenticateUser(siteCreator).withCoreAPI()
|
||||
.usingSite(moderatedSite).usingParams("skipCount=100").getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().paginationField("count").is("0");
|
||||
siteMembers.assertThat().paginationField("skipCount").is("100");
|
||||
siteMembers.assertThat().entriesListIsEmpty();
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if any user gets moderated site members with maxItems parameter applied and check all pagination fields")
|
||||
public void getModeratedSiteMembersUsingMaxItemsParameter() throws Exception
|
||||
{
|
||||
siteMembers = restClient.authenticateUser(siteCreator).withCoreAPI()
|
||||
.usingSite(moderatedSite).usingParams("maxItems=1").getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().paginationField("count").is("1");
|
||||
siteMembers.assertThat().paginationField("hasMoreItems").is("true");
|
||||
siteMembers.assertThat().paginationField("maxItems").is("1");
|
||||
siteMembers.assertThat().paginationField("totalItems").isNotPresent();
|
||||
siteMembers.assertThat().entriesListContains("id", firstSiteMember.getId())
|
||||
.and().entriesListContains("role", firstSiteMember.getRole().toString())
|
||||
.and().entriesListDoesNotContain("id", secondSiteMember.getId())
|
||||
.and().entriesListDoesNotContain("id", thirdSiteMember.getId());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if user gets moderated site members with member not joined yet and status code is 200")
|
||||
public void getSiteMembersFromNotJoinedModeratedSite() throws Exception
|
||||
{
|
||||
UserModel userNotJoined = dataUser.createRandomTestUser();
|
||||
restClient.authenticateUser(userNotJoined).withCoreAPI().usingAuthUser().addSiteMembershipRequest(moderatedSite2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
siteMembers = restClient.authenticateUser(siteCreator).withCoreAPI()
|
||||
.usingSite(moderatedSite2).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().entriesListContains("id", siteCreator.getUsername())
|
||||
.and().entriesListDoesNotContain("id", userNotJoined.getUsername());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if any user gets site members after the member was removed from site and status code is 200")
|
||||
public void getSiteMembersAfterRemovingASiteMember() throws Exception
|
||||
{
|
||||
siteMembers = restClient.authenticateUser(siteCreator).withCoreAPI()
|
||||
.usingSite(moderatedSite3).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().entriesListCountIs(2);
|
||||
|
||||
restClient.withCoreAPI().usingSite(moderatedSite3).deleteSiteMember(privateSiteConsumer);
|
||||
|
||||
siteMembers = restClient.withCoreAPI().usingSite(moderatedSite3).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().entriesListCountIs(1)
|
||||
.and().entriesListContains("role", UserRole.SiteManager.toString())
|
||||
.and().entriesListContains("id", siteCreator.getUsername());
|
||||
}
|
||||
}
|
||||
package org.alfresco.rest.sites.members;
|
||||
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestSiteMemberModel;
|
||||
import org.alfresco.rest.model.RestSiteMemberModelsCollection;
|
||||
import org.alfresco.utility.constants.UserRole;
|
||||
import org.alfresco.utility.data.DataUser.ListUserWithRoles;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author iulia.cojocea
|
||||
*/
|
||||
public class GetSiteMembersTests extends RestTest
|
||||
{
|
||||
private SiteModel publicSite, privateSite, moderatedSite, moderatedSite2, moderatedSite3;
|
||||
private RestSiteMemberModelsCollection siteMembers;
|
||||
private ListUserWithRoles usersWithRoles, moderatedSiteUsers;
|
||||
private UserModel regularUser, privateSiteConsumer, siteCreator;
|
||||
private RestSiteMemberModel firstSiteMember, secondSiteMember, thirdSiteMember, fourthSiteMember;
|
||||
|
||||
@BeforeClass(alwaysRun=true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
siteCreator = dataUser.createRandomTestUser();
|
||||
regularUser = dataUser.createRandomTestUser();
|
||||
privateSiteConsumer = dataUser.createRandomTestUser();
|
||||
|
||||
publicSite = dataSite.usingUser(siteCreator).createPublicRandomSite();
|
||||
privateSite = dataSite.usingUser(siteCreator).createPrivateRandomSite();
|
||||
moderatedSite = dataSite.usingUser(siteCreator).createModeratedRandomSite();
|
||||
moderatedSite2 = dataSite.usingUser(siteCreator).createModeratedRandomSite();
|
||||
moderatedSite3 = dataSite.usingUser(siteCreator).createModeratedRandomSite();
|
||||
|
||||
dataUser.addUserToSite(privateSiteConsumer, privateSite, UserRole.SiteConsumer);
|
||||
dataUser.addUserToSite(privateSiteConsumer, moderatedSite3, UserRole.SiteConsumer);
|
||||
usersWithRoles = dataUser.addUsersWithRolesToSite(publicSite,UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor);
|
||||
moderatedSiteUsers = dataUser.addUsersWithRolesToSite(moderatedSite, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor);
|
||||
|
||||
siteMembers = restClient.authenticateUser(siteCreator).withCoreAPI()
|
||||
.usingSite(moderatedSite).usingParams("properties=role,id").getSiteMembers();
|
||||
firstSiteMember = siteMembers.getEntries().get(0).onModel();
|
||||
secondSiteMember = siteMembers.getEntries().get(1).onModel();
|
||||
thirdSiteMember = siteMembers.getEntries().get(2).onModel();
|
||||
fourthSiteMember = siteMembers.getEntries().get(3).onModel();
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify user with Manager role gets site members and gets status code OK (200)")
|
||||
public void getSiteMembersWithManagerRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager))
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers().assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListContains("id", usersWithRoles.getOneUserWithRole(UserRole.SiteManager).getUsername())
|
||||
.and().entriesListContains("role", usersWithRoles.getOneUserWithRole(UserRole.SiteManager).getUserRole().toString());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Collaborator role gets site members and gets status code OK (200)")
|
||||
public void getSiteMembersWithCollaboratorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator))
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers().assertThat().entriesListIsNotEmpty().assertThat()
|
||||
.entriesListContains("id", usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator).getUsername()).and()
|
||||
.entriesListContains("role", usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator).getUserRole().toString());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Contributor role gets site members and gets status code OK (200)")
|
||||
public void getSiteMembersWithContributorRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor))
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers().assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListContains("id", usersWithRoles.getOneUserWithRole(UserRole.SiteContributor).getUsername())
|
||||
.and().entriesListContains("role", usersWithRoles.getOneUserWithRole(UserRole.SiteContributor).getUserRole().toString());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with Consumer role gets site members and gets status code OK (200)")
|
||||
public void getSiteMembersWithConsumerRole() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer))
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers().assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListContains("id", usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer).getUsername())
|
||||
.and().entriesListContains("role", usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer).getUserRole().toString());
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify user with admin usere gets site members and gets status code OK (200)")
|
||||
public void getSiteMembersWithAdminUser() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(dataUser.getAdminUser())
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers().assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListContains("id", siteCreator.getUsername())
|
||||
.when().assertThat().entriesListContains("role", "SiteManager");
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Failed authentication get site members call returns status code 401")
|
||||
// @Bug(id="MNT-16904", description = "It fails only on environment with tenants")
|
||||
public void unauthenticatedUserIsNotAuthorizedToRetrieveSiteMembers() throws Exception
|
||||
{
|
||||
UserModel userModel = dataUser.createRandomTestUser();
|
||||
userModel.setPassword("user wrong password");
|
||||
dataUser.addUserToSite(userModel, publicSite, UserRole.SiteManager);
|
||||
restClient.authenticateUser(userModel)
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify get site members call returns status code 404 if siteId does not exist")
|
||||
public void checkStatusCodeForNonExistentSiteId() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(regularUser).withCoreAPI()
|
||||
.usingSite("NonExistentSiteId").getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "NonExistentSiteId"));
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify get site members call returns status code 400 for invalid maxItems")
|
||||
public void checkStatusCodeForInvalidMaxItems() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(regularUser).withParams("maxItems=0")
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
||||
.assertLastError().containsSummary(RestErrorModel.ONLY_POSITIVE_VALUES_MAXITEMS)
|
||||
.containsErrorKey(RestErrorModel.ONLY_POSITIVE_VALUES_MAXITEMS)
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
|
||||
restClient.withParams("maxItems=A")
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.INVALID_MAXITEMS, "A"));
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify get site members call returns status code 400 for invalid skipCount ")
|
||||
public void checkStatusCodeForInvalidSkipCount() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(regularUser).withParams("skipCount=A")
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.INVALID_SKIPCOUNT, "A"));
|
||||
|
||||
restClient.withParams("skipCount=-1")
|
||||
.withCoreAPI().usingSite(publicSite).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
||||
.assertLastError().containsSummary(RestErrorModel.NEGATIVE_VALUES_SKIPCOUNT);
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if any user gets public site members and status code is 200")
|
||||
public void getPublicSiteMembers() throws Exception
|
||||
{
|
||||
siteMembers = restClient.authenticateUser(regularUser).withCoreAPI()
|
||||
.usingSite(publicSite).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().entriesListContains("id", siteCreator.getUsername())
|
||||
.and().entriesListContains("id", usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer).getUsername())
|
||||
.and().entriesListContains("id", usersWithRoles.getOneUserWithRole(UserRole.SiteContributor).getUsername())
|
||||
.and().entriesListContains("id", usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator).getUsername())
|
||||
.and().entriesListContains("id", usersWithRoles.getOneUserWithRole(UserRole.SiteManager).getUsername())
|
||||
.and().paginationField("count").is("5");
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if any user gets moderated site members and status code is 200")
|
||||
public void getModeratedSiteMembers() throws Exception
|
||||
{
|
||||
siteMembers = restClient.authenticateUser(regularUser).withCoreAPI()
|
||||
.usingSite(moderatedSite).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().entriesListContains("id", siteCreator.getUsername())
|
||||
.and().entriesListContains("id", moderatedSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator).getUsername())
|
||||
.and().entriesListContains("id", moderatedSiteUsers.getOneUserWithRole(UserRole.SiteContributor).getUsername())
|
||||
.and().entriesListContains("id", moderatedSiteUsers.getOneUserWithRole(UserRole.SiteConsumer).getUsername())
|
||||
.and().paginationField("count").is("4");
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if user gets private site members if he is a member of that site and status code is 200")
|
||||
public void getPrivateSiteMembersByASiteMember() throws Exception
|
||||
{
|
||||
siteMembers = restClient.authenticateUser(privateSiteConsumer).withCoreAPI()
|
||||
.usingSite(privateSite).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().entriesListContains("id", siteCreator.getUsername())
|
||||
.and().entriesListContains("id", privateSiteConsumer.getUsername())
|
||||
.and().paginationField("count").is("2");
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if user doesn't get private site members if he is not a member of that site and status code is 404")
|
||||
public void getPrivateSiteMembersByNotASiteMember() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(regularUser).withCoreAPI()
|
||||
.usingSite(privateSite).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, privateSite.getTitle()));
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if user gets moderated site members after the adding of a new member and status code is 200")
|
||||
public void getSiteMembersAfterAddingNewMember() throws Exception
|
||||
{
|
||||
siteMembers = restClient.authenticateUser(regularUser).withCoreAPI()
|
||||
.usingSite(moderatedSite2).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().entriesListContains("id", siteCreator.getUsername())
|
||||
.and().paginationField("count").is("1");
|
||||
|
||||
restClient.authenticateUser(siteCreator).withCoreAPI().usingSite(moderatedSite2).addPerson(privateSiteConsumer);
|
||||
|
||||
siteMembers = restClient.authenticateUser(regularUser).withCoreAPI()
|
||||
.usingSite(moderatedSite2).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().entriesListContains("id", siteCreator.getUsername())
|
||||
.and().entriesListContains("id", privateSiteConsumer.getUsername())
|
||||
.and().paginationField("count").is("2");
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if any user gets moderated site members with properties parameter applied and status code is 200")
|
||||
public void getModeratedSiteMembersUsingPropertiesParameter() throws Exception
|
||||
{
|
||||
siteMembers = restClient.authenticateUser(siteCreator).withCoreAPI()
|
||||
.usingSite(moderatedSite).usingParams("properties=role,id").getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().entriesListCountIs(4)
|
||||
.and().entriesListDoesNotContain("person")
|
||||
.and().entriesListContains("role", UserRole.SiteManager.toString())
|
||||
.and().entriesListContains("id", siteCreator.getUsername())
|
||||
.and().entriesListContains("role", UserRole.SiteContributor.toString())
|
||||
.and().entriesListContains("id", moderatedSiteUsers.getOneUserWithRole(UserRole.SiteContributor).getUsername())
|
||||
.and().entriesListContains("role", UserRole.SiteCollaborator.toString())
|
||||
.and().entriesListContains("id", moderatedSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator).getUsername())
|
||||
.and().entriesListContains("role", UserRole.SiteConsumer.toString())
|
||||
.and().entriesListContains("id", moderatedSiteUsers.getOneUserWithRole(UserRole.SiteConsumer).getUsername());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if any user gets moderated site members with skipCount parameter applied")
|
||||
public void getModeratedSiteMembersUsingSkipCountParameter() throws Exception
|
||||
{
|
||||
siteMembers = restClient.authenticateUser(siteCreator).withCoreAPI()
|
||||
.usingSite(moderatedSite).usingParams("skipCount=2").getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().paginationField("count").is("2");
|
||||
siteMembers.assertThat().paginationField("skipCount").is("2");
|
||||
siteMembers.assertThat().entriesListDoesNotContain("id", firstSiteMember.getId())
|
||||
.and().entriesListDoesNotContain("id", secondSiteMember.getId())
|
||||
.and().entriesListContains("role", thirdSiteMember.getRole().toString())
|
||||
.and().entriesListContains("id", thirdSiteMember.getId())
|
||||
.and().entriesListContains("role", fourthSiteMember.getRole().toString())
|
||||
.and().entriesListContains("id", fourthSiteMember.getId());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if any user gets moderated site members with high skipCount parameter applied")
|
||||
public void getModeratedSiteMembersUsingHighSkipCountParameter() throws Exception
|
||||
{
|
||||
siteMembers = restClient.authenticateUser(siteCreator).withCoreAPI()
|
||||
.usingSite(moderatedSite).usingParams("skipCount=100").getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().paginationField("count").is("0");
|
||||
siteMembers.assertThat().paginationField("skipCount").is("100");
|
||||
siteMembers.assertThat().entriesListIsEmpty();
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if any user gets moderated site members with maxItems parameter applied and check all pagination fields")
|
||||
public void getModeratedSiteMembersUsingMaxItemsParameter() throws Exception
|
||||
{
|
||||
siteMembers = restClient.authenticateUser(siteCreator).withCoreAPI()
|
||||
.usingSite(moderatedSite).usingParams("maxItems=1").getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().paginationField("count").is("1");
|
||||
siteMembers.assertThat().paginationField("hasMoreItems").is("true");
|
||||
siteMembers.assertThat().paginationField("maxItems").is("1");
|
||||
siteMembers.assertThat().paginationField("totalItems").is("4");
|
||||
siteMembers.assertThat().entriesListContains("id", firstSiteMember.getId())
|
||||
.and().entriesListContains("role", firstSiteMember.getRole().toString())
|
||||
.and().entriesListDoesNotContain("id", secondSiteMember.getId())
|
||||
.and().entriesListDoesNotContain("id", thirdSiteMember.getId());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if user gets moderated site members with member not joined yet and status code is 200")
|
||||
public void getSiteMembersFromNotJoinedModeratedSite() throws Exception
|
||||
{
|
||||
UserModel userNotJoined = dataUser.createRandomTestUser();
|
||||
restClient.authenticateUser(userNotJoined).withCoreAPI().usingAuthUser().addSiteMembershipRequest(moderatedSite2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
siteMembers = restClient.authenticateUser(siteCreator).withCoreAPI()
|
||||
.usingSite(moderatedSite2).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().entriesListContains("id", siteCreator.getUsername())
|
||||
.and().entriesListDoesNotContain("id", userNotJoined.getUsername());
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
|
||||
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
|
||||
description= "Verify if any user gets site members after the member was removed from site and status code is 200")
|
||||
public void getSiteMembersAfterRemovingASiteMember() throws Exception
|
||||
{
|
||||
siteMembers = restClient.authenticateUser(siteCreator).withCoreAPI()
|
||||
.usingSite(moderatedSite3).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().entriesListCountIs(2);
|
||||
|
||||
restClient.withCoreAPI().usingSite(moderatedSite3).deleteSiteMember(privateSiteConsumer);
|
||||
|
||||
siteMembers = restClient.withCoreAPI().usingSite(moderatedSite3).getSiteMembers();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
siteMembers.assertThat().entriesListCountIs(1)
|
||||
.and().entriesListContains("role", UserRole.SiteManager.toString())
|
||||
.and().entriesListContains("id", siteCreator.getUsername());
|
||||
}
|
||||
}
|
||||
|
@@ -1,282 +1,282 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>content-services-community</artifactId>
|
||||
<name>Alfresco Content Services Community WAR</name>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>8.300-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<scm-path>local/development/workspace</scm-path>
|
||||
<scm-revision>${buildNumber}</scm-revision>
|
||||
|
||||
<licenseName>community</licenseName>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-repository</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-remote-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-trashcan-cleaner</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.services</groupId>
|
||||
<artifactId>alfresco-messaging-repo</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xalan</groupId>
|
||||
<artifactId>xalan</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.avalon.framework</groupId>
|
||||
<artifactId>avalon-framework-api</artifactId>
|
||||
<version>4.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.avalon.framework</groupId>
|
||||
<artifactId>avalon-framework-impl</artifactId>
|
||||
<version>4.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-log-sanitizer</artifactId>
|
||||
</dependency>
|
||||
<!-- REPO-3918 needed libraries for Java 11 -->
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jaxb</groupId>
|
||||
<artifactId>jaxb-runtime</artifactId>
|
||||
<version>2.3.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.xml.soap</groupId>
|
||||
<artifactId>javax.xml.soap-api</artifactId>
|
||||
<version>1.4.0</version>
|
||||
</dependency>
|
||||
<!-- 'provided' dependencies, not packaged in war -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Test dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-core</artifactId>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-repository</artifactId>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-remote-api</artifactId>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- required by GDocs-->
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.shale</groupId>
|
||||
<artifactId>shale-test</artifactId>
|
||||
<version>1.0.5</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>alfresco</finalName>
|
||||
<resources>
|
||||
<!-- Allow replacing variables inside version.properties -->
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<excludes>
|
||||
<exclude>alfresco/version.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>alfresco/version.properties</include>
|
||||
</includes>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<!-- Creates a scm revision and stores in ${buildNumber} variable -->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>buildnumber-maven-plugin</artifactId>
|
||||
<version>1.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>create</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<shortRevisionLength>8</shortRevisionLength>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<!-- CLOUD-1967 Put core log4j config in WEB-INF/classes, so that it's first in classloader -->
|
||||
<execution>
|
||||
<id>fetch-log4j-config</id>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>unpack</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-core</artifactId>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
<includes>log*.properties</includes>
|
||||
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.3.1</version>
|
||||
<!-- This allows overlays to be prepared on the FS for minification and faster run -->
|
||||
<executions>
|
||||
<execution>
|
||||
<id>pre-exploded-war</id>
|
||||
<goals>
|
||||
<goal>exploded</goal>
|
||||
</goals>
|
||||
<phase>prepare-package</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>license-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
|
||||
<organizationName>Alfresco Software Limited</organizationName>
|
||||
<failOnMissingHeader>true</failOnMissingHeader>
|
||||
<failOnNotUptodateHeader>true</failOnNotUptodateHeader>
|
||||
<licenseResolver>classpath://alfresco</licenseResolver>
|
||||
<licenseName>${licenseName}</licenseName>
|
||||
<roots>
|
||||
<root>src</root>
|
||||
</roots>
|
||||
<includes>
|
||||
<include>**/*.java</include>
|
||||
<include>**/*.jsp</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>check-licenses</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>check-file-header</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-license-headers</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<!-- Specify the source version to get around a "feature" in JDK 11.0.2 currently used by travis-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<configuration>
|
||||
<source>${maven.build.sourceVersion}</source>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- Ensure consistent maven-release-plugin version-->
|
||||
<plugin>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<version>2.5.3</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>license-maven-plugin</artifactId>
|
||||
<version>1.13</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<!-- Tweaks required to make the build work in Eclipse -->
|
||||
<profile>
|
||||
<id>m2e</id>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<!-- This is needed for Maven tomcat run -->
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>content-services-community</artifactId>
|
||||
<name>Alfresco Content Services Community WAR</name>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>8.300-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<scm-path>local/development/workspace</scm-path>
|
||||
<scm-revision>${buildNumber}</scm-revision>
|
||||
|
||||
<licenseName>community</licenseName>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-repository</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-remote-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-trashcan-cleaner</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.services</groupId>
|
||||
<artifactId>alfresco-messaging-repo</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xalan</groupId>
|
||||
<artifactId>xalan</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.avalon.framework</groupId>
|
||||
<artifactId>avalon-framework-api</artifactId>
|
||||
<version>4.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.avalon.framework</groupId>
|
||||
<artifactId>avalon-framework-impl</artifactId>
|
||||
<version>4.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-log-sanitizer</artifactId>
|
||||
</dependency>
|
||||
<!-- REPO-3918 needed libraries for Java 11 -->
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jaxb</groupId>
|
||||
<artifactId>jaxb-runtime</artifactId>
|
||||
<version>2.3.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.xml.soap</groupId>
|
||||
<artifactId>javax.xml.soap-api</artifactId>
|
||||
<version>1.4.0</version>
|
||||
</dependency>
|
||||
<!-- 'provided' dependencies, not packaged in war -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Test dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-core</artifactId>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-repository</artifactId>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-remote-api</artifactId>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- required by GDocs-->
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.shale</groupId>
|
||||
<artifactId>shale-test</artifactId>
|
||||
<version>1.0.5</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>alfresco</finalName>
|
||||
<resources>
|
||||
<!-- Allow replacing variables inside version.properties -->
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<excludes>
|
||||
<exclude>alfresco/version.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>alfresco/version.properties</include>
|
||||
</includes>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<!-- Creates a scm revision and stores in ${buildNumber} variable -->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>buildnumber-maven-plugin</artifactId>
|
||||
<version>1.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>create</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<shortRevisionLength>8</shortRevisionLength>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<!-- CLOUD-1967 Put core log4j config in WEB-INF/classes, so that it's first in classloader -->
|
||||
<execution>
|
||||
<id>fetch-log4j-config</id>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>unpack</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-core</artifactId>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
<includes>log*.properties</includes>
|
||||
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.3.1</version>
|
||||
<!-- This allows overlays to be prepared on the FS for minification and faster run -->
|
||||
<executions>
|
||||
<execution>
|
||||
<id>pre-exploded-war</id>
|
||||
<goals>
|
||||
<goal>exploded</goal>
|
||||
</goals>
|
||||
<phase>prepare-package</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>license-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
|
||||
<organizationName>Alfresco Software Limited</organizationName>
|
||||
<failOnMissingHeader>true</failOnMissingHeader>
|
||||
<failOnNotUptodateHeader>true</failOnNotUptodateHeader>
|
||||
<licenseResolver>classpath://alfresco</licenseResolver>
|
||||
<licenseName>${licenseName}</licenseName>
|
||||
<roots>
|
||||
<root>src</root>
|
||||
</roots>
|
||||
<includes>
|
||||
<include>**/*.java</include>
|
||||
<include>**/*.jsp</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>check-licenses</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>check-file-header</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-license-headers</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<!-- Specify the source version to get around a "feature" in JDK 11.0.2 currently used by travis-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>${dependency.maven-jar-plugin.version}</version>
|
||||
<configuration>
|
||||
<source>${maven.build.sourceVersion}</source>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- Ensure consistent maven-release-plugin version-->
|
||||
<plugin>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<version>2.5.3</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>license-maven-plugin</artifactId>
|
||||
<version>1.13</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<!-- Tweaks required to make the build work in Eclipse -->
|
||||
<profile>
|
||||
<id>m2e</id>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<!-- This is needed for Maven tomcat run -->
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
54
pom.xml
54
pom.xml
@@ -22,6 +22,8 @@
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<dependency.alfresco-community-repo.version>${project.version}</dependency.alfresco-community-repo.version>
|
||||
|
||||
<acs.version.major>7</acs.version.major>
|
||||
<acs.version.minor>0</acs.version.minor>
|
||||
<acs.version.revision>0</acs.version.revision>
|
||||
@@ -62,6 +64,7 @@
|
||||
<dependency.gson.version>2.8.2</dependency.gson.version>
|
||||
<dependency.httpclient.version>4.5.12</dependency.httpclient.version>
|
||||
<dependency.xercesImpl.version>2.12.0-alfresco-patched-20191004</dependency.xercesImpl.version>
|
||||
<dependency.maven-jar-plugin.version>3.2.0</dependency.maven-jar-plugin.version>
|
||||
|
||||
<alfresco.googledrive.version>3.2.0</alfresco.googledrive.version>
|
||||
<alfresco.aos-module.version>1.3.1</alfresco.aos-module.version>
|
||||
@@ -120,23 +123,23 @@
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<version>${dependency.alfresco-community-repo.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<version>${dependency.alfresco-community-repo.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-data-model</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<version>${dependency.alfresco-community-repo.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-data-model</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<version>${dependency.alfresco-community-repo.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -147,23 +150,23 @@
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-remote-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<version>${dependency.alfresco-community-repo.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-remote-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<version>${dependency.alfresco-community-repo.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-repository</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<version>${dependency.alfresco-community-repo.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-repository</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<version>${dependency.alfresco-community-repo.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -578,6 +581,41 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.alfresco.tas</groupId>
|
||||
<artifactId>alfresco-community-repo-cmis-test</artifactId>
|
||||
<version>${dependency.alfresco-community-repo.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.tas</groupId>
|
||||
<artifactId>alfresco-community-repo-email-test</artifactId>
|
||||
<version>${dependency.alfresco-community-repo.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.tas</groupId>
|
||||
<artifactId>alfresco-community-repo-integration-test</artifactId>
|
||||
<version>${dependency.alfresco-community-repo.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.tas</groupId>
|
||||
<artifactId>alfresco-community-repo-restapi-test</artifactId>
|
||||
<version>${dependency.alfresco-community-repo.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.tas</groupId>
|
||||
<artifactId>alfresco-community-repo-webdav-test</artifactId>
|
||||
<version>${dependency.alfresco-community-repo.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.tas</groupId>
|
||||
<artifactId>utility</artifactId>
|
||||
|
Reference in New Issue
Block a user