Compare commits

...

100 Commits

Author SHA1 Message Date
Travis CI User
3a8fde44ec [maven-release-plugin][skip ci] prepare release v1.128 2022-09-29 17:39:58 +00:00
krdabrowski
646bbe3436 ACS-3525: API for manual triggering rules on a folder (#257)
ACS-3525: API for manual triggering rules on a folder
2022-09-29 19:35:01 +02:00
Travis CI User
7c706dbac6 [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-29 14:27:29 +00:00
Travis CI User
2ab4c70217 [maven-release-plugin][skip ci] prepare release v1.127 2022-09-29 14:27:27 +00:00
Kristian Dimitrov
ed0bbf576d ACS-3601 add e2e unlink functionality (#259)
* ACS-3601: Add unlink/delete request
2022-09-29 15:22:29 +01:00
Travis CI User
f3e43badfe [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-29 12:52:31 +00:00
Travis CI User
e99b6a98de [maven-release-plugin][skip ci] prepare release v1.126 2022-09-29 12:52:29 +00:00
Tom Page
64644505b3 ACS-3376 ACS-3377 Support GET and PUT rule id list. (#256) 2022-09-29 13:47:41 +01:00
Travis CI User
aca9e15668 [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-29 11:49:12 +00:00
Travis CI User
1852309798 [maven-release-plugin][skip ci] prepare release v1.125 2022-09-29 11:49:10 +00:00
Kristian Dimitrov
ee2e248e39 ACS-3601: Add unlink/delete request (#258) 2022-09-29 12:44:10 +01:00
Travis CI User
b2f90ff6bc [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-28 06:40:00 +00:00
Travis CI User
59641e833e [maven-release-plugin][skip ci] prepare release v1.124 2022-09-28 06:39:58 +00:00
Sara
6dd7d32b2e ACS-3560 Add custom embedded workflow to entitlements model (#255)
* ACS-3560 Add custom embedded workflow to entitlements model

* add header
2022-09-28 07:35:19 +01:00
Travis CI User
83bf4d0a2f [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-26 12:03:10 +00:00
Travis CI User
1af9f31b68 [maven-release-plugin][skip ci] prepare release v1.123 2022-09-26 12:03:09 +00:00
Tom Page
2b98e73468 ACS-3359 Rename boolean fields. (#253) 2022-09-26 12:58:42 +01:00
Travis CI User
966dd7d144 [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-20 14:58:56 +00:00
Travis CI User
375c68f932 [maven-release-plugin][skip ci] prepare release v1.122 2022-09-20 14:58:54 +00:00
Tom Page
8ce6117a95 ACS-3577 Use reload4j from TAS utility. 2022-09-20 15:54:19 +01:00
Travis CI User
08e393c39f [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-20 11:31:17 +00:00
Travis CI User
2f4303f4eb [maven-release-plugin][skip ci] prepare release v1.121 2022-09-20 11:31:15 +00:00
Tom Page
953a1cc3f9 Fix setter and getter naming for GET rule set fields. (#252) 2022-09-20 12:26:28 +01:00
Travis CI User
23a1ddca6a [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-20 11:08:16 +00:00
Travis CI User
439dd3771f [maven-release-plugin][skip ci] prepare release v1.120 2022-09-20 11:08:14 +00:00
dependabot[bot]
df7ebe30b3 Bump utility from 3.0.54 to 3.0.55 (#249)
Bumps [utility](https://github.com/Alfresco/alfresco-tas-utility) from 3.0.54 to 3.0.55.
- [Release notes](https://github.com/Alfresco/alfresco-tas-utility/releases)
- [Changelog](https://github.com/Alfresco/alfresco-tas-utility/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/Alfresco/alfresco-tas-utility/compare/utility-3.0.54...utility-3.0.55)

---
updated-dependencies:
- dependency-name: org.alfresco.tas:utility
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-20 12:03:23 +01:00
Travis CI User
c482153183 [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-16 13:49:06 +00:00
Travis CI User
cdbd153151 [maven-release-plugin][skip ci] prepare release v1.119 2022-09-16 13:49:01 +00:00
Tom Page
8564f9eace ACS-3364 ACS-3365 ACS-3366 Add extra fields to rule set. (#248) 2022-09-16 14:44:14 +01:00
Travis CI User
b5d7500ecc [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-16 13:27:58 +00:00
Travis CI User
e875e1fbbe [maven-release-plugin][skip ci] prepare release v1.118 2022-09-16 13:27:57 +00:00
dependabot[bot]
32179dc810 Bump utility from 3.0.53 to 3.0.54 (#243)
Bumps [utility](https://github.com/Alfresco/alfresco-tas-utility) from 3.0.53 to 3.0.54.
- [Release notes](https://github.com/Alfresco/alfresco-tas-utility/releases)
- [Changelog](https://github.com/Alfresco/alfresco-tas-utility/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/Alfresco/alfresco-tas-utility/compare/utility-3.0.53...utility-3.0.54)

---
updated-dependencies:
- dependency-name: org.alfresco.tas:utility
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 14:23:29 +01:00
dependabot[bot]
97ed056103 Bump maven-project-info-reports-plugin from 3.4.0 to 3.4.1 (#234)
Bumps [maven-project-info-reports-plugin](https://github.com/apache/maven-project-info-reports-plugin) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/apache/maven-project-info-reports-plugin/releases)
- [Commits](https://github.com/apache/maven-project-info-reports-plugin/compare/maven-project-info-reports-plugin-3.4.0...maven-project-info-reports-plugin-3.4.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-project-info-reports-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 14:20:00 +01:00
dependabot[bot]
af97fd5d6a Bump jackson-databind from 2.13.3 to 2.13.4 (#242)
Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.3 to 2.13.4.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 14:19:52 +01:00
dependabot[bot]
cef6e8fc7b Bump mockito-core from 4.2.0 to 4.8.0 (#244)
Bumps [mockito-core](https://github.com/mockito/mockito) from 4.2.0 to 4.8.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v4.2.0...v4.8.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 14:19:12 +01:00
dependabot[bot]
31d0578a98 Bump rest-assured.version from 5.1.1 to 5.2.0 (#245)
Bumps `rest-assured.version` from 5.1.1 to 5.2.0.

Updates `rest-assured` from 5.1.1 to 5.2.0
- [Release notes](https://github.com/rest-assured/rest-assured/releases)
- [Changelog](https://github.com/rest-assured/rest-assured/blob/master/changelog.txt)
- [Commits](https://github.com/rest-assured/rest-assured/compare/rest-assured-5.1.1...rest-assured-5.2.0)

Updates `json-path` from 5.1.1 to 5.2.0
- [Release notes](https://github.com/rest-assured/rest-assured/releases)
- [Changelog](https://github.com/rest-assured/rest-assured/blob/master/changelog.txt)
- [Commits](https://github.com/rest-assured/rest-assured/compare/rest-assured-5.1.1...rest-assured-5.2.0)

Updates `xml-path` from 5.1.1 to 5.2.0
- [Release notes](https://github.com/rest-assured/rest-assured/releases)
- [Changelog](https://github.com/rest-assured/rest-assured/blob/master/changelog.txt)
- [Commits](https://github.com/rest-assured/rest-assured/compare/rest-assured-5.1.1...rest-assured-5.2.0)

Updates `json-schema-validator` from 5.1.1 to 5.2.0

---
updated-dependencies:
- dependency-name: io.rest-assured:rest-assured
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.rest-assured:json-path
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.rest-assured:xml-path
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.rest-assured:json-schema-validator
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 14:19:00 +01:00
dependabot[bot]
2e1ae3bb69 Bump slf4j-api from 1.7.36 to 2.0.1 (#246)
Bumps [slf4j-api](https://github.com/qos-ch/slf4j) from 1.7.36 to 2.0.1.
- [Release notes](https://github.com/qos-ch/slf4j/releases)
- [Commits](https://github.com/qos-ch/slf4j/compare/v_1.7.36...v_2.0.1)

---
updated-dependencies:
- dependency-name: org.slf4j:slf4j-api
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 14:18:46 +01:00
Travis CI User
9af05df046 [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-15 11:37:13 +00:00
Travis CI User
71801e9e5e [maven-release-plugin][skip ci] prepare release v1.117 2022-09-15 11:37:12 +00:00
Tom Page
52149bf292 ACS-3363 Add inheritedBy to rule set. (#247) 2022-09-15 12:32:32 +01:00
Travis CI User
6cb07e1b86 [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-01 16:01:29 +00:00
Travis CI User
fa3df0987d [maven-release-plugin][skip ci] prepare release v1.116 2022-09-01 16:01:27 +00:00
Tom Page
fde20c948f Upgrade tas-utility version to use latest TestNG. (#241) 2022-09-01 16:56:40 +01:00
Travis CI User
9ea1336a18 [maven-release-plugin][skip ci] prepare for next development iteration 2022-08-30 12:01:40 +00:00
Travis CI User
b007740dd0 [maven-release-plugin][skip ci] prepare release v1.115 2022-08-30 12:01:39 +00:00
Maciej Pichura
15b10ba605 ACS-3431 rule set link TAS changes (#239)
* ACS-3341: Adding initial changes to handle rule set linking.

* ACS-3341: Adding equals/hashcode override to RestRuleSetLinkModel.

* ACS-3341: Adding equals/hashcode override to RestRuleSetModel.
2022-08-30 13:57:31 +02:00
Travis CI User
8983a11d3d [maven-release-plugin][skip ci] prepare for next development iteration 2022-08-16 15:06:16 +00:00
Travis CI User
6fd482b492 [maven-release-plugin][skip ci] prepare release v1.114 2022-08-16 15:06:14 +00:00
Tom Page
0a0c90a230 ACS-3280 Get/Set Rules Inheritance. (#235) 2022-08-16 16:02:01 +01:00
Travis CI User
109af6abff [maven-release-plugin][skip ci] prepare for next development iteration 2022-08-15 14:05:31 +00:00
Travis CI User
43532eebf5 [maven-release-plugin][skip ci] prepare release v1.113 2022-08-15 14:05:29 +00:00
Tom Page
5dc3424fe2 ACS-3280 Move assertThat() and and() to defaults in interface. (#232)
* ACS-3280 Move assertThat() and and() to defaults in interface.

Update ftl so that any future generated models will use the defaults too.

* ACS-3280 Revert changes to collections.

They have a different hierarchy and so need a different refactor.

* ACS-3280 Make RestCompanyModel work the same as all the other models.
2022-08-15 15:01:03 +01:00
Travis CI User
133670cd17 [maven-release-plugin][skip ci] prepare for next development iteration 2022-08-15 13:29:41 +00:00
Travis CI User
909e95685e [maven-release-plugin][skip ci] prepare release v1.112 2022-08-15 13:29:39 +00:00
krdabrowski
91e7b0d66f ACS-3353: POST support for "other fields" (#231)
Fix for equals method.
2022-08-15 14:25:15 +01:00
Travis CI User
cc40cf05a9 [maven-release-plugin][skip ci] prepare for next development iteration 2022-08-12 12:03:07 +00:00
Travis CI User
4629c20b51 [maven-release-plugin][skip ci] prepare release v1.111 2022-08-12 12:03:05 +00:00
krdabrowski
ee88946b1c ACS-3353: POST support for "other fields" (#230)
ACS-3353: POST support for "other fields"
- adding method `isEqualTo()` allowing assertion of whole model with different model.
2022-08-12 13:58:46 +02:00
Travis CI User
b1faf15806 [maven-release-plugin][skip ci] prepare for next development iteration 2022-08-12 09:33:07 +00:00
Travis CI User
367ad20fb7 [maven-release-plugin][skip ci] prepare release v1.110 2022-08-12 09:33:05 +00:00
Tom Page
80e770f2da ACS-3358 Support isShared in rules API. (#229)
* ACS-3358 Automatically include any unused RestWrapper parameters in the request.

* ACS-3358 Remove unnecessary calls to RestWrapper.getParameters() from rules methods.

* ACS-3358 Move request logging to point of use.

* ACS-3358 Support isShared in rules API.
2022-08-12 10:28:33 +01:00
Tom Page
e8cf525792 ACS-3358 Automatically include extra params. (#228)
* ACS-3358 Automatically include any unused RestWrapper parameters in the request.

* ACS-3358 Remove unnecessary calls to RestWrapper.getParameters() from rules methods.

* ACS-3358 Move request logging to point of use.
2022-08-12 10:28:02 +01:00
Travis CI User
a594341bb5 [maven-release-plugin][skip ci] prepare for next development iteration 2022-08-11 09:05:46 +00:00
Travis CI User
058e8d6302 [maven-release-plugin][skip ci] prepare release v1.109 2022-08-11 09:05:44 +00:00
Tom Page
91fcbb0b59 ACS-3358 We no longer need to explicitly give the "?". (#227) 2022-08-11 10:01:17 +01:00
Travis CI User
830898c605 [maven-release-plugin][skip ci] prepare for next development iteration 2022-08-10 14:52:23 +00:00
Travis CI User
d214040bc8 [maven-release-plugin][skip ci] prepare release v1.108 2022-08-10 14:52:21 +00:00
Tom Page
1b071cb555 ACS-3358 Refactor ModelRequest to cope with more parameters than tokens in the URL. (#224)
For example we can now pass include parameters without having to update the URL to have a "?" in the test code.
2022-08-10 15:47:46 +01:00
Travis CI User
37e04ee2fc [maven-release-plugin][skip ci] prepare for next development iteration 2022-08-10 10:45:05 +00:00
Travis CI User
10f32aa74c [maven-release-plugin][skip ci] prepare release v1.107 2022-08-10 10:45:03 +00:00
Tom Page
bea386ddc8 ACS-3358 Support specifying include. (#223)
* ACS-3358 Better support when specifying includes.

* ACS-3358 Add unit tests for RestWrapper.withParams().

* ACS-3358 Refactor RestWrapper.withParams().

* ACS-3358 Add unit tests for ModelRequest.
2022-08-10 11:40:45 +01:00
Travis CI User
2449d1d8f3 [maven-release-plugin][skip ci] prepare for next development iteration 2022-08-10 10:02:03 +00:00
Travis CI User
3883fd22e3 [maven-release-plugin][skip ci] prepare release v1.106 2022-08-10 10:02:01 +00:00
Tom Page
183ac4c7cd ACS-3358 Remove demo tests. (#222)
These were only intended to demonstrate how to use the TAS library.

Also make tests run against all branches.
2022-08-10 10:58:00 +01:00
Travis CI User
fa1b8d46dd [maven-release-plugin][skip ci] prepare for next development iteration 2022-08-10 08:45:04 +00:00
Travis CI User
df35137d12 [maven-release-plugin][skip ci] prepare release v1.105 2022-08-10 08:45:02 +00:00
Damian Ujma
1d1b454978 ACS-3351 Upgrade to Java 17 (#219) 2022-08-10 10:36:45 +02:00
Travis CI User
deaee78d09 [maven-release-plugin][skip ci] prepare for next development iteration 2022-08-09 12:09:27 +00:00
Travis CI User
9e3c144a7d [maven-release-plugin][skip ci] prepare release v1.104 2022-08-09 12:09:24 +00:00
Tom Page
d0b100a88b ACS-3361 Support for inclusionType. (#221) 2022-08-09 13:05:51 +01:00
Travis CI User
9d807242ee [maven-release-plugin][skip ci] prepare for next development iteration 2022-08-09 11:21:44 +00:00
Travis CI User
5f2b5fe9af [maven-release-plugin][skip ci] prepare release v1.103 2022-08-09 11:21:43 +00:00
Marcin Strankowski
7edee67997 Move all versions under the rest-assured.version, update it to 5.1.1 (#220) 2022-08-09 13:17:55 +02:00
Travis CI User
5f151aaa96 [maven-release-plugin][skip ci] prepare for next development iteration 2022-08-08 14:20:54 +00:00
Travis CI User
dcf25d89d0 [maven-release-plugin][skip ci] prepare release v1.102 2022-08-08 14:20:51 +00:00
Tom Page
7d5aafecb5 ACS-3362 Add owningFolder field to rule set. (#218)
* ACS-3362 Add owningFolder field to rule set.

* ACS-3362 Allow passing include param.
2022-08-08 15:17:29 +01:00
Travis CI User
1d8f1bd8a2 [maven-release-plugin][skip ci] prepare for next development iteration 2022-08-05 13:58:04 +00:00
Travis CI User
fe04e621e1 [maven-release-plugin][skip ci] prepare release v1.101 2022-08-05 13:58:02 +00:00
krdabrowski
ee03296733 ACS-3360 GET APIs for rule sets E2E tests. (#217)
- fixed improper rest client method usage
2022-08-05 15:54:23 +02:00
Travis CI User
c5e89242ba [maven-release-plugin][skip ci] prepare for next development iteration 2022-08-02 12:30:42 +00:00
Travis CI User
0fbeffe80a [maven-release-plugin][skip ci] prepare release v1.100 2022-08-02 12:30:40 +00:00
Tom Page
d1e9cf0144 ACS-3360 TAS endpoints for GET rule sets. (#216) 2022-08-02 14:27:17 +02:00
Travis CI User
b51146c868 [maven-release-plugin][skip ci] prepare for next development iteration 2022-07-29 12:01:19 +00:00
Travis CI User
515f243911 [maven-release-plugin][skip ci] prepare release v1.99 2022-07-29 12:01:17 +00:00
dependabot[bot]
a7263931f5 Bump utility from 3.0.48 to 3.0.49 (#209) 2022-07-29 11:58:13 +00:00
Travis CI User
2c23c674a7 [maven-release-plugin][skip ci] prepare for next development iteration 2022-07-29 08:26:45 +00:00
Travis CI User
2b929b747a [maven-release-plugin][skip ci] prepare release v1.98 2022-07-29 08:26:44 +00:00
dependabot[bot]
1fd36cf903 Bump groovy from 3.0.11 to 3.0.12 (#214) 2022-07-29 08:23:47 +00:00
dependabot[bot]
d45bc9e6c6 Bump groovy-json from 3.0.11 to 3.0.12 (#215) 2022-07-29 08:23:43 +00:00
Travis CI User
6ae2ff6cd9 [maven-release-plugin][skip ci] prepare for next development iteration 2022-07-25 15:57:54 +00:00
133 changed files with 1958 additions and 2587 deletions

View File

@@ -2,18 +2,12 @@ dist: focal
sudo: required
language: java
jdk:
- openjdk11
- openjdk17
cache:
directories:
- $HOME/.m2/repository
branches:
only:
- master
install: travis_retry mvn install -DskipTests=true -B -V
stages:
- test
- release
@@ -22,7 +16,7 @@ jobs:
include:
- stage: test
name: "Build and test"
script: travis_retry mvn test -Dtest=ModelAssertionTest
script: travis_retry mvn -B -V -ntp test
- stage: release
name: "Push to Nexus"
if: fork = false AND branch = master AND type != pull_request AND commit_message !~ /\[no-release\]/
@@ -33,5 +27,5 @@ jobs:
- git checkout -B "${TRAVIS_BRANCH}"
# Add email to link commits to user
- git config user.email "${GIT_EMAIL}"
# Skip building of release commits
- mvn --batch-mode -DscmCommentPrefix="[maven-release-plugin][skip ci] " -Dusername="${GIT_USERNAME}" -Dpassword="${GIT_PASSWORD}" -DskipTests -Darguments=-DskipTests release:clean release:prepare release:perform
# Make release
- mvn --batch-mode -ntp -DscmCommentPrefix="[maven-release-plugin][skip ci] " -Dusername="${GIT_USERNAME}" -Dpassword="${GIT_PASSWORD}" -Darguments=-DskipTests release:clean release:prepare release:perform

View File

@@ -4,7 +4,7 @@
<groupId>org.alfresco.tas</groupId>
<artifactId>restapi</artifactId>
<name>alfresco-tas-restapi</name>
<version>1.97</version>
<version>1.128</version>
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-super-pom</artifactId>
@@ -28,13 +28,10 @@
<suiteXmlFile>src/main/resources/shared-resources/testCount.xml</suiteXmlFile>
<maven.build.sourceVersion>11</maven.build.sourceVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<tas.utility.version>3.0.48</tas.utility.version>
<rest-assured.version>3.3.0</rest-assured.version>
<tas.utility.version>3.0.56</tas.utility.version>
<rest-assured.version>5.2.0</rest-assured.version>
<httpclient-osgi-version>4.5.6</httpclient-osgi-version>
<json-path.version>3.3.0</json-path.version>
<xml-path.version>3.3.0</xml-path.version>
<json-schema-validator.version>3.3.0</json-schema-validator.version>
<jackson-databind.version>2.13.3</jackson-databind.version>
<jackson-databind.version>2.13.4</jackson-databind.version>
<maven-release.version>2.5.3</maven-release.version>
<org.glassfish.version>1.1.4</org.glassfish.version>
<commons-lang3.version>3.12.0</commons-lang3.version>
@@ -70,7 +67,7 @@
<connection>scm:git:https://github.com/Alfresco/alfresco-tas-restapi.git</connection>
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-tas-restapi.git</developerConnection>
<url>https://github.com/Alfresco/alfresco-tas-restapi</url>
<tag>v1.97</tag>
<tag>v1.128</tag>
</scm>
<issueManagement>
@@ -264,7 +261,7 @@
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>json-path</artifactId>
<version>${json-path.version}</version>
<version>${rest-assured.version}</version>
<exclusions>
<exclusion>
<artifactId>commons-lang3</artifactId>
@@ -276,7 +273,7 @@
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>xml-path</artifactId>
<version>${xml-path.version}</version>
<version>${rest-assured.version}</version>
<exclusions>
<exclusion>
<artifactId>commons-lang3</artifactId>
@@ -288,7 +285,7 @@
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>json-schema-validator</artifactId>
<version>${json-schema-validator.version}</version>
<version>${rest-assured.version}</version>
</dependency>
<dependency>
@@ -311,13 +308,6 @@
<version>${org.glassfish.version}</version>
</dependency>
<!-- needed for swagger parser bellow -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
</dependency>
<!-- swagger parser -->
<dependency>
<groupId>io.swagger</groupId>
@@ -342,16 +332,22 @@
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>3.0.11</version>
<version>3.0.12</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-json-->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-json</artifactId>
<version>3.0.11</version>
</dependency>
<version>3.0.12</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.8.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<reporting>
@@ -359,7 +355,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.4.0</version>
<version>3.4.1</version>
<reportSets>
<reportSet>
<reports>

View File

@@ -28,7 +28,5 @@ package org.alfresco.rest.core;
import org.alfresco.rest.core.assertion.IModelAssertion;
public interface IRestModel<Model> extends IModelAssertion<Model> {
public Model onModel();
Model onModel();
}

View File

@@ -30,14 +30,14 @@ import static org.alfresco.utility.report.log.Step.STEP;
import java.util.List;
import java.util.Random;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.assertion.IModelsCollectionAssertion;
import org.alfresco.rest.core.assertion.ModelsCollectionAssertion;
import org.alfresco.rest.exception.EmptyRestModelCollectionException;
import org.alfresco.rest.model.RestPaginationModel;
import org.alfresco.rest.model.RestSiteModelsCollection;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Map multiple entries of JSON response to a class <T>
*
@@ -119,7 +119,7 @@ public abstract class RestModels<Model, ModelCollection> implements IRestModelsC
@Override
public ModelsCollectionAssertion<RestModels<Model, ModelCollection>> assertThat()
{
return new ModelsCollectionAssertion<RestModels<Model, ModelCollection>>(this);
return new ModelsCollectionAssertion<>(this);
}
@Override

View File

@@ -27,16 +27,21 @@ package org.alfresco.rest.core;
import static org.alfresco.utility.report.log.Step.STEP;
import org.springframework.http.HttpMethod;
import java.util.MissingFormatArgumentException;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import io.restassured.RestAssured;
import org.springframework.http.HttpMethod;
/**
* @author Paul Brodner
*/
public class RestRequest
{
private String body = "";
private static final String TOKEN_REGEX = "\\{.*?}";
private String body;
private HttpMethod httpMethod;
private String path;
private Object[] pathParams;
@@ -44,10 +49,7 @@ public class RestRequest
private RestRequest(HttpMethod httpMethod, String path, String... pathParams)
{
setHttpMethod(httpMethod);
setPath(path);
setPathParams(pathParams);
STEP(toString());
this(httpMethod, "", path, pathParams);
}
private RestRequest(HttpMethod httpMethod, String body, String path, String... pathParams)
@@ -56,7 +58,8 @@ public class RestRequest
setPath(path);
setPathParams(pathParams);
setBody(body);
STEP(toString());
// Validate that the supplied path and pathParams are compatible.
constructPath();
}
/**
@@ -114,6 +117,7 @@ public class RestRequest
public void setPath(String path)
{
this.path = path;
addQueryParamsIfNeeded();
}
public Object[] getPathParams()
@@ -124,6 +128,32 @@ public class RestRequest
public void setPathParams(Object[] pathParams)
{
this.pathParams = pathParams;
addQueryParamsIfNeeded();
}
/**
* Add query parameters to the path if needed.
* <p>
* e.g. For a path of "api/{fruit}" and params ["apple", "size=10", "colour=red"] then this will
* update the path to be "api/{fruit}?{param0}&{param1}" so that the tokens will be populated by
* RestAssured to make "api/apple?size=10&colour=red".
*/
private void addQueryParamsIfNeeded()
{
// Don't do anything if the path or path params haven't been set yet.
if (path == null || path.length() == 0 || pathParams == null)
{
return;
}
int groupCount = (int) Pattern.compile(TOKEN_REGEX).matcher(path).results().count();
if (pathParams.length > groupCount)
{
// Add the remaining parameters to the URL query.
String queryParams = IntStream.range(0, pathParams.length - groupCount)
.mapToObj(index -> "{parameter" + index + "}")
.collect(Collectors.joining("&"));
path += (path.contains("?") ? "&" : "?") + queryParams;
}
}
public String getContentType()
@@ -136,6 +166,10 @@ public class RestRequest
this.contentType = contentType;
}
/**
* {@inheritDoc}
* @throws MissingFormatArgumentException If there are not enough pathParams for the path.
*/
@Override
public String toString()
{
@@ -149,14 +183,8 @@ public class RestRequest
.append("/")
.append(RestAssured.basePath)
.append("/");
String getPathFormatted = getPath();
if(getPath().contains("{"))
{
getPathFormatted = getPath().replaceAll("\\{.*?}", "%s");
getPathFormatted = String.format(getPathFormatted, getPathParams());
}
sb.append(getPathFormatted);
sb.append(constructPath());
if(!getBody().isEmpty())
{
@@ -168,4 +196,21 @@ public class RestRequest
return sb.toString();
}
/**
* Populate the path with the pathParams.
*
* @return The path with tokens replaced with values.
* @throws MissingFormatArgumentException If there are not enough pathParams for the path.
*/
private String constructPath()
{
String getPathFormatted = getPath();
if(getPath().contains("{"))
{
getPathFormatted = getPath().replaceAll(TOKEN_REGEX, "%s");
getPathFormatted = String.format(getPathFormatted, getPathParams());
}
return getPathFormatted;
}
}

View File

@@ -39,6 +39,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import javax.xml.parsers.DocumentBuilder;
@@ -76,6 +77,7 @@ import org.alfresco.utility.dsl.DSLWrapper;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.TestModel;
import org.alfresco.utility.model.UserModel;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.apache.xml.serialize.OutputFormat;
@@ -619,7 +621,16 @@ public class RestWrapper extends DSLWrapper<RestWrapper>
*/
protected Response sendRequest(RestRequest restRequest)
{
Response returnedResponse = null;
// If there are unused parameters then include them in the request.
String parameters = getParameters();
if (parameters != null && !parameters.isEmpty())
{
restRequest.setPathParams(ArrayUtils.addAll(restRequest.getPathParams(), parameters));
}
STEP(restRequest.toString());
Response returnedResponse;
switch (restRequest.getHttpMethod())
{
case GET:
@@ -628,7 +639,6 @@ public class RestWrapper extends DSLWrapper<RestWrapper>
case DELETE:
returnedResponse = onRequest().delete(restRequest.getPath(), restRequest.getPathParams()).andReturn();
break;
case HEAD:
returnedResponse = onRequest().head(restRequest.getPath(), restRequest.getPathParams()).andReturn();
break;
@@ -866,6 +876,8 @@ public class RestWrapper extends DSLWrapper<RestWrapper>
}
/**
* Get and clear the stored parameters.
*
* @return parameters that you could pass on the request ?param=value
*/
public String getParameters()
@@ -906,26 +918,17 @@ public class RestWrapper extends DSLWrapper<RestWrapper>
}
/**
* Send key=value parameters
* All of them will be automatically passed to url.
* Example: "maxItems=10000"
*
* @param parameters
* @return
* Send key=value parameters.
* <p>
* Note that this will replace any existing parameters.
*
* @param parameters A list of URL query parameters - e.g. "maxItems=10000"
* @return The RestWrapper
*/
public RestWrapper withParams(String... parameters)
{
StringBuilder paramsUrl = new StringBuilder();
String delimiter = (parameters.length > 1 ? "&" : "");
for (int i = 0; i < parameters.length; i++)
{
paramsUrl.append(parameters[i]);
if (i < parameters.length - 1)
paramsUrl.append(delimiter);
}
setParameters(paramsUrl.toString());
String paramsStr = Arrays.stream(parameters).collect(Collectors.joining("&"));
setParameters(paramsStr);
return this;
}

View File

@@ -4,30 +4,36 @@
* %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.rest.core.assertion;
public interface IModelAssertion<Model>
public interface IModelAssertion<Model>
{
public ModelAssertion<Model> and();
public ModelAssertion<Model> assertThat();
default ModelAssertion<Model> assertThat()
{
return new ModelAssertion<>(this);
}
default ModelAssertion<Model> and()
{
return assertThat();
}
}

View File

@@ -31,5 +31,9 @@ public interface IModelsCollectionAssertion<ModelCollection> {
public ModelsCollectionAssertion assertThat();
public ModelCollection when();
@SuppressWarnings("unchecked")
default ModelCollection when()
{
return (ModelCollection) this;
}
}

View File

@@ -33,14 +33,16 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import io.restassured.path.json.JsonPath;
import org.alfresco.utility.exception.TestConfigurationException;
import org.alfresco.utility.model.TestModel;
import org.testng.Assert;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.restassured.path.json.JsonPath;
/**
* Assertion on Rest Model
* Just pass your rest model as constructor
@@ -57,7 +59,7 @@ public class ModelAssertion<T>
Assert.fail(String.format("Field {%s} was not found in returned response.",fieldNameToBeRetuned));
}
}
private Object model;
private final Object model;
public ModelAssertion(Object model)
{
@@ -66,10 +68,11 @@ public class ModelAssertion<T>
/**
* Use this DSL for asserting particular fields of your model if your model
* is like this (basic POJO) public class Person extends
* ModelAssertion<Person> { private String id = "1234"; you can use assert
* the id of this person as:
* Person p = new Person(); p.assertField("id").is("1234")
* is like this (basic POJO)
* public class Person extends ModelAssertion<Person>
* { private String id = "1234"; }
* you can use assert the id of this person as:
* Person p = new Person(); p.assertThat().field("id").is("1234")
*
* @param fieldName
* @return
@@ -120,6 +123,24 @@ public class ModelAssertion<T>
return new AssertionItemVerbs(model, actualSize);
}
/**
* Use this method for asserting whole model with different model object. Method allows to ignore particular fields during the comparison.
*
* WARNING: For proper work model should implement {@code toString()} and {@code equals()} methods.
*
* @param expected - expected model.
* @param ignoreFields - fields which should be ignored during assertion.
* @return model.
*/
@SuppressWarnings("unchecked")
public T isEqualTo(T expected, String... ignoreFields)
{
T modelCopy = createCopyIgnoringFields((T) model, ignoreFields);
T expectedCopy = createCopyIgnoringFields(expected, ignoreFields);
Assert.assertEquals(modelCopy, expectedCopy, String.format("Compared objects of type: %s are not equal!", model.getClass()));
return (T) model;
}
/**
* Get all fields declared from all classes hierarchy
*
@@ -144,6 +165,18 @@ public class ModelAssertion<T>
return fields;
}
@SuppressWarnings("unchecked")
private T createCopyIgnoringFields(T model, String... ignoreFields)
{
Gson gson = new Gson();
JsonObject jsonObject = gson.fromJson(gson.toJson(model), JsonObject.class);
for (String ignoreField : ignoreFields)
{
jsonObject.remove(ignoreField);
}
return gson.fromJson(gson.toJson(jsonObject), (Class<? extends T>) model.getClass());
}
/**
* DSL assertion on Rest Model fields
*
@@ -272,7 +305,19 @@ public class ModelAssertion<T>
public T contains(String value)
{
if (!fieldValue.toString().contains(value))
{
Assert.fail(errorMessage("does NOT contain expected value: " + value + ", Current Value: " + fieldValue.toString()));
}
return (T) model;
}
public T notContains(String value)
{
if (fieldValue.toString().contains(value))
{
Assert.fail(errorMessage("does contain unexpected value: " + value + ", Current Value: " + fieldValue.toString()));
}
return (T) model;
}

View File

@@ -25,13 +25,13 @@
*/
package org.alfresco.rest.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestAbstractClassModel extends TestModel implements IRestModel<RestAbstractClassModel>
{
@JsonProperty(value = "entry")
@@ -164,20 +164,4 @@ public class RestAbstractClassModel extends TestModel implements IRestModel<Rest
{
this.modelInfo = modelInfo;
}
/**
* DSL for assertion on this rest model
* @return
*/
@Override
public ModelAssertion<RestAbstractClassModel> assertThat()
{
return new ModelAssertion<RestAbstractClassModel>(this);
}
@Override
public ModelAssertion<RestAbstractClassModel> and()
{
return assertThat();
}
}

View File

@@ -25,14 +25,13 @@
*/
package org.alfresco.rest.model;
import java.util.List;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'Kristian.Dimitrov@hyland.com' on '2022-07-14 13:22' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
@@ -40,18 +39,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class RestActionBodyExecTemplateModel extends TestModel implements IRestModel<RestActionBodyExecTemplateModel>
{
@Override
public ModelAssertion<RestActionBodyExecTemplateModel> assertThat()
{
return new ModelAssertion<RestActionBodyExecTemplateModel>(this);
}
@Override
public ModelAssertion<RestActionBodyExecTemplateModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestActionBodyExecTemplateModel model;
@@ -85,6 +72,29 @@ public class RestActionBodyExecTemplateModel extends TestModel implements IRestM
public void setParams(Object params)
{
this.params = params;
}
}
@Override
public String toString()
{
return "RestActionBodyExecTemplateModel{" + "actionDefinitionId='" + actionDefinitionId + '\'' + ", params=" + params + '}';
}
@Override
public boolean equals(Object o)
{
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
RestActionBodyExecTemplateModel that = (RestActionBodyExecTemplateModel) o;
return Objects.equals(actionDefinitionId, that.actionDefinitionId) && Objects.equals(params, that.params);
}
@Override
public int hashCode()
{
return Objects.hash(actionDefinitionId, params);
}
}

View File

@@ -26,11 +26,12 @@
package org.alfresco.rest.model;
import java.util.List;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestActionDefinitionModel extends TestModel implements IRestModel<RestActionDefinitionModel>
{
@@ -125,18 +126,6 @@ public class RestActionDefinitionModel extends TestModel implements IRestModel<R
this.parameterDefinitions = parameterDefinitions;
}
@Override
public ModelAssertion<RestActionDefinitionModel> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestActionDefinitionModel> assertThat()
{
return new ModelAssertion<RestActionDefinitionModel>(this);
}
@Override
public RestActionDefinitionModel onModel()
{

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
*
* @author Cristina Axinte
@@ -159,17 +158,4 @@ public class RestActivityModel extends TestModel implements IRestModel<RestActiv
{
this.activitySummary = activitySummary;
}
@Override
public ModelAssertion<RestActivityModel> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestActivityModel> assertThat()
{
return new ModelAssertion<RestActivityModel>(this);
}
}

View File

@@ -25,13 +25,12 @@
*/
package org.alfresco.rest.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
* "activitySummary": {
@@ -142,14 +141,4 @@ public class RestActivitySummaryModel extends TestModel implements IRestModel<Re
{
this.objectId = objectId;
}
@Override
public ModelAssertion<RestActivitySummaryModel> and() {
return assertThat();
}
@Override
public ModelAssertion<RestActivitySummaryModel> assertThat() {
return new ModelAssertion<RestActivitySummaryModel>(this);
}
}

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestAggregateModel extends TestModel implements IRestModel<RestAggregateModel>
{
@JsonProperty(value = "aggregate")
@@ -65,16 +64,4 @@ public class RestAggregateModel extends TestModel implements IRestModel<RestAggr
{
this.average = average;
}
@Override
public ModelAssertion<RestAggregateModel> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestAggregateModel> assertThat()
{
return new ModelAssertion<RestAggregateModel>(this);
}
}

View File

@@ -31,12 +31,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'dedwards' on '2021-12-16 08:32' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
@@ -44,18 +43,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class RestArchiveContentRequestModel extends TestModel implements IRestModel<RestArchiveContentRequestModel>
{
@Override
public ModelAssertion<RestArchiveContentRequestModel> assertThat()
{
return new ModelAssertion<RestArchiveContentRequestModel>(this);
}
@Override
public ModelAssertion<RestArchiveContentRequestModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestArchiveContentRequestModel model;

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'aepure' on '2017-06-29 15:31' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
@@ -38,18 +37,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class RestAuditAppModel extends TestModel implements IRestModel<RestAuditAppModel>
{
@Override
public ModelAssertion<RestAuditAppModel> assertThat()
{
return new ModelAssertion<RestAuditAppModel>(this);
}
@Override
public ModelAssertion<RestAuditAppModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestAuditAppModel model;

View File

@@ -27,26 +27,13 @@ package org.alfresco.rest.model;
import java.util.Map;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestAuditEntryModel extends TestModel implements IRestModel<RestAuditEntryModel>
{
@Override
public ModelAssertion<RestAuditEntryModel> assertThat()
{
return new ModelAssertion<RestAuditEntryModel>(this);
}
@Override
public ModelAssertion<RestAuditEntryModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestAuditEntryModel model;

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestCandidateModel extends TestModel implements IRestModel<RestCandidateModel>
{
@JsonProperty(value = "entry")
@@ -69,16 +68,4 @@ public class RestCandidateModel extends TestModel implements IRestModel<RestCand
{
this.candidateId = candidateId;
}
@Override
public ModelAssertion<RestCandidateModel> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestCandidateModel> assertThat()
{
return new ModelAssertion<RestCandidateModel>(this);
}
}

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestCommentModel extends TestModel implements IRestModel<RestCommentModel>
{
@JsonProperty(value = "entry")
@@ -141,17 +140,4 @@ public class RestCommentModel extends TestModel implements IRestModel<RestCommen
{
this.id = id;
}
@Override
public ModelAssertion<RestCommentModel> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestCommentModel> assertThat()
{
return new ModelAssertion<RestCommentModel>(this);
}
}
}

View File

@@ -25,7 +25,9 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.assertion.ModelAssertion;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
@@ -40,8 +42,10 @@ import org.alfresco.utility.model.TestModel;
"email": "qLZ41D2QnXQcqySNK09J@yahoo.com"
}
*/
public class RestCompanyModel extends TestModel
public class RestCompanyModel extends TestModel implements IRestModel<RestCompanyModel>
{
@JsonProperty (value = "entry")
RestCompanyModel model;
private String organization;
private String address1;
private String address2;
@@ -51,16 +55,12 @@ public class RestCompanyModel extends TestModel
private String fax;
private String email;
public ModelAssertion<RestCompanyModel> assertThat()
@Override
public RestCompanyModel onModel()
{
return new ModelAssertion<RestCompanyModel>(this);
return model;
}
public ModelAssertion<RestCompanyModel> and()
{
return assertThat();
}
public String getOrganization()
{
return organization;
@@ -140,5 +140,4 @@ public class RestCompanyModel extends TestModel
{
this.email = email;
}
}

View File

@@ -26,13 +26,13 @@
package org.alfresco.rest.model;
import java.util.List;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'Kristian.Dimitrov@hyland.com' on '2022-07-13 15:53' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
@@ -40,18 +40,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class RestCompositeConditionDefinitionModel extends TestModel implements IRestModel<RestCompositeConditionDefinitionModel>
{
@Override
public ModelAssertion<RestCompositeConditionDefinitionModel> assertThat()
{
return new ModelAssertion<RestCompositeConditionDefinitionModel>(this);
}
@Override
public ModelAssertion<RestCompositeConditionDefinitionModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestCompositeConditionDefinitionModel model;
@@ -120,6 +108,31 @@ public class RestCompositeConditionDefinitionModel extends TestModel implements
public void setSimpleConditions(List<RestSimpleConditionDefinitionModel> simpleConditions)
{
this.simpleConditions = simpleConditions;
}
}
@Override
public String toString()
{
return "RestCompositeConditionDefinitionModel{" + "inverted=" + inverted + ", booleanMode='" + booleanMode + '\'' + ", compositeConditions=" + compositeConditions
+ ", simpleConditions=" + simpleConditions + '}';
}
@Override
public boolean equals(Object o)
{
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
RestCompositeConditionDefinitionModel that = (RestCompositeConditionDefinitionModel) o;
return inverted == that.inverted && Objects.equals(booleanMode, that.booleanMode) && Objects.equals(compositeConditions, that.compositeConditions) && Objects.equals(
simpleConditions, that.simpleConditions);
}
@Override
public int hashCode()
{
return Objects.hash(inverted, booleanMode, compositeConditions, simpleConditions);
}
}

View File

@@ -33,12 +33,11 @@ package org.alfresco.rest.model;
import java.util.Map;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'dedwards' on '2021-12-16 08:32' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
@@ -46,18 +45,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class RestContentStorageInfoModel extends TestModel implements IRestModel<RestContentStorageInfoModel>
{
@Override
public ModelAssertion<RestContentStorageInfoModel> assertThat()
{
return new ModelAssertion<RestContentStorageInfoModel>(this);
}
@Override
public ModelAssertion<RestContentStorageInfoModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestContentStorageInfoModel model;

View File

@@ -28,31 +28,18 @@ package org.alfresco.rest.model;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.CustomAspectModel;
import org.alfresco.utility.model.CustomAspectPropertiesModel;
import org.testng.Assert;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* @author Bogdan Bocancea
*/
public class RestCustomAspectModel extends CustomAspectModel implements IRestModel<RestCustomAspectModel>
{
@Override
public ModelAssertion<RestCustomAspectModel> assertThat()
{
return new ModelAssertion<RestCustomAspectModel>(this);
}
@Override
public ModelAssertion<RestCustomAspectModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestCustomAspectModel model;

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.CustomContentModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.CustomContentModel;
/**
* @author Bogdan Bocancea
*/
@@ -39,18 +38,6 @@ public class RestCustomModel extends CustomContentModel implements IRestModel<Re
@JsonProperty(value = "entry")
RestCustomModel model;
@Override
public ModelAssertion<RestCustomModel> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestCustomModel> assertThat()
{
return new ModelAssertion<>(this);
}
@Override
public RestCustomModel onModel()
{

View File

@@ -25,14 +25,14 @@
*/
package org.alfresco.rest.model;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.CustomAspectPropertiesModel;
import org.alfresco.utility.model.TestModel;
import java.util.List;
/**
* @author Bogdan Bocancea
*/
@@ -80,18 +80,6 @@ public class RestCustomTypeModel extends TestModel implements IRestModel<RestCus
return model;
}
@Override
public ModelAssertion<RestCustomTypeModel> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestCustomTypeModel> assertThat()
{
return new ModelAssertion<RestCustomTypeModel>(this);
}
public String getName()
{
return name;

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Handles single Deployment Entry JSON response
* "entry": {
@@ -108,16 +107,4 @@ public class RestDeploymentModel extends TestModel implements IRestModel<RestDep
{
this.deployedAt = deployedAt;
}
@Override
public ModelAssertion<RestDeploymentModel> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestDeploymentModel> assertThat()
{
return new ModelAssertion<>(this);
}
}
}

View File

@@ -25,26 +25,13 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestDiscoveryModel extends TestModel implements IRestModel<RestDiscoveryModel>
{
@Override
public ModelAssertion<RestDiscoveryModel> assertThat()
{
return new ModelAssertion<RestDiscoveryModel>(this);
}
@Override
public ModelAssertion<RestDiscoveryModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestDiscoveryModel model;

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/*
* Handles responses for GET /downloads/{downloadId} and POST /downloads rest calls
* E.g
@@ -48,18 +47,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
public class RestDownloadsModel extends TestModel implements IRestModel<RestDownloadsModel>
{
@Override
public ModelAssertion<RestDownloadsModel> assertThat()
{
return new ModelAssertion<RestDownloadsModel>(this);
}
@Override
public ModelAssertion<RestDownloadsModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestDownloadsModel model;

View File

@@ -4,21 +4,21 @@
* %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
@@ -26,30 +26,17 @@
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Generated by 'aforascu' on '2018-01-10 16:02' from 'Alfresco Content Services REST API' swagger file
* Generated by 'saspery' on '2022-09-28 06:54' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
* Base Path {@linkplain /alfresco/api}
*/
public class RestEntitlementsInfoModel extends TestModel implements IRestModel<RestEntitlementsInfoModel>
{
@Override
public ModelAssertion<RestEntitlementsInfoModel> assertThat()
{
return new ModelAssertion<RestEntitlementsInfoModel>(this);
}
@Override
public ModelAssertion<RestEntitlementsInfoModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestEntitlementsInfoModel model;
@@ -68,6 +55,8 @@ public class RestEntitlementsInfoModel extends TestModel implements IRestModel<R
private boolean isCryptodocEnabled;
private boolean isCustomEmbeddedWorkflowEnabled;
public int getMaxUsers()
{
return this.maxUsers;
@@ -107,5 +96,15 @@ public class RestEntitlementsInfoModel extends TestModel implements IRestModel<R
{
this.isCryptodocEnabled = isCryptodocEnabled;
}
public boolean getIsCustomEmbeddedWorkflowEnabled()
{
return this.isCustomEmbeddedWorkflowEnabled;
}
public void setIsCustomEmbeddedWorkflowEnabled(boolean isCustomEmbeddedWorkflowEnabled)
{
this.isCustomEmbeddedWorkflowEnabled = isCustomEmbeddedWorkflowEnabled;
}
}

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestFavoriteSiteModel extends TestModel implements IRestModel<RestFavoriteSiteModel>
{
@JsonProperty(value = "entry")
@@ -52,16 +51,4 @@ public class RestFavoriteSiteModel extends TestModel implements IRestModel<RestF
{
this.id = id;
}
@Override
public ModelAssertion<RestFavoriteSiteModel> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestFavoriteSiteModel> assertThat()
{
return new ModelAssertion<RestFavoriteSiteModel>(this);
}
}
}

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Handles single Folder JSON responses
* Example:
@@ -270,16 +269,4 @@ public class RestFileModel extends TestModel implements IRestModel<RestFileModel
{
this.path = path;
}
@Override
public ModelAssertion<RestFileModel> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestFileModel> assertThat()
{
return new ModelAssertion<RestFileModel>(this);
}
}

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Handles single Folder JSON responses
* Example:
@@ -217,16 +216,4 @@ public class RestFolderModel extends TestModel implements IRestModel<RestFolderM
{
this.path = path;
}
@Override
public ModelAssertion<RestFolderModel> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestFolderModel> assertThat()
{
return new ModelAssertion<RestFolderModel>(this);
}
}

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Handles single representation of a Start Form Model
* * "entry": {
@@ -133,20 +132,4 @@ public class RestFormModel extends TestModel implements IRestModel<RestFormModel
{
this.required = required;
}
/**
* DSL for assertion on this rest model
* @return
*/
@Override
public ModelAssertion<RestFormModel> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestFormModel> assertThat()
{
return new ModelAssertion<RestFormModel>(this);
}
}
}

View File

@@ -27,13 +27,12 @@ package org.alfresco.rest.model;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.rest.search.RestGenericMetricModel;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Generated by 'msuzuki' on '2017-05-15 13:08' from 'Alfresco Search REST API' swagger file
* Generated from 'Alfresco Search REST API' swagger file
@@ -41,18 +40,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class RestGenericBucketModel extends TestModel implements IRestModel<RestGenericBucketModel>
{
@Override
public ModelAssertion<RestGenericBucketModel> assertThat()
{
return new ModelAssertion<RestGenericBucketModel>(this);
}
@Override
public ModelAssertion<RestGenericBucketModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestGenericBucketModel model;

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestGroupMember extends TestModel implements IRestModel<RestGroupMember>
{
@JsonProperty(required = true)
@@ -43,19 +42,6 @@ public class RestGroupMember extends TestModel implements IRestModel<RestGroupMe
@JsonProperty(value = "entry")
RestGroupMember model;
@Override
public ModelAssertion<RestGroupMember> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestGroupMember> assertThat()
{
return new ModelAssertion<RestGroupMember>(this);
}
@Override
public RestGroupMember onModel()
{

View File

@@ -27,12 +27,11 @@ package org.alfresco.rest.model;
import java.util.ArrayList;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestGroupsModel extends TestModel implements IRestModel<RestGroupsModel>
{
@JsonProperty(required = true)
@@ -50,19 +49,6 @@ public class RestGroupsModel extends TestModel implements IRestModel<RestGroupsM
@JsonProperty(value = "entry")
RestGroupsModel model;
@Override
public ModelAssertion<RestGroupsModel> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestGroupsModel> assertThat()
{
return new ModelAssertion<RestGroupsModel>(this);
}
@Override
public RestGroupsModel onModel()
{

View File

@@ -27,12 +27,10 @@ package org.alfresco.rest.model;
import static org.alfresco.utility.report.log.Step.STEP;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.Utility;
import org.testng.Assert;
import io.restassured.http.Headers;
import io.restassured.response.ResponseBody;
import org.alfresco.utility.Utility;
import org.testng.Assert;
/**
* Created by Claudia Agache on 10/13/2016.
@@ -68,21 +66,6 @@ public class RestHtmlResponse
Assert.assertFalse(body.toString().isEmpty(), "Body should not be empty.");
}
/**
* DSL for assertion on this rest model
*
* @return
*/
public ModelAssertion<RestHtmlResponse> assertThat()
{
return new ModelAssertion<RestHtmlResponse>(this);
}
public ModelAssertion<RestHtmlResponse> and()
{
return assertThat();
}
/**
* Assetion that a html element with specific html path has the specified value
*

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
*
"entry": {
@@ -130,16 +129,4 @@ public class RestItemModel extends TestModel implements IRestModel<RestItemModel
{
this.modifiedAt = modifiedAt;
}
@Override
public ModelAssertion<RestItemModel> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestItemModel> assertThat()
{
return new ModelAssertion<RestItemModel>(this);
}
}

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'aforascu' on '2018-01-10 16:02' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
@@ -38,18 +37,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class RestLicenseInfoModel extends TestModel implements IRestModel<RestLicenseInfoModel>
{
@Override
public ModelAssertion<RestLicenseInfoModel> assertThat()
{
return new ModelAssertion<RestLicenseInfoModel>(this);
}
@Override
public ModelAssertion<RestLicenseInfoModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestLicenseInfoModel model;

View File

@@ -25,14 +25,11 @@
*/
package org.alfresco.rest.model;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Generated by 'Kristian.Dimitrov@hyland.com' on '2022-07-13 15:53' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
@@ -40,18 +37,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class RestLinkedRuleSetBodyCreateModel extends TestModel implements IRestModel<RestLinkedRuleSetBodyCreateModel>
{
@Override
public ModelAssertion<RestLinkedRuleSetBodyCreateModel> assertThat()
{
return new ModelAssertion<RestLinkedRuleSetBodyCreateModel>(this);
}
@Override
public ModelAssertion<RestLinkedRuleSetBodyCreateModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestLinkedRuleSetBodyCreateModel model;

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'aforascu' on '2018-01-10 16:02' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
@@ -38,18 +37,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class RestModuleInfoModel extends TestModel implements IRestModel<RestModuleInfoModel>
{
@Override
public ModelAssertion<RestModuleInfoModel> assertThat()
{
return new ModelAssertion<RestModuleInfoModel>(this);
}
@Override
public ModelAssertion<RestModuleInfoModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestModuleInfoModel model;

View File

@@ -27,13 +27,12 @@ package org.alfresco.rest.model;
import static org.alfresco.utility.report.log.Step.STEP;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.UserModel;
import org.testng.Assert;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Created by Cristina Axinte on 9/26/2016.
*
@@ -89,20 +88,4 @@ public class RestNetworkModel extends RestPersonNetworkModel implements IRestMod
return this;
}
/**
* DSL for assertion on this rest model
* @return
*/
@Override
public ModelAssertion<RestNetworkModel> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestNetworkModel> assertThat()
{
return new ModelAssertion<RestNetworkModel>(this);
}
}
}

View File

@@ -25,30 +25,17 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'pbrodner' on '2016-12-19 14:12' from 'Alfresco Core REST API' swagger file
* Base Path {@linkplain /alfresco/api/-default-/public/alfresco/versions/1}
*/
public class RestNetworkQuotaModel extends TestModel implements IRestModel<RestNetworkQuotaModel>
{
@Override
public ModelAssertion<RestNetworkQuotaModel> assertThat()
{
return new ModelAssertion<RestNetworkQuotaModel>(this);
}
@Override
public ModelAssertion<RestNetworkQuotaModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestNetworkQuotaModel model;

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestNodeAssocTargetModel extends TestModel implements IRestModel<RestNodeAssocTargetModel>
{
@JsonProperty(value = "aggregate")
@@ -77,17 +76,4 @@ public class RestNodeAssocTargetModel extends TestModel implements IRestModel<Re
{
this.assocType = assocType;
}
@Override
public ModelAssertion<RestNodeAssocTargetModel> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestNodeAssocTargetModel> assertThat()
{
return new ModelAssertion<RestNodeAssocTargetModel>(this);
}
}

View File

@@ -27,29 +27,16 @@ package org.alfresco.rest.model;
import java.util.List;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Created by Andrei Forascu on 30/08/2017.
*/
public class RestNodeAssociationModel extends TestModel implements IRestModel<RestNodeAssociationModel>
{
@Override
public ModelAssertion<RestNodeAssociationModel> assertThat()
{
return new ModelAssertion<RestNodeAssociationModel>(this);
}
@Override
public ModelAssertion<RestNodeAssociationModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestNodeAssociationModel model;

View File

@@ -25,29 +25,16 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Represents an association between two nodes
*/
public class RestNodeAssociationTypeModel extends TestModel implements IRestModel<RestNodeAssociationTypeModel>
{
@Override
public ModelAssertion<RestNodeAssociationTypeModel> assertThat()
{
return new ModelAssertion<RestNodeAssociationTypeModel>(this);
}
@Override
public ModelAssertion<RestNodeAssociationTypeModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestNodeAssociationTypeModel model;

View File

@@ -27,30 +27,17 @@ package org.alfresco.rest.model;
import java.util.List;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated from 'Alfresco Core REST API' swagger file
* Base Path {@linkplain /alfresco/api/-default-/public/alfresco/versions/1}
*/
public class RestNodeBodyModel extends TestModel implements IRestModel<RestNodeBodyModel>
{
@Override
public ModelAssertion<RestNodeBodyModel> assertThat()
{
return new ModelAssertion<RestNodeBodyModel>(this);
}
@Override
public ModelAssertion<RestNodeBodyModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestNodeBodyModel model;

View File

@@ -25,26 +25,13 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestNodeChildAssociationModel extends TestModel implements IRestModel<RestNodeChildAssociationModel>
{
@Override
public ModelAssertion<RestNodeChildAssociationModel> assertThat()
{
return new ModelAssertion<RestNodeChildAssociationModel>(this);
}
@Override
public ModelAssertion<RestNodeChildAssociationModel> and()
{
return assertThat();
}
@Override
public RestNodeChildAssociationModel onModel()
{

View File

@@ -27,30 +27,17 @@ package org.alfresco.rest.model;
import java.util.List;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated from 'Alfresco Core REST API' swagger file
* Base Path {@linkplain /alfresco/api/-default-/public/alfresco/versions/1}
*/
public class RestNodeModel extends TestModel implements IRestModel<RestNodeModel>
{
@Override
public ModelAssertion<RestNodeModel> assertThat()
{
return new ModelAssertion<RestNodeModel>(this);
}
@Override
public ModelAssertion<RestNodeModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestNodeModel model;

View File

@@ -26,7 +26,6 @@
package org.alfresco.rest.model;
import org.alfresco.rest.core.assertion.IModelAssertion;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
/**
@@ -107,16 +106,4 @@ public class RestPaginationModel extends TestModel implements IModelAssertion<Re
{
this.maxItems = maxItems;
}
@Override
public ModelAssertion<RestPaginationModel> assertThat()
{
return new ModelAssertion<>(this);
}
@Override
public ModelAssertion<RestPaginationModel> and()
{
return assertThat();
}
}
}

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestParameterDefinitionModel extends TestModel implements IRestModel<RestParameterDefinitionModel>
{
private String name;
@@ -113,18 +112,6 @@ public class RestParameterDefinitionModel extends TestModel implements IRestMode
@JsonProperty(value = "entry")
RestParameterDefinitionModel parameterDefinitionModel;
@Override
public ModelAssertion<RestParameterDefinitionModel> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestParameterDefinitionModel> assertThat()
{
return new ModelAssertion<RestParameterDefinitionModel>(this);
}
@Override
public RestParameterDefinitionModel onModel()
{

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestPersonFavoritesModel extends TestModel implements IRestModel<RestPersonFavoritesModel>
{
@JsonProperty(value = "entry")
@@ -87,17 +86,4 @@ public class RestPersonFavoritesModel extends TestModel implements IRestModel<Re
{
this.createdAt = createdAt;
}
@Override
public ModelAssertion<RestPersonFavoritesModel> assertThat()
{
return new ModelAssertion<>(this);
}
@Override
public ModelAssertion<RestPersonFavoritesModel> and()
{
return assertThat();
}
}
}

View File

@@ -28,36 +28,17 @@ package org.alfresco.rest.model;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.IModelAssertion;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Person Model implementation
*/
public class RestPersonModel extends TestModel implements IModelAssertion<RestPersonModel>, IRestModel<RestPersonModel>
{
/**
* DSL for assertion on this rest model
*
* @return
*/
@Override
public ModelAssertion<RestPersonModel> assertThat()
{
return new ModelAssertion<RestPersonModel>(this);
}
@Override
public ModelAssertion<RestPersonModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestPersonModel personModel;

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Handles Pagination JSON
*
@@ -74,16 +73,4 @@ public class RestPreferenceModel extends TestModel implements IRestModel<RestPre
{
this.id = id;
}
@Override
public ModelAssertion<RestPreferenceModel> assertThat()
{
return new ModelAssertion<RestPreferenceModel>(this);
}
@Override
public ModelAssertion<RestPreferenceModel> and()
{
return assertThat();
}
}
}

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Handles single Process Definition Entry JSON response
* "entry": {
@@ -169,18 +168,5 @@ public class RestProcessDefinitionModel extends TestModel implements IRestModel<
{
this.version = version;
}
@Override
public ModelAssertion<RestProcessDefinitionModel> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestProcessDefinitionModel> assertThat()
{
return new ModelAssertion<RestProcessDefinitionModel>(this);
}
}

View File

@@ -25,13 +25,12 @@
*/
package org.alfresco.rest.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.IModelAssertion;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.ProcessModel;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Handles single Process Entry JSON response
* "entry": {
@@ -126,22 +125,6 @@ public class RestProcessModel extends ProcessModel implements IRestModel<RestPro
this.startedAt = startedAt;
}
/**
* DSL for assertion on this rest model
* @return
*/
@Override
public ModelAssertion<RestProcessModel> assertThat()
{
return new ModelAssertion<RestProcessModel>(this);
}
@Override
public ModelAssertion<RestProcessModel> and()
{
return assertThat();
}
public String getDurationInMs()
{
return durationInMs;

View File

@@ -25,13 +25,12 @@
*/
package org.alfresco.rest.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.data.RandomData;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
public class RestProcessVariableModel extends TestModel implements IRestModel<RestProcessVariableModel>
{
private String name;
@@ -93,18 +92,4 @@ public class RestProcessVariableModel extends TestModel implements IRestModel<Re
public static RestProcessVariableModel getRandomProcessVariableModel(String variableType){
return new RestProcessVariableModel(RandomData.getRandomName("name"), RandomData.getRandomName("value"), variableType);
}
@Override
public ModelAssertion<RestProcessVariableModel> assertThat()
{
return new ModelAssertion<RestProcessVariableModel>(this);
}
@Override
public ModelAssertion<RestProcessVariableModel> and()
{
return assertThat();
}
}
}

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestRatingModel extends TestModel implements IRestModel<RestRatingModel>
{
@JsonProperty(value = "entry")
@@ -88,16 +87,4 @@ public class RestRatingModel extends TestModel implements IRestModel<RestRatingM
{
this.myRating = myRating;
}
@Override
public ModelAssertion<RestRatingModel> assertThat()
{
return new ModelAssertion<>(this);
}
@Override
public ModelAssertion<RestRatingModel> and()
{
return assertThat();
}
}
}

View File

@@ -25,30 +25,19 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* @author cmocanu
* Base Path
* {@linkplain /alfresco/api/-default-/public/alfresco/versions/1}
*/
public class RestRenditionInfoModel extends TestModel implements IRestModel<RestRenditionInfoModel> {
@Override
public ModelAssertion<RestRenditionInfoModel> and() {
return assertThat();
}
@Override
public ModelAssertion<RestRenditionInfoModel> assertThat() {
return new ModelAssertion<RestRenditionInfoModel>(this);
}
public class RestRenditionInfoModel extends TestModel implements IRestModel<RestRenditionInfoModel>
{
@JsonProperty(value = "entry")
RestRenditionInfoModel model;

View File

@@ -27,12 +27,11 @@ package org.alfresco.rest.model;
import java.util.List;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'aforascu' on '2018-01-10 16:02' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
@@ -40,18 +39,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class RestRepositoryInfoModel extends TestModel implements IRestModel<RestRepositoryInfoModel>
{
@Override
public ModelAssertion<RestRepositoryInfoModel> assertThat()
{
return new ModelAssertion<RestRepositoryInfoModel>(this);
}
@Override
public ModelAssertion<RestRepositoryInfoModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestRepositoryInfoModel model;

View File

@@ -27,12 +27,11 @@ package org.alfresco.rest.model;
import java.util.List;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'msuzuki' on '2017-05-15 10:58' from 'Alfresco Search REST API' swagger file
* Generated from 'Alfresco Search REST API' swagger file
@@ -40,18 +39,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class RestRequestRangesModel extends TestModel implements IRestModel<RestRequestRangesModel>
{
@Override
public ModelAssertion<RestRequestRangesModel> assertThat()
{
return new ModelAssertion<RestRequestRangesModel>(this);
}
@Override
public ModelAssertion<RestRequestRangesModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestRequestRangesModel model;

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'msuzuki' on '2017-02-28 16:04' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
@@ -38,18 +37,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class RestRequestSpellcheckModel extends TestModel implements IRestModel<RestRequestSpellcheckModel>
{
@Override
public ModelAssertion<RestRequestSpellcheckModel> assertThat()
{
return new ModelAssertion<RestRequestSpellcheckModel>(this);
}
@Override
public ModelAssertion<RestRequestSpellcheckModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestRequestSpellcheckModel model;

View File

@@ -31,12 +31,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'dedwards' on '2021-12-16 08:32' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
@@ -44,18 +43,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class RestRestoreArchivedContentRequestModel extends TestModel implements IRestModel<RestRestoreArchivedContentRequestModel>
{
@Override
public ModelAssertion<RestRestoreArchivedContentRequestModel> assertThat()
{
return new ModelAssertion<RestRestoreArchivedContentRequestModel>(this);
}
@Override
public ModelAssertion<RestRestoreArchivedContentRequestModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestRestoreArchivedContentRequestModel model;

View File

@@ -27,12 +27,11 @@ package org.alfresco.rest.model;
import java.util.List;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'Kristian.Dimitrov@hyland.com' on '2022-07-13 15:53' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
@@ -40,18 +39,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class RestRuleBodyModel extends TestModel implements IRestModel<RestRuleBodyModel>
{
@Override
public ModelAssertion<RestRuleBodyModel> assertThat()
{
return new ModelAssertion<RestRuleBodyModel>(this);
}
@Override
public ModelAssertion<RestRuleBodyModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestRuleBodyModel model;

View File

@@ -0,0 +1,106 @@
/*-
* #%L
* alfresco-tas-restapi
* %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.rest.model;
import java.util.List;
import java.util.Objects;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Generated by 'krystian' on '2022-09-28 11:33' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
* Base Path {@linkplain /alfresco/api/-default-/public/alfresco/versions/1}
*/
public class RestRuleExecutionBodyModel extends TestModel implements IRestModel<RestRuleExecutionBodyModel>
{
@JsonProperty(value = "entry")
RestRuleExecutionBodyModel model;
@Override
public RestRuleExecutionBodyModel onModel()
{
return model;
}
/**
Execute rules against the given folder and all sub-folders
*/
private boolean isEachSubFolderIncluded;
/**
Execute also inherited rules
*/
private boolean isEachInheritedRuleExecuted;
public boolean getIsEachSubFolderIncluded()
{
return this.isEachSubFolderIncluded;
}
public void setIsEachSubFolderIncluded(boolean isEachSubFolderIncluded)
{
this.isEachSubFolderIncluded = isEachSubFolderIncluded;
}
public boolean getIsEachInheritedRuleExecuted()
{
return this.isEachInheritedRuleExecuted;
}
public void setIsEachInheritedRuleExecuted(boolean isEachInheritedRuleExecuted)
{
this.isEachInheritedRuleExecuted = isEachInheritedRuleExecuted;
}
@Override
public String toString()
{
return "RestRuleExecutionBodyModel{" + "isEachSubFolderIncluded=" + isEachSubFolderIncluded + ", isEachInheritedRuleExecuted=" + isEachInheritedRuleExecuted + '}';
}
@Override
public boolean equals(Object o)
{
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
RestRuleExecutionBodyModel that = (RestRuleExecutionBodyModel) o;
return isEachSubFolderIncluded == that.isEachSubFolderIncluded && isEachInheritedRuleExecuted == that.isEachInheritedRuleExecuted;
}
@Override
public int hashCode()
{
return Objects.hash(isEachSubFolderIncluded, isEachInheritedRuleExecuted);
}
}

View File

@@ -0,0 +1,107 @@
/*-
* #%L
* alfresco-tas-restapi
* %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.rest.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'krystian' on '2022-09-28 11:33' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
* Base Path {@linkplain /alfresco/api/-default-/public/alfresco/versions/1}
*/
public class RestRuleExecutionModel extends TestModel implements IRestModel<RestRuleExecutionModel>
{
@JsonProperty(value = "entry")
RestRuleExecutionModel model;
@Override
public RestRuleExecutionModel onModel()
{
return model;
}
/**
Whether the rules were executed also against sub-folders
*/
@JsonProperty(required = true)
private boolean isEachSubFolderIncluded;
/**
Whether the inherited rules were also executed
*/
@JsonProperty(required = true)
private boolean isEachInheritedRuleExecuted;
public boolean getIsEachSubFolderIncluded()
{
return this.isEachSubFolderIncluded;
}
public void setIsEachSubFolderIncluded(boolean isEachSubFolderIncluded)
{
this.isEachSubFolderIncluded = isEachSubFolderIncluded;
}
public boolean getIsEachInheritedRuleExecuted()
{
return this.isEachInheritedRuleExecuted;
}
public void setIsEachInheritedRuleExecuted(boolean isEachInheritedRuleExecuted)
{
this.isEachInheritedRuleExecuted = isEachInheritedRuleExecuted;
}
@Override
public String toString()
{
return "RestRuleExecutionModel{" + "isEachSubFolderIncluded=" + isEachSubFolderIncluded + ", isEachInheritedRuleExecuted=" + isEachInheritedRuleExecuted + '}';
}
@Override
public boolean equals(Object o)
{
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
RestRuleExecutionModel that = (RestRuleExecutionModel) o;
return isEachSubFolderIncluded == that.isEachSubFolderIncluded && isEachInheritedRuleExecuted == that.isEachInheritedRuleExecuted;
}
@Override
public int hashCode()
{
return Objects.hash(isEachSubFolderIncluded, isEachInheritedRuleExecuted);
}
}

View File

@@ -26,13 +26,13 @@
package org.alfresco.rest.model;
import java.util.List;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'Kristian.Dimitrov@hyland.com' on '2022-07-13 15:53' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
@@ -40,18 +40,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class RestRuleModel extends TestModel implements IRestModel<RestRuleModel>
{
@Override
public ModelAssertion<RestRuleModel> assertThat()
{
return new ModelAssertion<RestRuleModel>(this);
}
@Override
public ModelAssertion<RestRuleModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestRuleModel model;
@@ -82,28 +70,26 @@ public class RestRuleModel extends TestModel implements IRestModel<RestRuleModel
Whether the rule is enabled
*/
private boolean enabled;
private boolean isEnabled;
/**
Whether the rule also applies to subfolders
*/
private boolean cascade;
private boolean isInheritable;
/**
Whether the rule should be run in the background
*/
private boolean asynchronous;
private boolean isAsynchronous;
/**
If the rule should be run in the background then an optional error script can be referenced
*/
private String errorScript;
/**
Whether the rule has been shared with more than one folder
*/
/** True if the rule set is linked to, or if the rule is inheritable and the rule set is inherited by a folder with inheriting enabled. */
@JsonProperty
private Boolean isShared;
@JsonProperty(required = true)
private boolean shared;
/**
The set of triggers that cause the rule to be activated.
* inbound - The rule should be activated when an item enters the folder
@@ -160,34 +146,34 @@ If the field is omitted then the rule will apply to all nodes.
this.description = description;
}
public boolean getEnabled()
public boolean getIsEnabled()
{
return this.enabled;
return this.isEnabled;
}
public void setEnabled(boolean enabled)
public void setIsEnabled(boolean isEnabled)
{
this.enabled = enabled;
this.isEnabled = isEnabled;
}
public boolean getCascade()
public boolean getIsInheritable()
{
return this.cascade;
return this.isInheritable;
}
public void setCascade(boolean cascade)
public void setIsInheritable(boolean isInheritable)
{
this.cascade = cascade;
this.isInheritable = isInheritable;
}
public boolean getAsynchronous()
public boolean getIsAsynchronous()
{
return this.asynchronous;
return this.isAsynchronous;
}
public void setAsynchronous(boolean asynchronous)
public void setIsAsynchronous(boolean isAsynchronous)
{
this.asynchronous = asynchronous;
this.isAsynchronous = isAsynchronous;
}
public String getErrorScript()
@@ -200,14 +186,14 @@ If the field is omitted then the rule will apply to all nodes.
this.errorScript = errorScript;
}
public boolean getShared()
public Boolean getIsShared()
{
return this.shared;
return this.isShared;
}
public void setShared(boolean shared)
public void setIsShared(Boolean shared)
{
this.shared = shared;
this.isShared = shared;
}
public List<String> getTriggers()
@@ -238,6 +224,34 @@ If the field is omitted then the rule will apply to all nodes.
public void setActions(List<RestActionBodyExecTemplateModel> actions)
{
this.actions = actions;
}
}
@Override
public String toString()
{
return "RestRuleModel{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", description='" + description + '\'' + ", isEnabled=" + isEnabled + ", isInheritable=" + isInheritable
+ ", isAsynchronous=" + isAsynchronous + ", errorScript='" + errorScript + '\'' + ", isShared=" + isShared + ", triggers=" + triggers + ", conditions=" + conditions
+ ", actions=" + actions + '}';
}
@Override
public boolean equals(Object o)
{
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
RestRuleModel ruleModel = (RestRuleModel) o;
return isEnabled == ruleModel.isEnabled && isInheritable == ruleModel.isInheritable && isAsynchronous == ruleModel.isAsynchronous && Objects.equals(id, ruleModel.id) && Objects.equals(
name, ruleModel.name) && Objects.equals(description, ruleModel.description) && Objects.equals(errorScript, ruleModel.errorScript) && Objects.equals(
isShared, ruleModel.isShared) && Objects.equals(triggers, ruleModel.triggers) && Objects.equals(conditions, ruleModel.conditions) && Objects.equals(
actions, ruleModel.actions);
}
@Override
public int hashCode()
{
return Objects.hash(id, name, description, isEnabled, isInheritable, isAsynchronous, errorScript, isShared, triggers, conditions, actions);
}
}

View File

@@ -27,12 +27,11 @@ package org.alfresco.rest.model;
import java.util.List;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'Kristian.Dimitrov@hyland.com' on '2022-07-13 15:53' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
@@ -40,18 +39,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class RestRuleSetBodyUpdateModel extends TestModel implements IRestModel<RestRuleSetBodyUpdateModel>
{
@Override
public ModelAssertion<RestRuleSetBodyUpdateModel> assertThat()
{
return new ModelAssertion<RestRuleSetBodyUpdateModel>(this);
}
@Override
public ModelAssertion<RestRuleSetBodyUpdateModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestRuleSetBodyUpdateModel model;

View File

@@ -0,0 +1,81 @@
/*-
* #%L
* alfresco-tas-restapi
* %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.rest.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'mpichura' on '2022-08-29 12:27' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
* Base Path {@linkplain /alfresco/api/-default-/public/alfresco/versions/1}
*/
public class RestRuleSetLinkModel extends TestModel implements IRestModel<RestRuleSetLinkModel>
{
@JsonProperty(value = "entry")
RestRuleSetLinkModel model;
@Override
public RestRuleSetLinkModel onModel()
{
return model;
}
/**
Identifier for the folder node containing the rule set or the rule set node itself.
*/
private String id;
public String getId()
{
return this.id;
}
public void setId(String id)
{
this.id = id;
}
@Override
public boolean equals(Object o)
{
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
RestRuleSetLinkModel that = (RestRuleSetLinkModel) o;
return id.equals(that.id);
}
@Override
public int hashCode()
{
return Objects.hash(id);
}
}

View File

@@ -4,21 +4,21 @@
* %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
@@ -26,33 +26,21 @@
package org.alfresco.rest.model;
import java.util.List;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'Kristian.Dimitrov@hyland.com' on '2022-07-13 15:53' from 'Alfresco Content Services REST API' swagger file
* Generated by 'Kristian.Dimitrov@hyland.com' on '2022-07-13 15:53' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
* Base Path {@linkplain /alfresco/api/-default-/public/alfresco/versions/1}
*/
public class RestRuleSetModel extends TestModel implements IRestModel<RestRuleSetModel>
{
@Override
public ModelAssertion<RestRuleSetModel> assertThat()
{
return new ModelAssertion<RestRuleSetModel>(this);
}
@Override
public ModelAssertion<RestRuleSetModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
@JsonProperty (value = "entry")
RestRuleSetModel model;
@Override
@@ -62,30 +50,24 @@ public class RestRuleSetModel extends TestModel implements IRestModel<RestRuleSe
}
/**
Identifier for the rule set
*/
@JsonProperty(required = true)
private String id;
/**
True if the rule set is shared to at least one folder
*/
@JsonProperty(required = true)
private boolean shared;
/**
List of folder identifiers which use the rule set.
Note that any folders the user does not have access to will not appear in this list. Use **shared** instead to check existence of any link.
*/
private List<String> usedBy;
/**
An ordered list of the rule ids within the rule set
*/
private List<String> ruleIds;
* Identifier for the rule set
*/
@JsonProperty (required = true)
private String id;
/** The node id of the folder that owns this rule set */
private String owningFolder;
/** The reason why the rule set is included for the folder. */
private String inclusionType;
/** A list of node ids for folders that inherit this rule set. */
private List<String> inheritedBy;
/** A list of node ids for folders that link to this rule set. */
private List<String> linkedToBy;
/** Whether any folders inherit this rule set. */
private Boolean isInherited;
/** Whether any folders link to this rule set. */
private Boolean isLinkedTo;
/** Ordered list of ids for the rules in this rule set. */
private List<String> ruleIds;
public String getId()
{
@@ -95,36 +77,105 @@ Note that any folders the user does not have access to will not appear in this l
public void setId(String id)
{
this.id = id;
}
public boolean getShared()
{
return this.shared;
}
public void setShared(boolean shared)
public String getOwningFolder()
{
this.shared = shared;
}
public List<String> getUsedBy()
{
return this.usedBy;
return owningFolder;
}
public void setUsedBy(List<String> usedBy)
public void setOwningFolder(String owningFolder)
{
this.usedBy = usedBy;
}
this.owningFolder = owningFolder;
}
public String getInclusionType()
{
return inclusionType;
}
public void setInclusionType(String inclusionType)
{
this.inclusionType = inclusionType;
}
public List<String> getInheritedBy()
{
return inheritedBy;
}
public void setInheritedBy(List<String> inheritedBy)
{
this.inheritedBy = inheritedBy;
}
public List<String> getLinkedToBy()
{
return linkedToBy;
}
public void setLinkedToBy(List<String> linkedToBy)
{
this.linkedToBy = linkedToBy;
}
public Boolean getIsInherited()
{
return isInherited;
}
public void setIsInherited(Boolean isInherited)
{
this.isInherited = isInherited;
}
public Boolean getIsLinkedTo()
{
return isLinkedTo;
}
public void setIsLinkedTo(Boolean isLinkedTo)
{
this.isLinkedTo = isLinkedTo;
}
public List<String> getRuleIds()
{
return this.ruleIds;
return ruleIds;
}
public void setRuleIds(List<String> ruleIds)
{
this.ruleIds = ruleIds;
}
}
@Override
public String toString()
{
return "RestRuleSetModel{id='" + id + "', owningFolder='" + owningFolder + "', inclusionType='" + inclusionType
+ "', inheritedBy=" + inheritedBy + ", linkedToBy=" + linkedToBy + ", isInherited=" + isInherited
+ ", isLinkedTo=" + isLinkedTo + ", ruleIds=" + ruleIds + "}";
}
@Override
public boolean equals(Object o)
{
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
RestRuleSetModel that = (RestRuleSetModel) o;
return Objects.equals(id, that.id)
&& Objects.equals(owningFolder, that.owningFolder)
&& Objects.equals(inclusionType, that.inclusionType)
&& Objects.equals(inheritedBy, that.inheritedBy)
&& Objects.equals(linkedToBy, that.linkedToBy)
&& Objects.equals(isInherited, that.isInherited)
&& Objects.equals(isLinkedTo, that.isLinkedTo)
&& Objects.equals(ruleIds, that.ruleIds);
}
@Override
public int hashCode()
{
return Objects.hash(id, owningFolder, inclusionType, inheritedBy, linkedToBy, isInherited, isLinkedTo, ruleIds);
}
}

View File

@@ -0,0 +1,101 @@
/*-
* #%L
* alfresco-tas-restapi
* %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.rest.model;
import java.util.Objects;
import java.util.StringJoiner;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestRuleSettingsModel extends TestModel implements IRestModel<RestRuleSettingsModel>
{
@JsonProperty (value = "entry")
private RestRuleSettingsModel model;
private String key;
@JsonProperty (required = true)
private Object value;
@Override
public RestRuleSettingsModel onModel()
{
return model;
}
public String getKey()
{
return key;
}
public void setKey(String key)
{
this.key = key;
}
public Object getValue()
{
return value;
}
public void setValue(Object value)
{
this.value = value;
}
@Override
public String toString()
{
return "RuleSetting{"
+ new StringJoiner(", ")
.add("key=" + key)
.add("value=" + value.toString())
.toString()
+ "}";
}
@Override
public boolean equals(Object o)
{
if (this == o)
{
return true;
}
if (!(o instanceof RestRuleSettingsModel))
{
return false;
}
RestRuleSettingsModel that = (RestRuleSettingsModel) o;
return Objects.equals(key, that.key) && Objects.equals(value, that.value);
}
@Override
public int hashCode()
{
return Objects.hash(key, value);
}
}

View File

@@ -27,12 +27,11 @@ package org.alfresco.rest.model;
import java.util.List;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated from 'Alfresco Core REST API' swagger file
* Base Path {@linkplain /alfresco/api/-default-/public/alfresco/versions/1}
@@ -61,18 +60,6 @@ public class RestSharedLinksModel extends TestModel implements IRestModel<RestSh
return model;
}
@Override
public ModelAssertion<RestSharedLinksModel> assertThat()
{
return new ModelAssertion<RestSharedLinksModel>(this);
}
@Override
public ModelAssertion<RestSharedLinksModel> and()
{
return assertThat();
}
@JsonProperty(required = true)
private String modifiedAt;

View File

@@ -25,14 +25,13 @@
*/
package org.alfresco.rest.model;
import java.util.List;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'Kristian.Dimitrov@hyland.com' on '2022-07-13 15:53' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
@@ -40,18 +39,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class RestSimpleConditionDefinitionModel extends TestModel implements IRestModel<RestSimpleConditionDefinitionModel>
{
@Override
public ModelAssertion<RestSimpleConditionDefinitionModel> assertThat()
{
return new ModelAssertion<RestSimpleConditionDefinitionModel>(this);
}
@Override
public ModelAssertion<RestSimpleConditionDefinitionModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestSimpleConditionDefinitionModel model;
@@ -128,6 +115,29 @@ Where a property is multivalued then the condition is true if it is satisfied by
public void setParameter(String parameter)
{
this.parameter = parameter;
}
}
@Override
public String toString()
{
return "RestSimpleConditionDefinitionModel{" + "field='" + field + '\'' + ", comparator='" + comparator + '\'' + ", parameter='" + parameter + '\'' + '}';
}
@Override
public boolean equals(Object o)
{
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
RestSimpleConditionDefinitionModel that = (RestSimpleConditionDefinitionModel) o;
return Objects.equals(field, that.field) && Objects.equals(comparator, that.comparator) && Objects.equals(parameter, that.parameter);
}
@Override
public int hashCode()
{
return Objects.hash(field, comparator, parameter);
}
}

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestSiteContainerModel extends TestModel implements IRestModel<RestSiteContainerModel>
{
@JsonProperty(value = "entry")
@@ -64,21 +63,4 @@ public class RestSiteContainerModel extends TestModel implements IRestModel<Rest
{
this.folderId = folderId;
}
/**
* DSL for assertion on this rest model
* @return
*/
@Override
public ModelAssertion<RestSiteContainerModel> assertThat()
{
return new ModelAssertion<RestSiteContainerModel>(this);
}
@Override
public ModelAssertion<RestSiteContainerModel> and()
{
return assertThat();
}
}
}

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
*
* Handles Site Entry in Site Membership Information response
@@ -93,22 +92,6 @@ public class RestSiteEntry extends TestModel implements IRestModel<RestSiteEntry
this.id = id;
}
/**
* DSL for assertion on this rest model
* @return
*/
@Override
public ModelAssertion<RestSiteEntry> assertThat()
{
return new ModelAssertion<RestSiteEntry>(this);
}
@Override
public ModelAssertion<RestSiteEntry> and()
{
return assertThat();
}
@Override
public RestSiteEntry onModel()
{

View File

@@ -25,15 +25,15 @@
*/
package org.alfresco.rest.model;
import static org.alfresco.utility.report.log.Step.STEP;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.model.TestModel;
import org.testng.Assert;
import static org.alfresco.utility.report.log.Step.STEP;
public class RestSiteGroupModel extends TestModel implements IRestModel<RestSiteGroupModel>
{
@JsonProperty(value = "entry")
@@ -84,20 +84,4 @@ public class RestSiteGroupModel extends TestModel implements IRestModel<RestSite
Assert.assertEquals(getRole(), role, "Site group role is not as expected.");
return this;
}
/**
* DSL for assertion on this rest model
* @return
*/
@Override
public ModelAssertion<RestSiteGroupModel> assertThat()
{
return new ModelAssertion<RestSiteGroupModel>(this);
}
@Override
public ModelAssertion<RestSiteGroupModel> and()
{
return assertThat();
}
}

View File

@@ -27,14 +27,13 @@ package org.alfresco.rest.model;
import static org.alfresco.utility.report.log.Step.STEP;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.model.TestModel;
import org.testng.Assert;
import com.fasterxml.jackson.annotation.JsonProperty;
public class RestSiteMemberModel extends TestModel implements IRestModel<RestSiteMemberModel>
{
@JsonProperty(value = "entry")
@@ -98,20 +97,4 @@ public class RestSiteMemberModel extends TestModel implements IRestModel<RestSit
return this;
}
/**
* DSL for assertion on this rest model
* @return
*/
@Override
public ModelAssertion<RestSiteMemberModel> assertThat()
{
return new ModelAssertion<RestSiteMemberModel>(this);
}
@Override
public ModelAssertion<RestSiteMemberModel> and()
{
return assertThat();
}
}

View File

@@ -25,13 +25,12 @@
*/
package org.alfresco.rest.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import org.testng.Assert;
import com.fasterxml.jackson.annotation.JsonProperty;
public class RestSiteMembershipRequestModel extends TestModel implements IRestModel<RestSiteMembershipRequestModel>
{
@JsonProperty(value = "entry")
@@ -104,21 +103,4 @@ public class RestSiteMembershipRequestModel extends TestModel implements IRestMo
Assert.assertEquals(getMessage(), message, "Site membership request message is not correct");
return this;
}
/**
* DSL for assertion on this rest model
* @return
*/
@Override
public ModelAssertion<RestSiteMembershipRequestModel> assertThat()
{
return new ModelAssertion<RestSiteMembershipRequestModel>(this);
}
@Override
public ModelAssertion<RestSiteMembershipRequestModel> and()
{
return assertThat();
}
}
}

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.SiteModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.SiteModel;
/**
* Handles single Site JSON responses
* Example:
@@ -74,20 +73,4 @@ public class RestSiteModel extends SiteModel implements IRestModel<RestSiteModel
{
this.role = role;
}
/**
* DSL for assertion on this rest model
* @return
*/
@Override
public ModelAssertion<RestSiteModel> assertThat()
{
return new ModelAssertion<RestSiteModel>(this);
}
@Override
public ModelAssertion<RestSiteModel> and()
{
return assertThat();
}
}

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestSitePersonMembershipRequestModel extends TestModel implements IRestModel<RestSitePersonMembershipRequestModel>
{
private String id;
@@ -110,20 +109,4 @@ public class RestSitePersonMembershipRequestModel extends TestModel implements I
{
this.modifiedAt = modifiedAt;
}
/**
* DSL for assertion on this rest model
* @return
*/
@Override
public ModelAssertion<RestSitePersonMembershipRequestModel> assertThat()
{
return new ModelAssertion<RestSitePersonMembershipRequestModel>(this);
}
@Override
public ModelAssertion<RestSitePersonMembershipRequestModel> and()
{
return assertThat();
}
}

View File

@@ -25,14 +25,11 @@
*/
package org.alfresco.rest.model;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Generated by 'tsalvado' on '2021-08-18 21:15' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
@@ -40,18 +37,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class RestStatusInfoModel extends TestModel implements IRestModel<RestStatusInfoModel>
{
@Override
public ModelAssertion<RestStatusInfoModel> assertThat()
{
return new ModelAssertion<RestStatusInfoModel>(this);
}
@Override
public ModelAssertion<RestStatusInfoModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestStatusInfoModel model;

View File

@@ -32,12 +32,11 @@
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Base Path {@linkplain /alfresco/api/-default-/private/alfresco/versions/1}
*
@@ -108,18 +107,6 @@ public class RestSubscriberModel extends TestModel implements IRestModel<RestSub
return model;
}
@Override
public ModelAssertion<RestSubscriberModel> assertThat()
{
return new ModelAssertion<RestSubscriberModel>(this);
}
@Override
public ModelAssertion<RestSubscriberModel> and()
{
return assertThat();
}
@JsonProperty(required = true)
private String createdAt;

View File

@@ -32,12 +32,11 @@
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Base Path {@linkplain /alfresco/api/-default-/private/alfresco/versions/1}
*
@@ -76,18 +75,6 @@ public class RestSyncNodeSubscriptionModel extends TestModel implements IRestMod
return model;
}
@Override
public ModelAssertion<RestSyncNodeSubscriptionModel> assertThat()
{
return new ModelAssertion<RestSyncNodeSubscriptionModel>(this);
}
@Override
public ModelAssertion<RestSyncNodeSubscriptionModel> and()
{
return assertThat();
}
@JsonProperty(required = true)
private String deviceSubscriptionId;

View File

@@ -27,13 +27,12 @@ package org.alfresco.rest.model;
import static org.alfresco.utility.report.log.Step.STEP;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TagModel;
import org.testng.Assert;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Handles single Tag Entry JSON response
* "entry":
@@ -64,24 +63,6 @@ public class RestTagModel extends TagModel implements IRestModel<RestTagModel>
return this;
}
/**
* DSL for assertion on this rest model
* @return
*/
public ModelAssertion<RestTagModel> and()
{
return new ModelAssertion<RestTagModel>(this);
}
/**
* DSL for assertion on this rest model
* @return
*/
public ModelAssertion<RestTagModel> assertThat()
{
return new ModelAssertion<RestTagModel>(this);
}
public Integer getCount()
{
return count;

View File

@@ -25,13 +25,12 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class RestTargetModel extends TestModel implements IRestModel<RestTargetModel>
{
@@ -106,20 +105,4 @@ public class RestTargetModel extends TestModel implements IRestModel<RestTargetM
{
this.file = file;
}
/**
* DSL for assertion on this rest model
* @return
*/
@Override
public ModelAssertion<RestTargetModel> assertThat()
{
return new ModelAssertion<RestTargetModel>(this);
}
@Override
public ModelAssertion<RestTargetModel> and()
{
return assertThat();
}
}
}

View File

@@ -25,13 +25,12 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TaskModel;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TaskModel;
/**
* Handles single Task JSON response
* Example:
@@ -185,22 +184,6 @@ public class RestTaskModel extends TaskModel implements IRestModel<RestTaskModel
this.state = state;
}
/**
* DSL for assertion on this rest model
* @return
*/
@Override
public ModelAssertion<RestTaskModel> assertThat()
{
return new ModelAssertion<RestTaskModel>(this);
}
@Override
public ModelAssertion<RestTaskModel> and()
{
return assertThat();
}
public Integer getPriorityTask()
{
return priorityTask;

View File

@@ -25,30 +25,17 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated from 'Alfresco Authentication REST API' swagger file
* Base Path {@linkplain /alfresco/api/-default-/public/authentication/versions/1}
*/
public class RestTicketBodyModel extends TestModel implements IRestModel<RestTicketBodyModel>
{
@Override
public ModelAssertion<RestTicketBodyModel> assertThat()
{
return new ModelAssertion<RestTicketBodyModel>(this);
}
@Override
public ModelAssertion<RestTicketBodyModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestTicketBodyModel model;

View File

@@ -25,30 +25,17 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated from 'Alfresco Authentication REST API' swagger file
* Base Path {@linkplain /alfresco/api/-default-/public/authentication/versions/1}
*/
public class RestTicketModel extends TestModel implements IRestModel<RestTicketModel>
{
@Override
public ModelAssertion<RestTicketModel> assertThat()
{
return new ModelAssertion<RestTicketModel>(this);
}
@Override
public ModelAssertion<RestTicketModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestTicketModel model;

View File

@@ -25,13 +25,12 @@
*/
package org.alfresco.rest.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.data.RandomData;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Handles a single Variable JSON response
* Example:
@@ -111,23 +110,6 @@ public class RestVariableModel extends TestModel implements IRestModel<RestVaria
return new RestVariableModel(scope, RandomData.getRandomName("name"), type, RandomData.getRandomName("value"));
}
/**
* DSL for assertion on this rest model
*
* @return
*/
@Override
public ModelAssertion<RestVariableModel> assertThat()
{
return new ModelAssertion<RestVariableModel>(this);
}
@Override
public ModelAssertion<RestVariableModel> and()
{
return assertThat();
}
@Override
public RestVariableModel onModel()
{

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.model;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'aforascu' on '2018-01-10 16:02' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
@@ -38,18 +37,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
public class RestVersionInfoModel extends TestModel implements IRestModel<RestVersionInfoModel>
{
@Override
public ModelAssertion<RestVersionInfoModel> assertThat()
{
return new ModelAssertion<RestVersionInfoModel>(this);
}
@Override
public ModelAssertion<RestVersionInfoModel> and()
{
return assertThat();
}
@JsonProperty(value = "entry")
RestVersionInfoModel model;

View File

@@ -27,27 +27,13 @@ package org.alfresco.rest.model;
import java.util.List;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestVersionModel extends TestModel implements IRestModel<RestVersionModel>
{
@Override
public ModelAssertion<RestVersionModel> and()
{
return assertThat();
}
@Override
public ModelAssertion<RestVersionModel> assertThat()
{
return new ModelAssertion<RestVersionModel>(this);
}
@JsonProperty(value = "entry")
RestVersionModel model;

View File

@@ -25,30 +25,17 @@
*/
package org.alfresco.rest.model.body;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
public class RestNodeLockBodyModel extends TestModel implements IRestModel<RestNodeLockBodyModel>
{
@JsonProperty(value = "entry")
RestNodeLockBodyModel model;
@Override
public ModelAssertion<RestNodeLockBodyModel> and()
{
return new ModelAssertion<RestNodeLockBodyModel>(this);
}
@Override
public ModelAssertion<RestNodeLockBodyModel> assertThat()
{
return assertThat();
}
@Override
public RestNodeLockBodyModel onModel()
{

View File

@@ -25,6 +25,9 @@
*/
package org.alfresco.rest.requests;
import java.util.Arrays;
import java.util.stream.Collectors;
import org.alfresco.rest.core.RestWrapper;
public abstract class ModelRequest<Request>
@@ -43,10 +46,26 @@ public abstract class ModelRequest<Request>
return (Request) this;
}
@SuppressWarnings("unchecked")
/**
* Use "include=path" in the URL query.
* <p>
* Nb. Replaces any existing parameters.
*/
public Request includePath()
{
restWrapper.withParams("include=path");
return include("path");
}
/**
* Specify fields to include in the response.
* <p>
* Nb. Replaces any existing parameters.
*/
@SuppressWarnings ("unchecked")
public Request include(String... includes)
{
String includeString = Arrays.stream(includes).collect(Collectors.joining(","));
restWrapper.withParams("include=" + includeString);
return (Request) this;
}
}

View File

@@ -26,13 +26,44 @@
package org.alfresco.rest.requests;
import static org.alfresco.rest.requests.RuleSettings.IS_INHERITANCE_ENABLED;
import static org.springframework.http.HttpMethod.PUT;
import javax.json.JsonArrayBuilder;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import io.restassured.http.ContentType;
import org.alfresco.rest.core.JsonBodyGenerator;
import org.alfresco.rest.core.RestRequest;
import org.alfresco.rest.core.RestResponse;
import org.alfresco.rest.core.RestWrapper;
import org.alfresco.rest.exception.JsonToModelConversionException;
import org.alfresco.rest.model.*;
import org.alfresco.rest.model.RestActionDefinitionModelsCollection;
import org.alfresco.rest.model.RestCommentModel;
import org.alfresco.rest.model.RestCommentModelsCollection;
import org.alfresco.rest.model.RestNodeAssocTargetModel;
import org.alfresco.rest.model.RestNodeAssociationModel;
import org.alfresco.rest.model.RestNodeAssociationModelCollection;
import org.alfresco.rest.model.RestNodeBodyModel;
import org.alfresco.rest.model.RestNodeBodyMoveCopyModel;
import org.alfresco.rest.model.RestNodeChildAssocModelCollection;
import org.alfresco.rest.model.RestNodeModel;
import org.alfresco.rest.model.RestNodeModelsCollection;
import org.alfresco.rest.model.RestRatingModel;
import org.alfresco.rest.model.RestRatingModelsCollection;
import org.alfresco.rest.model.RestRenditionInfoModel;
import org.alfresco.rest.model.RestRenditionInfoModelCollection;
import org.alfresco.rest.model.RestRuleExecutionBodyModel;
import org.alfresco.rest.model.RestRuleExecutionModel;
import org.alfresco.rest.model.RestRuleSetLinkModel;
import org.alfresco.rest.model.RestRuleSetModel;
import org.alfresco.rest.model.RestRuleSetModelsCollection;
import org.alfresco.rest.model.RestTagModel;
import org.alfresco.rest.model.RestTagModelsCollection;
import org.alfresco.rest.model.RestVersionModel;
import org.alfresco.rest.model.RestVersionModelsCollection;
import org.alfresco.rest.model.body.RestNodeLockBodyModel;
import org.alfresco.rest.model.builder.NodesBuilder;
import org.alfresco.utility.Utility;
@@ -41,33 +72,32 @@ import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.testng.reporters.Files;
import javax.json.JsonArrayBuilder;
import java.io.File;
import java.io.IOException;
/**
* Declares all Rest API under the /nodes path
*
*/
public class Node extends ModelRequest<Node>
{
private static final String RULE_SETS_URI = "nodes/{nodeId}/rule-sets";
private static final String RULE_SET_BY_ID = RULE_SETS_URI + "/{ruleSetId}";
private RepoTestModel repoModel;
public Node(RestWrapper restWrapper)
{
super(restWrapper);
super(restWrapper);
}
public Node(RepoTestModel repoModel, RestWrapper restWrapper)
{
super(restWrapper);
this.repoModel = repoModel;
Utility.checkObjectIsInitialized(this.repoModel.getNodeRef(), "repoModel.getNodeRef()");
super(restWrapper);
this.repoModel = repoModel;
Utility.checkObjectIsInitialized(this.repoModel.getNodeRef(), "repoModel.getNodeRef()");
}
/**
* Retrieve details for a specific node using GET call on "nodes/{nodeId}"
*
*
* @param nodeId
* @return
* @throws JsonToModelConversionException
@@ -80,7 +110,7 @@ public class Node extends ModelRequest<Node>
/**
* Retrieve comments for a specific node using GET call on "nodes/{nodeId}/comments"
*
*
* @param nodeId
* @return
* @throws JsonToModelConversionException
@@ -93,7 +123,7 @@ public class Node extends ModelRequest<Node>
/**
* Publish one new comment on a specific node using POST call on "nodes/{nodeId}/comments"
*
*
* @param node
* @param commentContent
* @return
@@ -115,7 +145,7 @@ public class Node extends ModelRequest<Node>
public RestCommentModelsCollection addComments(String... comments)
{
JsonArrayBuilder array = JsonBodyGenerator.defineJSONArray();
for(String comment: comments)
for (String comment : comments)
{
array.add(JsonBodyGenerator.defineJSON().add("content", comment));
}
@@ -126,7 +156,7 @@ public class Node extends ModelRequest<Node>
/**
* Update a comment for a specific node using PUT call on nodes/{nodeId}/comments/{commentId}
*
*
* @param nodeId
* @param commentId
* @param commentContent
@@ -136,7 +166,7 @@ public class Node extends ModelRequest<Node>
public RestCommentModel updateComment(RestCommentModel commentModel, String commentContent)
{
String postBody = JsonBodyGenerator.keyValueJson("content", commentContent);
RestRequest request = RestRequest.requestWithBody(HttpMethod.PUT, postBody, "nodes/{nodeId}/comments/{commentId}?{parameters}", repoModel.getNodeRef(), commentModel.getId(), restWrapper.getParameters());
RestRequest request = RestRequest.requestWithBody(PUT, postBody, "nodes/{nodeId}/comments/{commentId}?{parameters}", repoModel.getNodeRef(), commentModel.getId(), restWrapper.getParameters());
request.setContentType("UTF-8");
RestCommentModel response = restWrapper.processModel(RestCommentModel.class, request);
return response;
@@ -144,7 +174,7 @@ public class Node extends ModelRequest<Node>
/**
* Delete a comment for a specific node using DELETE call on nodes/{nodeId}/comments/{commentId}
*
*
* @param nodeId
* @param commentId
* @return
@@ -158,101 +188,99 @@ public class Node extends ModelRequest<Node>
/**
* Like a document using POST call on "nodes/{nodeId}/ratings"
*
*
* @return
*/
public RestRatingModel likeDocument()
{
String postBody = JsonBodyGenerator.likeRating(true);
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, postBody, "nodes/{nodeId}/ratings", repoModel.getNodeRef());
return restWrapper.processModel(RestRatingModel.class, request);
String postBody = JsonBodyGenerator.likeRating(true);
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, postBody, "nodes/{nodeId}/ratings", repoModel.getNodeRef());
return restWrapper.processModel(RestRatingModel.class, request);
}
public RestRatingModel dislikeDocument()
{
String postBody = JsonBodyGenerator.likeRating(false);
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, postBody, "nodes/{nodeId}/ratings", repoModel.getNodeRef());
return restWrapper.processModel(RestRatingModel.class, request);
String postBody = JsonBodyGenerator.likeRating(false);
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, postBody, "nodes/{nodeId}/ratings", repoModel.getNodeRef());
return restWrapper.processModel(RestRatingModel.class, request);
}
/**
* POST call on "nodes/{nodeId}/ratings" using an invalid rating body
*
*
* @return
*/
public RestRatingModel addInvalidRating(String jsonBody)
{
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, jsonBody, "nodes/{nodeId}/ratings", repoModel.getNodeRef());
return restWrapper.processModel(RestRatingModel.class, request);
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, jsonBody, "nodes/{nodeId}/ratings", repoModel.getNodeRef());
return restWrapper.processModel(RestRatingModel.class, request);
}
/**
* Add five star rate to a document using POST call on "nodes/{nodeId}/ratings"
*
*
* @param stars
* @return
*/
public RestRatingModel rateStarsToDocument(int stars)
{
String postBody = JsonBodyGenerator.fiveStarRating(stars);
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, postBody, "nodes/{nodeId}/ratings", repoModel.getNodeRef());
return restWrapper.processModel(RestRatingModel.class, request);
String postBody = JsonBodyGenerator.fiveStarRating(stars);
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, postBody, "nodes/{nodeId}/ratings", repoModel.getNodeRef());
return restWrapper.processModel(RestRatingModel.class, request);
}
/**
* Retrieve node ratings using GET call on "nodes/{nodeId}/ratings"
*
*
* @return
*/
public RestRatingModelsCollection getRatings()
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/ratings?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
return restWrapper.processModels(RestRatingModelsCollection.class, request);
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/ratings?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
return restWrapper.processModels(RestRatingModelsCollection.class, request);
}
/**
* Delete like rating using DELETE call on "nodes/{nodeId}/ratings/{ratingId}"
*
*
* @return
*/
public void deleteLikeRating()
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.DELETE, "nodes/{nodeId}/ratings/{ratingId}", repoModel.getNodeRef(), "likes");
restWrapper.processEmptyModel(request);
RestRequest request = RestRequest.simpleRequest(HttpMethod.DELETE, "nodes/{nodeId}/ratings/{ratingId}", repoModel.getNodeRef(), "likes");
restWrapper.processEmptyModel(request);
}
/**
* Try to delete invalid rating using DELETE call on "nodes/{nodeId}/ratings/{ratingId}"
*
*
* @return
*/
public void deleteInvalidRating(String rating)
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.DELETE, "nodes/{nodeId}/ratings/{ratingId}", repoModel.getNodeRef(), rating);
restWrapper.processEmptyModel(request);
RestRequest request = RestRequest.simpleRequest(HttpMethod.DELETE, "nodes/{nodeId}/ratings/{ratingId}", repoModel.getNodeRef(), rating);
restWrapper.processEmptyModel(request);
}
/**
*
* Get like rating of a document using GET call on "nodes/{nodeId}/ratings/{ratingId}"
*/
public RestRatingModel getLikeRating()
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/ratings/{ratingId}?{parameters}", repoModel.getNodeRef(), "likes", restWrapper.getParameters());
return restWrapper.processModel(RestRatingModel.class, request);
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/ratings/{ratingId}?{parameters}", repoModel.getNodeRef(), "likes", restWrapper.getParameters());
return restWrapper.processModel(RestRatingModel.class, request);
}
/**
* Delete fivestar rating using DELETE call on "nodes/{nodeId}/ratings/{ratingId}"
*
*
* @return
*/
public void deleteFiveStarRating()
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.DELETE, "nodes/{nodeId}/ratings/{ratingId}", repoModel.getNodeRef(), "fiveStar");
restWrapper.processEmptyModel(request);
RestRequest request = RestRequest.simpleRequest(HttpMethod.DELETE, "nodes/{nodeId}/ratings/{ratingId}", repoModel.getNodeRef(), "fiveStar");
restWrapper.processEmptyModel(request);
}
/**
@@ -262,8 +290,8 @@ public class Node extends ModelRequest<Node>
*/
public RestRatingModel getFiveStarRating()
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/ratings/{ratingId}?{parameters}", repoModel.getNodeRef(), "fiveStar", restWrapper.getParameters());
return restWrapper.processModel(RestRatingModel.class, request);
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/ratings/{ratingId}?{parameters}", repoModel.getNodeRef(), "fiveStar", restWrapper.getParameters());
return restWrapper.processModel(RestRatingModel.class, request);
}
/**
@@ -290,17 +318,17 @@ public class Node extends ModelRequest<Node>
public RestTagModelsCollection addTags(String... tags)
{
String postBody = "[";
for(String tag: tags)
for (String tag : tags)
{
postBody += JsonBodyGenerator.keyValueJson("tag", tag) + ",";
}
postBody = postBody.substring(0, postBody.length()-1) + "]";
postBody = postBody.substring(0, postBody.length() - 1) + "]";
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, postBody, "nodes/{nodeId}/tags", repoModel.getNodeRef());
return restWrapper.processModels(RestTagModelsCollection.class, request);
}
/**
* Deletes a tag for a specific content node using DELETE call on nodes/{nodeId}/tags/{tagId}
*
@@ -317,7 +345,7 @@ public class Node extends ModelRequest<Node>
/**
* Get node tags using GET call on 'nodes/{nodeId}/tags'
*
*
* @param tag
* @return
*/
@@ -329,33 +357,33 @@ public class Node extends ModelRequest<Node>
/**
* Create new nodes using POST call on 'nodes/{nodeId}/children
*
*
* @param node
* @return
*/
*/
public RestNodeModel createNode(RestNodeBodyModel node)
{
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, node.toJson(), "nodes/{nodeId}/children?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
return restWrapper.processModel(RestNodeModel.class, request);
{
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, node.toJson(), "nodes/{nodeId}/children?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
return restWrapper.processModel(RestNodeModel.class, request);
}
/**
* Create new nodes using POST call on 'nodes/{nodeId}/children
*
* You need to specify first the multipart call {@link RestWrapper#usingMultipartFile(java.io.File)}
*
*
* <code>usingMultipartFile(new File("your-local-file.txt")).withCoreAPI().usingNode(ContentModel.my()).createNode();</code>
* @return
*/
public RestNodeModel createNode()
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.POST, "nodes/{nodeId}/children", repoModel.getNodeRef());
RestRequest request = RestRequest.simpleRequest(HttpMethod.POST, "nodes/{nodeId}/children", repoModel.getNodeRef());
return restWrapper.processModel(RestNodeModel.class, request);
}
/**
* Retrieve content for a specific node using GET call on "nodes/{nodeId}/content"
*
*
* @return
*/
public RestResponse getNodeContent()
@@ -366,7 +394,7 @@ public class Node extends ModelRequest<Node>
/**
* Retrieve content for a specific node using GET call on "nodes/{nodeId}/content"
*
*
* @return
* @param nodeId
*/
@@ -378,14 +406,14 @@ public class Node extends ModelRequest<Node>
/**
* Create node rendition using POST call on '/nodes/{nodeId}/renditions'
*
*
* @param renditionId id of rendition to be created
* @return
*/
public void createNodeRendition(String renditionId)
{
String postBody = JsonBodyGenerator.keyValueJson("id", renditionId);
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, postBody, "nodes/{nodeId}/renditions", repoModel.getNodeRef());
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, postBody, "nodes/{nodeId}/renditions", repoModel.getNodeRef());
restWrapper.processEmptyModel(request);
}
@@ -400,8 +428,8 @@ public class Node extends ModelRequest<Node>
{
String postBody = JsonBodyGenerator.keyValueJson("id", renditionId);
RestRequest request = RestRequest
.requestWithBody(HttpMethod.POST, postBody, "nodes/{nodeId}/versions/{versionId}/renditions",
repoModel.getNodeRef(), versionId);
.requestWithBody(HttpMethod.POST, postBody, "nodes/{nodeId}/versions/{versionId}/renditions",
repoModel.getNodeRef(), versionId);
restWrapper.processEmptyModel(request);
}
@@ -425,13 +453,13 @@ public class Node extends ModelRequest<Node>
/**
* Get node rendition using GET call on '/nodes/{nodeId}/renditions/{renditionId}
*
*
* @param renditionId id of rendition to be retrieved
* @return
*/
*/
public RestRenditionInfoModel getNodeRendition(String renditionId)
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/renditions/{renditionId}", repoModel.getNodeRef(), renditionId);
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/renditions/{renditionId}", repoModel.getNodeRef(), renditionId);
return restWrapper.processModel(RestRenditionInfoModel.class, request);
}
@@ -445,20 +473,20 @@ public class Node extends ModelRequest<Node>
public RestRenditionInfoModel getNodeVersionRendition(String renditionId, String versionId)
{
RestRequest request = RestRequest
.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}",
repoModel.getNodeRef(), versionId, renditionId);
.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}",
repoModel.getNodeRef(), versionId, renditionId);
return restWrapper.processModel(RestRenditionInfoModel.class, request);
}
/**
* Get node rendition using GET call on 'nodes/{nodeId}/renditions/{renditionId} Please note that it retries to get
* the renditions response several times because on the alfresco server the rendition can take a while to be created.
*
*
* @return
*/
public RestRenditionInfoModel getNodeRenditionUntilIsCreated(String renditionId)
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/renditions/{renditionId}",repoModel.getNodeRef(), renditionId);
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/renditions/{renditionId}", repoModel.getNodeRef(), renditionId);
RestRenditionInfoModel renditions = restWrapper.processModel(RestRenditionInfoModel.class, request);
int retry = 0;
if (Integer.valueOf(restWrapper.getStatusCode()).equals(HttpStatus.OK.value()))
@@ -481,7 +509,7 @@ public class Node extends ModelRequest<Node>
*/
public RestRenditionInfoModel getNodeVersionRenditionUntilIsCreated(String renditionId, String versionId)
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}",repoModel.getNodeRef(), versionId, renditionId);
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}", repoModel.getNodeRef(), versionId, renditionId);
RestRenditionInfoModel renditions = restWrapper.processModel(RestRenditionInfoModel.class, request);
int retry = 0;
if (Integer.valueOf(restWrapper.getStatusCode()).equals(HttpStatus.OK.value()))
@@ -495,13 +523,13 @@ public class Node extends ModelRequest<Node>
}
return renditions;
}
/**
* Get node rendition content using GET call on
* 'nodes/{nodeId}/renditions/{renditionId}/content Please note that it
* retries to get the renditions response several times because on the
* alfresco server the rendition can take a while to be created.
*
*
* @return
*/
public RestResponse getNodeRenditionContentUntilIsCreated(String renditionId)
@@ -532,7 +560,7 @@ public class Node extends ModelRequest<Node>
public RestResponse getNodeVersionRenditionContentUntilIsCreated(String renditionId, String versionId)
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}/content", repoModel.getNodeRef(),
versionId, renditionId);
versionId, renditionId);
RestResponse response = restWrapper.process(request);
int retry = 0;
while (Integer.valueOf(response.getStatusCode()).equals(HttpStatus.NOT_FOUND.value()) && retry < Utility.retryCountSeconds)
@@ -567,7 +595,7 @@ public class Node extends ModelRequest<Node>
public RestResponse getNodeVersionRenditionContent(String renditionId, String versionId)
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}/content", repoModel.getNodeRef(),
versionId, renditionId);
versionId, renditionId);
return restWrapper.process(request);
}
@@ -591,7 +619,7 @@ public class Node extends ModelRequest<Node>
public RestRenditionInfoModelCollection getNodeVersionRenditionsInfo(String versionId)
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/versions/{versionId}/renditions?{parameters}", repoModel.getNodeRef(),
versionId, restWrapper.getParameters());
versionId, restWrapper.getParameters());
return restWrapper.processModels(RestRenditionInfoModelCollection.class, request);
}
@@ -609,18 +637,18 @@ public class Node extends ModelRequest<Node>
/**
* Get a node's children using GET call 'nodes/{nodeId}/children
*
*
* @return a collection of nodes
*/
public RestNodeModelsCollection listChildren()
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/children?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/children?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
return restWrapper.processModels(RestNodeModelsCollection.class, request);
}
/**
* Move a node to a target folder
*
*
* @param moveBody a {@link RestNodeBodyMoveCopyModel} containing at least the target parent id
* @return the moved node's new information
*/
@@ -646,7 +674,7 @@ public class Node extends ModelRequest<Node>
/**
* Lock a specific node using POST call on "nodes/{nodeId}/lock"
*
*
* @return
*/
public RestNodeModel lockNode(RestNodeLockBodyModel lockBody)
@@ -657,7 +685,7 @@ public class Node extends ModelRequest<Node>
/**
* Unlock a specific node using POST call on "nodes/{nodeId}/unlock"
*
*
* @return
*/
public RestNodeModel unlockNode()
@@ -676,20 +704,20 @@ public class Node extends ModelRequest<Node>
/**
* Update a specific node using PUT call on "nodes/{nodeId}"
*
*
* @param putBody
* @return
*/
public RestNodeModel updateNode(String putBody)
{
RestRequest request = RestRequest.requestWithBody(HttpMethod.PUT, putBody, "nodes/{nodeId}?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
RestRequest request = RestRequest.requestWithBody(PUT, putBody, "nodes/{nodeId}?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
request.setContentType("UTF-8");
return restWrapper.processModel(RestNodeModel.class, request);
}
/**
* Retrieve targets for a specific node using GET call on "nodes/{nodeId}/targets
*
*
* @return
*/
public RestNodeAssociationModelCollection getNodeTargets()
@@ -700,20 +728,20 @@ public class Node extends ModelRequest<Node>
/**
* Create new target nodes using POST call on '/nodes/{nodeId}/targets'
*
*
* @param target
* @return
*/
public RestNodeAssocTargetModel createTargetForNode(RestNodeAssocTargetModel target)
{
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, target.toJson(), "nodes/{nodeId}/targets?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
return restWrapper.processModel(RestNodeAssocTargetModel.class, request);
{
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, target.toJson(), "nodes/{nodeId}/targets?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
return restWrapper.processModel(RestNodeAssocTargetModel.class, request);
}
/**
* Delete a target for a specific node using DELETE call on
* nodes/{nodeId}/targets/{targetId}
*
*
* @param target
*/
public void deleteTarget(RestNodeAssocTargetModel target)
@@ -725,7 +753,7 @@ public class Node extends ModelRequest<Node>
/**
* Get sources for a specific node using GET call on GET /nodes/{nodeId}/sources
*
*
* @return
*/
public RestNodeAssociationModelCollection getNodeSources()
@@ -736,7 +764,7 @@ public class Node extends ModelRequest<Node>
/**
* Updates the content of the node with identifier nodeId using PUT call "/nodes/{nodeId}/content"
*
*
* @param nodeContent
* @return
*/
@@ -745,8 +773,8 @@ public class Node extends ModelRequest<Node>
try
{
restWrapper.usingContentType(ContentType.BINARY);
String body = Files.readFile(nodeContent);
RestRequest request = RestRequest.requestWithBody(HttpMethod.PUT, body, "nodes/{nodeId}/content?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
String body = Files.readFile(new FileInputStream(nodeContent));
RestRequest request = RestRequest.requestWithBody(PUT, body, "nodes/{nodeId}/content?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
request.setContentType("UTF-8");
restWrapper.usingContentType(ContentType.JSON);
return restWrapper.processModel(RestNodeModel.class, request);
@@ -759,7 +787,7 @@ public class Node extends ModelRequest<Node>
/**
* Copies the node nodeId to the parent folder node targetParentId using POST call "nodes/{nodeId}/copy"
*
*
* @param postBody
* @return
*/
@@ -769,32 +797,32 @@ public class Node extends ModelRequest<Node>
return restWrapper.processModel(RestNodeModel.class, request);
}
/**
/**
* Get a node's parents using GET call 'nodes/{nodeId}/parents
*
*
* @return a collection of nodes
*/
public RestNodeAssociationModelCollection getParents()
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/parents?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/parents?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
return restWrapper.processModels(RestNodeAssociationModelCollection.class, request);
}
/**
* Get a node's secondary children using GET call 'nodes/{nodeId}/secondary-children
*
*
* @return a collection of nodes
*/
public RestNodeAssociationModelCollection getSecondaryChildren()
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/secondary-children?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/secondary-children?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
return restWrapper.processModels(RestNodeAssociationModelCollection.class, request);
}
/**
* Create secondary children association using POST call 'nodes/{nodeId}/secondary-children
* Use a list of secondary children nodes
*
*
* @return a collection of nodes
*/
public RestNodeChildAssocModelCollection createSecondaryChildren(String secondaryChildren)
@@ -805,7 +833,7 @@ public class Node extends ModelRequest<Node>
/**
* Delete secondary children using DELETE call 'nodes/{nodeId}/secondary-children/{childId}
*
*
* @return a collection of nodes
*/
public void deleteSecondaryChild(RestNodeAssociationModel child)
@@ -816,7 +844,7 @@ public class Node extends ModelRequest<Node>
/**
* Gets the version history as an ordered list for the specified nodeId using GET call 'nodes/{nodeId}/versions
*
*
* @return
*/
public RestVersionModelsCollection listVersionHistory()
@@ -827,7 +855,7 @@ public class Node extends ModelRequest<Node>
/**
* Delete the version identified by versionId for nodeId using DELETE call 'nodes/{nodeId}versions/{versionId}
*
*
* @param versionId
*/
public void deleteNodeVersion(String versionId)
@@ -838,7 +866,7 @@ public class Node extends ModelRequest<Node>
/**
* Gets the version information versionId for node nodeId using GET call 'nodes/{nodeId}/versions/{versionId}
*
*
* @param versionId
* @return
*/
@@ -850,7 +878,7 @@ public class Node extends ModelRequest<Node>
/**
* Gets the content for versionId of node nodeId using GET call 'nodes/{nodeId}/versions/{versionId}/content
*
*
* @param versionId
* @return
*/
@@ -862,7 +890,7 @@ public class Node extends ModelRequest<Node>
/**
* Revert the version identified by versionId and nodeId to the node using POST call 'nodes/{nodeId}/versions/{versionId}/revert
*
*
* @param versionId
* @param postBody
* @return
@@ -899,9 +927,9 @@ public class Node extends ModelRequest<Node>
public RestActionDefinitionModelsCollection getActionDefinitions()
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/action-definitions?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/action-definitions?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
return restWrapper.processModels(RestActionDefinitionModelsCollection.class, request);
}
/**
@@ -964,8 +992,8 @@ public class Node extends ModelRequest<Node>
public ContentStorageInformation usingStorageInfo(String contentPropName)
{
return new ContentStorageInformation(restWrapper)
.withNodeId(repoModel.getNodeRef())
.withContentPropName(contentPropName);
.withNodeId(repoModel.getNodeRef())
.withContentPropName(contentPropName);
}
public ContentStorageInformation usingVersionStorageInfo(String contentPropName, String versionId)
@@ -987,4 +1015,96 @@ public class Node extends ModelRequest<Node>
.withNodeId(repoModel.getNodeRef())
.withRuleSetId(ruleSetId);
}
/**
* Get the rule sets defined on a folder.
*
* @return The list of rule sets.
*/
public RestRuleSetModelsCollection getListOfRuleSets()
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, RULE_SETS_URI,
repoModel.getNodeRef());
return restWrapper.processModels(RestRuleSetModelsCollection.class, request);
}
/**
* Get the specified rule set from a folder.
*
* @param ruleSetId The id of the rule set.
* @return The specified rule set.
*/
public RestRuleSetModel getRuleSet(String ruleSetId)
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, RULE_SET_BY_ID,
repoModel.getNodeRef(), ruleSetId);
return restWrapper.processModel(RestRuleSetModel.class, request);
}
/**
* Update a rule set on this folder - for example to reorder the rules.
*
* @param ruleSet The updated rule set.
* @return The updated rule set returned by the server.
*/
public RestRuleSetModel updateRuleSet(RestRuleSetModel ruleSet)
{
RestRequest request = RestRequest.requestWithBody(HttpMethod.PUT, ruleSet.toJson(), RULE_SET_BY_ID,
repoModel.getNodeRef(), ruleSet.getId());
return restWrapper.processModel(RestRuleSetModel.class, request);
}
/**
* Get the default rule set from a folder.
*
* @return The specified rule set.
*/
public RestRuleSetModel getDefaultRuleSet()
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, RULE_SET_BY_ID,
repoModel.getNodeRef(), "-default-");
return restWrapper.processModel(RestRuleSetModel.class, request);
}
public RuleSettings usingRuleSetting(String ruleSettingKey)
{
return new RuleSettings(restWrapper)
.withNodeId(repoModel.getNodeRef())
.withRuleSettingKey(ruleSettingKey);
}
public RuleSettings usingIsInheritanceEnabledRuleSetting()
{
return usingRuleSetting(IS_INHERITANCE_ENABLED);
}
public RestRuleSetLinkModel createRuleLink(RestRuleSetLinkModel body)
{
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, body.toJson(), "nodes/{nodeId}/rule-set-links", repoModel.getNodeRef());
return restWrapper.processModel(RestRuleSetLinkModel.class, request);
}
/**
* Try to delete a ruleset link performing a DELETE call on "/nodes/{folderNodeId}/rule-set-links/{rulesetId}"
*
* @param ruleSetId the id of the ruleset to be unlinked from the folder
* @return
*/
public void unlinkRuleSet(String ruleSetId)
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.DELETE, "nodes/{nodeId}/rule-set-links/{ruleSetId}", repoModel.getNodeRef(), ruleSetId);
restWrapper.processEmptyModel(request);
}
/**
* Trigger rules on a folder performing POST call on "/nodes/{folderNodeId}/rule-executions"
*
* @param body - rules execution request
* @return execution result
*/
public RestRuleExecutionModel executeRules(RestRuleExecutionBodyModel body)
{
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, body.toJson(), "nodes/{nodeId}/rule-executions", repoModel.getNodeRef());
return restWrapper.processModel(RestRuleExecutionModel.class, request);
}
}

View File

@@ -0,0 +1,75 @@
/*-
* #%L
* alfresco-tas-restapi
* %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* Copyright 2022 Alfresco Software, Ltd. All rights reserved.
* License rights for this program may be obtained from Alfresco Software, Ltd.
* pursuant to a written agreement and any use of this program without such an
* agreement is prohibited.
*/
package org.alfresco.rest.requests;
import org.alfresco.rest.core.RestRequest;
import org.alfresco.rest.core.RestWrapper;
import org.alfresco.rest.model.RestRuleSettingsModel;
import org.springframework.http.HttpMethod;
public class RuleSettings extends ModelRequest<FolderRules>
{
public static final String IS_INHERITANCE_ENABLED = "-isInheritanceEnabled-";
private static final String BASE_PATH = "nodes/{nodeId}/rule-settings/{ruleSettingKey}";
private String nodeId;
private String ruleSettingKey;
public RuleSettings(RestWrapper restWrapper)
{
super(restWrapper);
}
public RuleSettings withNodeId(String nodeId)
{
this.nodeId = nodeId;
return this;
}
public RuleSettings withRuleSettingKey(String ruleSettingKey)
{
this.ruleSettingKey = ruleSettingKey;
return this;
}
public RestRuleSettingsModel retrieveSetting()
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, BASE_PATH, nodeId, ruleSettingKey);
return restWrapper.processModel(RestRuleSettingsModel.class, request);
}
public RestRuleSettingsModel updateSetting(RestRuleSettingsModel ruleSettingsModel)
{
RestRequest request = RestRequest.requestWithBody(HttpMethod.PUT, ruleSettingsModel.toJson(), BASE_PATH, nodeId, ruleSettingKey);
return restWrapper.processModel(RestRuleSettingsModel.class, request);
}
}

View File

@@ -54,7 +54,6 @@ public class Sync extends ModelRequest<RestPrivateAPI>
RestSyncNodeSubscriptionModel subscription;
String requestSyncURL = "subscribers/{deviceSubscriptionId}/subscriptions/{nodeSubscriptionId}/sync";
String syncSetURL = requestSyncURL + "/{syncId}";
String params = "?{parameters}";
public Sync(RestSyncNodeSubscriptionModel subscription, RestWrapper restWrapper)
{
@@ -82,7 +81,7 @@ public class Sync extends ModelRequest<RestPrivateAPI>
String postBody = JsonBodyGenerator.defineJSON().add("changes", array.build()).add("clientVersion", clientVersion).build().toString();
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, postBody, requestSyncURL + params, this.subscriber, nodeSubscriptionModel.getId(),
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, postBody, requestSyncURL, this.subscriber, nodeSubscriptionModel.getId(),
restWrapper.getParameters());
// This step is necessary for this request. Without it, empty json response is returned
@@ -94,7 +93,7 @@ public class Sync extends ModelRequest<RestPrivateAPI>
public RestWrapper endSync(RestSyncNodeSubscriptionModel nodeSubscriptionModel, RestSyncSetRequestModel sync)
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.DELETE, syncSetURL + params, this.subscriber, nodeSubscriptionModel.getId(),
RestRequest request = RestRequest.simpleRequest(HttpMethod.DELETE, syncSetURL, this.subscriber, nodeSubscriptionModel.getId(),
sync.getSyncId(), restWrapper.getParameters());
restWrapper.processEmptyModel(request);
@@ -111,7 +110,7 @@ public class Sync extends ModelRequest<RestPrivateAPI>
*/
public RestSyncSetGetModel getSync(RestSyncNodeSubscriptionModel nodeSubscriptionModel, RestSyncSetRequestModel sync)
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, syncSetURL + params, this.subscriber, nodeSubscriptionModel.getId(), sync.getSyncId(),
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, syncSetURL, this.subscriber, nodeSubscriptionModel.getId(), sync.getSyncId(),
restWrapper.getParameters());
RestSyncSetGetModel model = restWrapper.processModelWithoutEntryObject(RestSyncSetGetModel.class, request);

View File

@@ -44,7 +44,6 @@
package org.alfresco.rest.search;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
/**
@@ -102,24 +101,10 @@ public class FacetFieldBucket extends TestModel implements IRestModel<FacetField
this.filterQuery = filterQuery;
}
@Override
public ModelAssertion<FacetFieldBucket> and()
{
return assertThat();
}
@Override
public ModelAssertion<FacetFieldBucket> assertThat()
{
return new ModelAssertion<FacetFieldBucket>(this);
}
@Override
public FacetFieldBucket onModel()
{
// TODO Auto-generated method stub
return null;
}
}

View File

@@ -25,12 +25,11 @@
*/
package org.alfresco.rest.search;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.rest.core.assertion.ModelAssertion;
import org.alfresco.utility.model.TestModel;
import java.util.List;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Represents a facet interval.
*/
@@ -87,16 +86,4 @@ public class FacetInterval extends TestModel implements IRestModel<FacetInterval
{
return null;
}
@Override
public ModelAssertion<FacetInterval> and()
{
return assertThat();
}
@Override
public ModelAssertion<FacetInterval> assertThat()
{
return new ModelAssertion<FacetInterval>(this);
}
}

View File

@@ -49,7 +49,7 @@ import org.alfresco.utility.model.TestModel;
* Pojo to represent facet query.
* {"query": "content.size:[o TO 102400]", "label": "small"},
**/
public class FacetQuery extends TestModel //implements IRestModel<FacetQuery>
public class FacetQuery extends TestModel
{
private String query;
@@ -93,22 +93,4 @@ public class FacetQuery extends TestModel //implements IRestModel<FacetQuery>
{
this.group = group;
}
/* @Override
public ModelAssertion<FacetQuery> and()
{
return assertThat();
}
@Override
public ModelAssertion<FacetQuery> assertThat()
{
return new ModelAssertion<FacetQuery>(this);
}
@Override
public FacetQuery onModel()
{
return null;
}*/
}

Some files were not shown because too many files have changed in this diff Show More