mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-24 14:32:01 +00:00
Compare commits
573 Commits
20.94
...
ACS-4879_S
Author | SHA1 | Date | |
---|---|---|---|
|
1f68672fb6 | ||
|
75f2205a65 | ||
|
7bd31eca5f | ||
|
8938aaff09 | ||
|
18dadfe110 | ||
|
4e9fb76404 | ||
|
295c3ba58e | ||
|
195e0e927c | ||
|
3d57a27de1 | ||
|
e0dc0be076 | ||
|
32a35e273e | ||
|
a99feae1e2 | ||
|
96815b8ec4 | ||
|
b0adc1a6bb | ||
|
828c98d03f | ||
|
1812c43b04 | ||
|
1d4c97cfb7 | ||
|
e0d5d0691f | ||
|
96942ceeb9 | ||
|
2d16c28859 | ||
|
d2a4de152b | ||
|
51fe0275df | ||
|
f220eb5c0f | ||
|
4786a0fb0b | ||
|
d2bbdc4d0e | ||
|
3f91a6001f | ||
|
1f1b534a28 | ||
|
689e6a23fa | ||
|
064044fa0e | ||
|
562c83bb9c | ||
|
4ff91be9f4 | ||
|
f3190133c3 | ||
|
8325cd7c66 | ||
|
aeb931b018 | ||
|
6679a33412 | ||
|
aea504f911 | ||
|
fb235e1682 | ||
|
4065400dbd | ||
|
02aa423087 | ||
|
0dbd2fb3d0 | ||
|
c30c96de47 | ||
|
fa9ffbe71a | ||
|
826db75625 | ||
|
04df3385fd | ||
|
cc12b34c7f | ||
|
3fb8875453 | ||
|
a207915824 | ||
|
c110e2b76c | ||
|
3d1ef4883b | ||
|
5fadaf76f3 | ||
|
afa2bbf325 | ||
|
1d665f4e50 | ||
|
6a527068dc | ||
|
a45c04679f | ||
|
e48c68c86c | ||
|
bc6398c038 | ||
|
32f88bd2fd | ||
|
aba5a08827 | ||
|
339d052c7c | ||
|
8cc22cfe15 | ||
|
0e8d5a3503 | ||
|
ec5c9e1b79 | ||
|
db7e2d6154 | ||
|
9de2769b2c | ||
|
021af742ce | ||
|
2aa045e0de | ||
|
b8f7607a20 | ||
|
9842e0d548 | ||
|
131fbbe8be | ||
|
e145b55094 | ||
|
1463d4d0db | ||
|
cf9e064c5a | ||
|
7ebfd9ff0e | ||
|
5a089019eb | ||
|
e98f279858 | ||
|
0fb3071746 | ||
|
5eef58d6f0 | ||
|
c76a8a322d | ||
|
5f52ef9251 | ||
|
43f1100040 | ||
|
8bade25669 | ||
|
1e6e87f24a | ||
|
cac97dc1e7 | ||
|
3bcef29c30 | ||
|
fb98bb09f0 | ||
|
ad723a700a | ||
|
1bc5bed838 | ||
|
beaf83a008 | ||
|
8734eec068 | ||
|
bedbc10c8a | ||
|
d354dd7ab7 | ||
|
764ca0fcf1 | ||
|
762199b762 | ||
|
3540c14a43 | ||
|
0e29d98747 | ||
|
dc304b4108 | ||
|
1e506659d2 | ||
|
b834ab9245 | ||
|
402c0661e0 | ||
|
763f0932a0 | ||
|
0403fcde69 | ||
|
1866e64d07 | ||
|
47b793b922 | ||
|
8ebaf16a45 | ||
|
c3dcf8891e | ||
|
ca6697ab44 | ||
|
82bdd30459 | ||
|
9815b1b3fe | ||
|
585714fa02 | ||
|
78b69b09c0 | ||
|
c9009b9afc | ||
|
685d80a468 | ||
|
041b6ba97e | ||
|
5cdb5f2922 | ||
|
7c545a7066 | ||
|
4d75f7f719 | ||
|
ddf02be9fa | ||
|
15ed269a15 | ||
|
bb6900f5d6 | ||
|
6687066edc | ||
|
b075fb9f0a | ||
|
f28edb54a7 | ||
|
2bac9bd9d1 | ||
|
fffef168d9 | ||
|
1968e7d14c | ||
|
0f89c3ce8a | ||
|
61cab1900b | ||
|
0de33ea361 | ||
|
c856b3308b | ||
|
daaedcb143 | ||
|
58e407d4dd | ||
|
b017ba3d1d | ||
|
c84f59b3d3 | ||
|
f546d88726 | ||
|
9eece9bbfb | ||
|
497b197c12 | ||
|
2b8ea3bb50 | ||
|
5e7394a37d | ||
|
d5b67374d0 | ||
|
f50e0b80e6 | ||
|
89329d7984 | ||
|
3f94b1632b | ||
|
d0f6867887 | ||
|
49c56e9a9d | ||
|
2be95ec6d7 | ||
|
bf34ed22a2 | ||
|
be679878e0 | ||
|
92dfee1548 | ||
|
78b54e65c4 | ||
|
b93212f3bf | ||
|
636d63e34f | ||
|
a4076dc7ea | ||
|
ad934e511d | ||
|
16db159092 | ||
|
fd8e44e365 | ||
|
57877ad30b | ||
|
ed924094ff | ||
|
3181d2b8bf | ||
|
2891a3ba61 | ||
|
92f27bbcd7 | ||
|
80d4db2e81 | ||
|
6bd598fadf | ||
|
c1b4b30262 | ||
|
f0e5dcaa67 | ||
|
07c7342032 | ||
|
b0af817377 | ||
|
e8cf0f7d12 | ||
|
b8e621d3d9 | ||
|
a62db22ecb | ||
|
5fcee3ec55 | ||
|
8a6274b37e | ||
|
d279b3e3c3 | ||
|
da5505a21f | ||
|
e476334998 | ||
|
7990991453 | ||
|
9289fc7f89 | ||
|
20af2a5dd9 | ||
|
59069ae38f | ||
|
ea4eac5a77 | ||
|
83bc0dcee1 | ||
|
5af7a1e284 | ||
|
11333eb1e5 | ||
|
e901ffb751 | ||
|
7dbe25d754 | ||
|
1f764b446e | ||
|
4c256ab546 | ||
|
8fe2f5b251 | ||
|
841826fcdd | ||
|
1a98715d35 | ||
|
334126ec72 | ||
|
e02c334362 | ||
|
269cc165e0 | ||
|
b724203f5b | ||
|
5912726372 | ||
|
eb85205df1 | ||
|
88616a2c48 | ||
|
90e9764d63 | ||
|
50e91a40bc | ||
|
391ba106c4 | ||
|
46942b9e77 | ||
|
4ff76617a9 | ||
|
82c671c07a | ||
|
06ce348cdd | ||
|
099cbb614c | ||
|
0acc6d31ef | ||
|
a218cfa0ed | ||
|
e00959a089 | ||
|
a9ac83704b | ||
|
603f334c46 | ||
|
2de971dad3 | ||
|
31f347e42f | ||
|
e88b4e96ee | ||
|
6e408235f2 | ||
|
182211ee32 | ||
|
380b63d63b | ||
|
08312a5153 | ||
|
9dafa748af | ||
|
fec31aed1c | ||
|
92af01368b | ||
|
019b3d4de3 | ||
|
c2728a4239 | ||
|
9f68abcfda | ||
|
390e533107 | ||
|
a7e0491532 | ||
|
434e4d3dc3 | ||
|
c88d1802a1 | ||
|
490c87ec9a | ||
|
ae479351c2 | ||
|
44cf210b27 | ||
|
99a1c05c39 | ||
|
4f6786ee95 | ||
|
5d9dca1872 | ||
|
bf7f64add4 | ||
|
7d15862b69 | ||
|
2e8ec4c226 | ||
|
24752d0409 | ||
|
ff8804e7db | ||
|
02a62cb5f7 | ||
|
e1afe15055 | ||
|
0fcdf3b00b | ||
|
fa63cef4f7 | ||
|
27f41e11b3 | ||
|
affa20e996 | ||
|
0df9f562e6 | ||
|
9a3ec69b27 | ||
|
7126406bf3 | ||
|
edc43ed5b9 | ||
|
907aed826a | ||
|
eaa96607b9 | ||
|
0d5d9ff0b4 | ||
|
5266304805 | ||
|
63e77b6f86 | ||
|
9cf74e4dc4 | ||
|
4107a0fd0e | ||
|
8554fe0d74 | ||
|
2ed88cd1be | ||
|
8f4f4e938c | ||
|
dc76b15aa6 | ||
|
0109db978f | ||
|
6461629024 | ||
|
c35dbb0481 | ||
|
637523c2c8 | ||
|
f1a54895f6 | ||
|
7f6d9443e2 | ||
|
297d72c246 | ||
|
7208ad9b62 | ||
|
31ca2726a8 | ||
|
6f43286441 | ||
|
aec50a991f | ||
|
f62b937ded | ||
|
66d3d72f7c | ||
|
0b4b9fd47a | ||
|
2b955d21f9 | ||
|
6a853f3b92 | ||
|
c293ace4e0 | ||
|
86dfdd8df4 | ||
|
abd73e820c | ||
|
09bec28721 | ||
|
0d1a6c8a0a | ||
|
4b9c052f0d | ||
|
6fb0bb3042 | ||
|
78f3d58c46 | ||
|
1913258e84 | ||
|
d95e6c8e34 | ||
|
958d217339 | ||
|
4417e28412 | ||
|
58653cb523 | ||
|
7af935d43a | ||
|
f5d843446a | ||
|
817901e74e | ||
|
c492683113 | ||
|
e2305d053f | ||
|
749768457e | ||
|
118f2ecbab | ||
|
a4ac93df7a | ||
|
1e1fbe8207 | ||
|
e78f9ced98 | ||
|
72221c777d | ||
|
25f3f33594 | ||
|
f83328f7b0 | ||
|
a177f391db | ||
|
784557afcd | ||
|
8fb7b0d224 | ||
|
011ec9d7e6 | ||
|
3900f589d9 | ||
|
def7a0d432 | ||
|
7371c5d7ff | ||
|
90406cef03 | ||
|
862e6d5596 | ||
|
27be717df5 | ||
|
28ad071daf | ||
|
06cc5e3499 | ||
|
df8b36350d | ||
|
552abc9bd4 | ||
|
00cab8e6b5 | ||
|
6f4069790c | ||
|
146b59a4a8 | ||
|
2c3845bf9d | ||
|
dd05f3d338 | ||
|
c2338bdeb2 | ||
|
589e14a0b1 | ||
|
0f753c11c7 | ||
|
c8fea93298 | ||
|
d7f881ce0c | ||
|
b5fabb1290 | ||
|
f6d3ff4b15 | ||
|
2eb5bb7b7a | ||
|
53909dc086 | ||
|
4fedf0bada | ||
|
9f6edc648e | ||
|
22298eaa46 | ||
|
2e9db406d4 | ||
|
8565c9413e | ||
|
0d411cd759 | ||
|
ca3bbf5226 | ||
|
e83cd86c4d | ||
|
7da314cd97 | ||
|
d39401a7ec | ||
|
05df8a7582 | ||
|
85f22cb6e4 | ||
|
ce77b1ff42 | ||
|
29a7de55d2 | ||
|
cb3cb85694 | ||
|
2fcf1bd2d5 | ||
|
4c687f670e | ||
|
dad0094a46 | ||
|
06fdc4302e | ||
|
b1466915af | ||
|
6be773ba18 | ||
|
fbcfe68c99 | ||
|
e50118115e | ||
|
3a2136b886 | ||
|
86464427a0 | ||
|
7e9e0e1ad4 | ||
|
32c3a5ad90 | ||
|
e983e4ed22 | ||
|
ba197fcf70 | ||
|
18e6965a61 | ||
|
c0757f45a2 | ||
|
7bdbc3a91a | ||
|
25fa97bdd8 | ||
|
7592b637cc | ||
|
70c490f26c | ||
|
93f7d06cf0 | ||
|
657318c6ae | ||
|
4f4d8210ef | ||
|
14ba7f5d55 | ||
|
c4a4aedad7 | ||
|
be60d67377 | ||
|
806131c21c | ||
|
b0f767c1ae | ||
|
baccde2663 | ||
|
e048278a27 | ||
|
8586d22b95 | ||
|
3dec621b15 | ||
|
64202ee9d5 | ||
|
2b92022b5b | ||
|
9a56a052e8 | ||
|
1f38c24bbd | ||
|
0bcb96e51e | ||
|
df522a38b9 | ||
|
1458ef3311 | ||
|
2bdca1a4f5 | ||
|
07cc9aa86e | ||
|
7db550cee1 | ||
|
937d80327f | ||
|
8abff868cc | ||
|
ffae8a62a1 | ||
|
0350c966df | ||
|
833a7675bc | ||
|
8aa263f377 | ||
|
73f30b7ef2 | ||
|
4bf58cc99c | ||
|
d53881d87f | ||
|
937601020d | ||
|
429b389b08 | ||
|
c944f3560c | ||
|
40ff2558f5 | ||
|
4f69f28586 | ||
|
aa66dd748f | ||
|
bf9c8ab870 | ||
|
959cf8f13f | ||
|
8b4285afbd | ||
|
7143f5975f | ||
|
31944bfc0f | ||
|
c874fa4e51 | ||
|
5780871f0c | ||
|
85ef347dc3 | ||
|
0a76858778 | ||
|
6db6245e53 | ||
|
7b572a3e02 | ||
|
b1cbebacc3 | ||
|
0bbe73aee1 | ||
|
9135fdae8b | ||
|
0cb0cfa8f6 | ||
|
5a96cce5bb | ||
|
c999fb25b9 | ||
|
3c2643dbf2 | ||
|
106e398393 | ||
|
0612d74c68 | ||
|
eb6157ed2a | ||
|
72a573c090 | ||
|
13e3369a7f | ||
|
444de08f91 | ||
|
1c45748f9a | ||
|
2b7ff213a9 | ||
|
f693c49e87 | ||
|
5f5c377532 | ||
|
0f156ba259 | ||
|
31a0a51290 | ||
|
c8fe044993 | ||
|
28058864e6 | ||
|
23ccb397f4 | ||
|
73ae0d0a6e | ||
|
f9b5e5a6fe | ||
|
e5bfb0298d | ||
|
34cb9bf76a | ||
|
fcbd406170 | ||
|
730ab768e9 | ||
|
fab591eb9b | ||
|
f1561504cd | ||
|
5bb96729fc | ||
|
a80f2c4db7 | ||
|
82df7ce5d4 | ||
|
73a1de37f6 | ||
|
63f9a8e142 | ||
|
f668ed9198 | ||
|
ea15673116 | ||
|
6a2a298445 | ||
|
4b0a6d27f9 | ||
|
b432fdc6a3 | ||
|
7d62c89708 | ||
|
e79fcf64a5 | ||
|
5df4cfff58 | ||
|
66ab0c4f46 | ||
|
1d1252438c | ||
|
e4ac036f9f | ||
|
a9ec842358 | ||
|
9590051941 | ||
|
37618bd56a | ||
|
8bb30643d4 | ||
|
f0e0819bc5 | ||
|
5999a448d4 | ||
|
8f00b44a03 | ||
|
c0d1b33201 | ||
|
4053daaf1a | ||
|
6942294780 | ||
|
384177a9d9 | ||
|
bbdeb5ae97 | ||
|
95fb286c14 | ||
|
0652cea296 | ||
|
a86a954771 | ||
|
c27a44d711 | ||
|
ef089472fb | ||
|
5769cbe54e | ||
|
9899f16d61 | ||
|
219acd6c53 | ||
|
70b7d5a1f8 | ||
|
279679d78a | ||
|
6d1dcf6c7e | ||
|
18810de7d0 | ||
|
fb119565dc | ||
|
10b0d7b5f0 | ||
|
36292d749e | ||
|
c1d424b386 | ||
|
06c6efc6c9 | ||
|
626e5b34ef | ||
|
a549859cbe | ||
|
f2d858f911 | ||
|
808a7c67b7 | ||
|
dafa77d0a0 | ||
|
fd96c90c08 | ||
|
a41fcdff0f | ||
|
ab461e34af | ||
|
c92ef4393c | ||
|
ebdc9e159e | ||
|
d885c47df7 | ||
|
a1ccc14a93 | ||
|
0023612623 | ||
|
abf9bf8d71 | ||
|
162e164a0c | ||
|
55b0044965 | ||
|
cfe212d52f | ||
|
a3cafb7c4c | ||
|
9ddbda377d | ||
|
e42e2b2c8e | ||
|
9090dea75b | ||
|
a26ac1f778 | ||
|
8e1d4782b4 | ||
|
4c409c925b | ||
|
7cbfab81ce | ||
|
addc2c202b | ||
|
7b523e5ad9 | ||
|
7567e83955 | ||
|
d6082f84ac | ||
|
4f58031178 | ||
|
7aff9366ce | ||
|
58235fd891 | ||
|
bb204c4cea | ||
|
ae29ae8581 | ||
|
4b351fbfdc | ||
|
653f733887 | ||
|
623782dc97 | ||
|
3e9964d53f | ||
|
23761f6c56 | ||
|
2f8c283ada | ||
|
5232b8c3fe | ||
|
b90938bb99 | ||
|
d243ac04c6 | ||
|
e651f6e104 | ||
|
e4776e2594 | ||
|
acc5425d68 | ||
|
a96e805d52 | ||
|
45a9a1ae49 | ||
|
bf18c6b419 | ||
|
e728489b69 | ||
|
f2fdf958f2 | ||
|
0cb03c2a38 | ||
|
b13ca1f68b | ||
|
484699b266 | ||
|
a15161c872 | ||
|
b3a6150655 | ||
|
42e06da4f8 | ||
|
4ac30c2173 | ||
|
d1d84d849e | ||
|
40af1799fe | ||
|
f59e4a044a | ||
|
5924263c18 | ||
|
082e38692f | ||
|
f5c4112e65 | ||
|
ad8251c054 | ||
|
32d0182096 | ||
|
2ac9779a3b | ||
|
af999fb0fd | ||
|
ddbaabb713 | ||
|
b93136f2c0 | ||
|
923aadb12a | ||
|
212fa9b362 | ||
|
267bd98d21 | ||
|
bcaeedb162 | ||
|
f93bced905 | ||
|
c3e37b96b4 | ||
|
91f3edf8e9 | ||
|
479724365e | ||
|
bb1d5899d9 | ||
|
7ab5e8afd0 | ||
|
5107fdfe41 | ||
|
f59ff23a45 | ||
|
5e2f1db714 | ||
|
67ee2efc60 | ||
|
1e7dc6ed8d | ||
|
e5ea6db30c | ||
|
78a613b1de |
18
.github/dependabot.yml
vendored
18
.github/dependabot.yml
vendored
@@ -53,24 +53,6 @@ updates:
|
||||
- dependency-name: org.freemarker:freemarker
|
||||
versions:
|
||||
- "> 2.3.20-alfresco-patched-20200421"
|
||||
- dependency-name: org.keycloak:keycloak-adapter-core
|
||||
versions:
|
||||
- "> 12.0.2"
|
||||
- dependency-name: org.keycloak:keycloak-adapter-spi
|
||||
versions:
|
||||
- "> 12.0.2"
|
||||
- dependency-name: org.keycloak:keycloak-authz-client
|
||||
versions:
|
||||
- "> 12.0.2"
|
||||
- dependency-name: org.keycloak:keycloak-common
|
||||
versions:
|
||||
- "> 12.0.2"
|
||||
- dependency-name: org.keycloak:keycloak-core
|
||||
versions:
|
||||
- "> 12.0.2"
|
||||
- dependency-name: org.keycloak:keycloak-servlet-adapter-spi
|
||||
versions:
|
||||
- "> 12.0.2"
|
||||
- dependency-name: org.eclipse.jetty:jetty-server
|
||||
versions:
|
||||
- 9.4.38.v20210224
|
||||
|
58
.github/workflows/ci.yml
vendored
58
.github/workflows/ci.yml
vendored
@@ -17,12 +17,14 @@ on:
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||
GIT_HTTP_CREDENTIALS: "${{ secrets.BOT_GITHUB_USERNAME }}:${{ secrets.BOT_GITHUB_TOKEN }}"
|
||||
GITHUB_ACTIONS_DEPLOY_TIMEOUT: 60
|
||||
LOG_WARN: "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
|
||||
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
|
||||
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
|
||||
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
|
||||
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
|
||||
CI_WORKSPACE: ${{ github.workspace }}
|
||||
TAS_ENVIRONMENT: ./packaging/tests/environment
|
||||
TAS_SCRIPTS: ../alfresco-community-repo/packaging/tests/scripts
|
||||
|
||||
@@ -64,7 +66,21 @@ jobs:
|
||||
srcclr-api-token: ${{ secrets.SRCCLR_API_TOKEN }}
|
||||
- name: "Clean Maven cache"
|
||||
run: bash ./scripts/ci/cleanup_cache.sh
|
||||
|
||||
|
||||
pmd_scan:
|
||||
name: "PMD Scan"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [prepare]
|
||||
if: >
|
||||
github.event_name == 'pull_request' &&
|
||||
!contains(github.event.head_commit.message, '[skip pmd]') &&
|
||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
!contains(github.event.head_commit.message, '[force]')
|
||||
steps:
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/pmd@v2.5.0
|
||||
with:
|
||||
fail-on-new-issues: "false"
|
||||
|
||||
all_unit_tests_suite:
|
||||
name: "Core, Data-Model, Repository - AllUnitTestsSuite - Build and test"
|
||||
runs-on: ubuntu-latest
|
||||
@@ -313,6 +329,11 @@ jobs:
|
||||
- testSuite: SearchTestSuite
|
||||
compose-profile: default
|
||||
mvn-options: '-Dindex.subsystem.name=solr6'
|
||||
- testSuite: MTLSTestSuite
|
||||
compose-profile: with-mtls-transform-core-aio
|
||||
mtls: true
|
||||
disabledHostnameVerification: false
|
||||
mvn-options: '-Dencryption.ssl.keystore.location=${CI_WORKSPACE}/keystores/alfresco/alfresco.keystore -Dencryption.ssl.truststore.location=${CI_WORKSPACE}/keystores/alfresco/alfresco.truststore'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
||||
@@ -321,6 +342,17 @@ jobs:
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Set transformers tag"
|
||||
run: echo "TRANSFORMERS_TAG=$(mvn help:evaluate -Dexpression=dependency.alfresco-transform-core.version -q -DforceStdout)" >> $GITHUB_ENV
|
||||
- name: "Generate Keystores and Truststores for Mutual TLS configuration"
|
||||
if: ${{ matrix.mtls }}
|
||||
run: |
|
||||
git clone -b "master" --depth=1 "https://${{ secrets.BOT_GITHUB_USERNAME }}:${{ secrets.BOT_GITHUB_TOKEN }}@github.com/Alfresco/alfresco-ssl-generator.git"
|
||||
if ${{ matrix.disabledHostnameVerification }} ; then
|
||||
bash ${{ env.CI_WORKSPACE }}/alfresco-ssl-generator/scripts/ci/generate_keystores_wrong_hostnames.sh
|
||||
echo "HOSTNAME_VERIFICATION_DISABLED=true" >> "$GITHUB_ENV"
|
||||
else
|
||||
bash ${{ env.CI_WORKSPACE }}/alfresco-ssl-generator/scripts/ci/generate_keystores.sh
|
||||
echo "HOSTNAME_VERIFICATION_DISABLED=false" >> "$GITHUB_ENV"
|
||||
fi
|
||||
- name: "Set up the environment"
|
||||
run: |
|
||||
if [ -e ./scripts/ci/tests/${{ matrix.testSuite }}-setup.sh ]; then
|
||||
@@ -530,3 +562,27 @@ jobs:
|
||||
aws s3 cp --acl private ./amps/ags/rm-automation/rm-automation-community-rest-api/target/reports/rm-automation-community-rest-api.log s3://ags-travis-artifacts/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests/rm-automation-community-rest-api.log
|
||||
- name: "Clean Maven cache"
|
||||
run: bash ./scripts/ci/cleanup_cache.sh
|
||||
|
||||
ags_start_api_explorer:
|
||||
name: "Test Tomcat deployment of api explorer"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ prepare ]
|
||||
if: >
|
||||
(((github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request' ) &&
|
||||
!contains(github.event.head_commit.message, '[skip ags]')) ||
|
||||
contains(github.event.head_commit.message, '[ags]')) &&
|
||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
!contains(github.event.head_commit.message, '[force]')
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0
|
||||
- name: "Build"
|
||||
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||
run: |
|
||||
bash ./scripts/ci/init.sh
|
||||
bash ./scripts/ci/build.sh
|
||||
- name: "Test Tomcat deployment"
|
||||
run: |
|
||||
mvn verify -Pags,start-api-explorer -DskipTests &
|
||||
${{ env.TAS_SCRIPTS }}/wait-for-alfresco-start.sh "http://localhost:8085/api-explorer"
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>20.94</version>
|
||||
<version>23.1.0.155-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>20.94</version>
|
||||
<version>23.1.0.155-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
|
||||
<version>20.94</version>
|
||||
<version>23.1.0.155-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
@@ -82,7 +82,7 @@
|
||||
<dependency>
|
||||
<groupId>com.github.docker-java</groupId>
|
||||
<artifactId>docker-java</artifactId>
|
||||
<version>3.2.13</version>
|
||||
<version>3.3.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@@ -28,7 +28,7 @@ package org.alfresco.rest.core;
|
||||
|
||||
import static lombok.AccessLevel.PROTECTED;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
@@ -512,7 +512,12 @@ public abstract class BaseAPI
|
||||
try
|
||||
{
|
||||
HttpResponse httpResponse = doRequestJson(HttpPost.class, requestUrl, adminUser, adminPassword, requestParams);
|
||||
assertEquals("POST request to " + requestUrl + " was not successful.", expectedStatusCode, httpResponse.getStatusLine().getStatusCode());
|
||||
if (httpResponse.getStatusLine().getStatusCode() != expectedStatusCode)
|
||||
{
|
||||
// It's only possible to stream the response body once, so ensure we only do this if the test has failed.
|
||||
JSONObject responseJson = responseBodyToJson(httpResponse);
|
||||
assertEquals("POST request to " + requestUrl + " was not successful. Response: " + responseJson, expectedStatusCode, httpResponse.getStatusLine().getStatusCode());
|
||||
}
|
||||
return httpResponse;
|
||||
}
|
||||
catch (InstantiationException | IllegalAccessException error)
|
||||
@@ -521,6 +526,32 @@ public abstract class BaseAPI
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to convert the response body to a JSON object.
|
||||
*
|
||||
* @param response The response.
|
||||
* @return The JSON object or null if it was not possible to convert the response.
|
||||
*/
|
||||
private JSONObject responseBodyToJson(HttpResponse response)
|
||||
{
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
return new JSONObject(EntityUtils.toString(response.getEntity()));
|
||||
}
|
||||
catch (JSONException error)
|
||||
{
|
||||
LOGGER.error("Converting message body to JSON failed. Body: {}", response.getEntity().getContent(), error);
|
||||
}
|
||||
}
|
||||
catch (ParseException | IOException error)
|
||||
{
|
||||
LOGGER.error("Parsing message body failed.", error);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method for handling generic HTTP requests
|
||||
* @param requestType request type (a subclass of {@link HttpRequestBase})
|
||||
@@ -558,18 +589,7 @@ public abstract class BaseAPI
|
||||
HttpResponse response = client.execute(adminUser, adminPassword, request);
|
||||
LOGGER.info("Response: {}", response.getStatusLine());
|
||||
|
||||
try
|
||||
{
|
||||
responseBody = new JSONObject(EntityUtils.toString(response.getEntity()));
|
||||
}
|
||||
catch (JSONException error)
|
||||
{
|
||||
LOGGER.error("Converting message body to JSON failed. Body: {}", responseBody, error);
|
||||
}
|
||||
catch (ParseException | IOException error)
|
||||
{
|
||||
LOGGER.error("Parsing message body failed.", error);
|
||||
}
|
||||
responseBody = responseBodyToJson(response);
|
||||
|
||||
switch (response.getStatusLine().getStatusCode())
|
||||
{
|
||||
|
@@ -50,6 +50,7 @@ import org.apache.http.HttpResponse;
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.json.JSONObject;
|
||||
import org.junit.Ignore;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.testng.AssertJUnit;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
@@ -135,192 +136,195 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest {
|
||||
* <p>
|
||||
* <p/> TestRail Test C775<p/>
|
||||
**/
|
||||
@Test
|
||||
@AlfrescoTest(jira = "RM-1622")
|
||||
public void dispositionScheduleLinkedRecords() throws UnsupportedEncodingException {
|
||||
STEP("Create record category");
|
||||
Category1 = createRootCategory(categoryRM3077);
|
||||
// @Ignore("ACS-5020")
|
||||
// @Test
|
||||
// @AlfrescoTest(jira = "RM-1622")
|
||||
// public void dispositionScheduleLinkedRecords() throws UnsupportedEncodingException {
|
||||
// STEP("Create record category");
|
||||
// Category1 = createRootCategory(categoryRM3077);
|
||||
//
|
||||
// //create retention schedule
|
||||
// dispositionScheduleService.createCategoryRetentionSchedule(Category1.getName(), false);
|
||||
//
|
||||
// // add cut off step
|
||||
// dispositionScheduleService.addCutOffAfterPeriodStep(Category1.getName(), "day|2", CREATED_DATE);
|
||||
//
|
||||
// //create a copy of the category recordsCategory
|
||||
// String CopyCategoryId = copyCategory(getAdminUser(),Category1.getId(), copyCategoryRM3077);
|
||||
//
|
||||
// // create folders in both categories
|
||||
// CatFolder = createRecordFolder(Category1.getId(), folderRM3077);
|
||||
// CopyCatFolder = createRecordFolder(CopyCategoryId, copyFolderRM3077);
|
||||
//
|
||||
// // create record files
|
||||
// String electronicRecord = "RM-2801 electronic record";
|
||||
// Record elRecord = createElectronicRecord(CatFolder.getId(), electronicRecord);
|
||||
// String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||
// getDataUser().usingAdmin().getAdminUser().getPassword(), CatFolder.getName(), electronicRecord);
|
||||
//
|
||||
// String nonElectronicRecord = "RM-2801 non-electronic record";
|
||||
// Record nonElRecord = createNonElectronicRecord(CatFolder.getId(), nonElectronicRecord);
|
||||
// String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||
// getDataUser().usingAdmin().getAdminUser().getPassword(), CatFolder.getName(), nonElectronicRecord);
|
||||
//
|
||||
// // link the records to copy folder, then complete them
|
||||
// List<String> recordLists = new ArrayList<>();
|
||||
// recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + elRecord.getId());
|
||||
// recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + nonElRecord.getId());
|
||||
//
|
||||
// linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
||||
// getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,copyCategoryRM3077 + "/" +
|
||||
// copyFolderRM3077, recordLists);
|
||||
// recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), elRecordFullName);
|
||||
// recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), nonElRecordFullName);
|
||||
//
|
||||
// // edit disposition date
|
||||
// recordFoldersAPI.postFolderAction(getAdminUser().getUsername(),
|
||||
// getAdminUser().getPassword(),editDispositionDateJson(),CatFolder.getName());
|
||||
//
|
||||
// // cut off the Folder
|
||||
// recordFoldersAPI.postFolderAction(getAdminUser().getUsername(),
|
||||
// getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),CatFolder.getName());
|
||||
//
|
||||
// // Verify the Content
|
||||
// Node electronicNode = getNode(elRecord.getId());
|
||||
// assertTrue("The content of " + electronicRecord + " is available",
|
||||
// StringUtils.isEmpty(electronicNode.getNodeContent().getResponse().getBody().asString()));
|
||||
//
|
||||
// // verify the Properties
|
||||
// AssertJUnit.assertNull("The properties are present even after cutting off the record.", elRecord.getProperties().getTitle());
|
||||
//
|
||||
// // delete precondition
|
||||
// deleteRecordCategory(Category1.getId());
|
||||
// deleteRecordCategory(CopyCategoryId);
|
||||
// }
|
||||
// /**
|
||||
// * Test covering RM-3060
|
||||
// * Check the disposition steps for a record can be executed
|
||||
// * When the record is linked to a folder with the same disposition schedule
|
||||
// * */
|
||||
// @Ignore("ACS-5020")
|
||||
//// @Test
|
||||
// @AlfrescoTest (jira = "RM-3060")
|
||||
// public void sameDispositionScheduleLinkedRecords() throws UnsupportedEncodingException {
|
||||
//
|
||||
// // create a category with retention applied on records level
|
||||
// RecordCategory recordCategory = getRestAPIFactory().getFilePlansAPI(rmAdmin)
|
||||
// .createRootRecordCategory(RecordCategory.builder().name(firstCategoryRM3060).build(),
|
||||
// RecordCategory.DEFAULT_FILE_PLAN_ALIAS);
|
||||
// dispositionScheduleService.createCategoryRetentionSchedule(firstCategoryRM3060, true);
|
||||
// dispositionScheduleService.addCutOffAfterPeriodStep(firstCategoryRM3060, "week|1", DATE_FILED);
|
||||
// dispositionScheduleService.addTransferAfterEventStep(firstCategoryRM3060, TRANSFER_LOCATION, RMEvents.CASE_CLOSED.getEventName());
|
||||
// dispositionScheduleService.addDestroyWithoutGhostingAfterPeriodStep(firstCategoryRM3060, "week|1", CUT_OFF_DATE);
|
||||
//
|
||||
// // make a copy of the category created
|
||||
// String categorySecondId = copyCategory(getAdminUser(), recordCategory.getId(), secondCategoryRM3060);
|
||||
//
|
||||
// // create a folder on the category firstCategoryRM3060 with a complete electronic record
|
||||
// RecordCategoryChild firstFolderRecordCategoryChild = createRecordFolder(recordCategory.getId(),firstFolderRM3060);
|
||||
// Record firstElectronicRecord = createElectronicRecord(firstFolderRecordCategoryChild.getId(),electronicRecordRM3060);
|
||||
//
|
||||
// String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().getAdminUser().getUsername(),
|
||||
// getDataUser().getAdminUser().getPassword(),firstFolderRM3060, electronicRecordRM3060);
|
||||
// String elRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||
// getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM3060 + "/" + firstFolderRM3060);
|
||||
//
|
||||
// recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(),
|
||||
// getDataUser().getAdminUser().getPassword(), elRecordFullName);
|
||||
//
|
||||
// // create a folder on the category secondCategoryRM3060 with a non electronic record
|
||||
// RecordCategoryChild secondFolderRecordCategoryChild = createRecordFolder(categorySecondId,secondFolderRM3060);
|
||||
// Record secondNonElectronicRecord = createNonElectronicRecord(secondFolderRecordCategoryChild.getId(),nonElectronicRecordRM3060);
|
||||
//
|
||||
// // link the nonElectronicRecordRM3060 to firstFolderRM3060
|
||||
// List<String> recordLists = new ArrayList<>();
|
||||
// recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId());
|
||||
//
|
||||
// linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
||||
// getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,secondCategoryRM3060 + "/" +
|
||||
// secondFolderRM3060, recordLists);
|
||||
// String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||
// getDataUser().usingAdmin().getAdminUser().getPassword(), secondFolderRM3060, secondNonElectronicRecord.getName());
|
||||
// String nonElRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||
// getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + secondCategoryRM3060 + "/" + secondFolderRM3060);
|
||||
//
|
||||
// // complete records and cut them off
|
||||
// recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(),
|
||||
// getDataUser().getAdminUser().getPassword(), nonElRecordFullName);
|
||||
//
|
||||
// // edit the disposition date
|
||||
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
// getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef);
|
||||
//
|
||||
// // cut off the record
|
||||
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
// getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),nonElRecordNameNodeRef);
|
||||
//
|
||||
// //check the record is cut off
|
||||
// AssertJUnit.assertTrue("The file " + nonElectronicRecordRM3060 + " has not been successfully cut off.", getRestAPIFactory().getRecordsAPI().getRecord(secondNonElectronicRecord.getId()).getAspectNames().contains(CUT_OFF_ASPECT));
|
||||
//
|
||||
// // link the electronic record to secondFolderRM3060
|
||||
// recordLists.clear();
|
||||
// recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId());
|
||||
// linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
||||
// getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,secondCategoryRM3060 + "/" +
|
||||
// secondFolderRM3060, recordLists);
|
||||
//
|
||||
// // edit the disposition date and cut off the record
|
||||
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
// getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRef);
|
||||
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
// getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),elRecordNameNodeRef);
|
||||
//
|
||||
// AssertJUnit.assertTrue("The file " + electronicRecordRM3060 + " has not been successfully cut off.", getRestAPIFactory().getRecordsAPI().getRecord(firstElectronicRecord.getId()).getAspectNames().contains(CUT_OFF_ASPECT));
|
||||
//
|
||||
// // open the record and complete the disposition schedule event
|
||||
// rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(),
|
||||
// getAdminUser().getPassword(), elRecordFullName, RMEvents.CASE_CLOSED, Instant.now());
|
||||
// rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(),
|
||||
// getAdminUser().getPassword(), nonElRecordFullName, RMEvents.CASE_CLOSED, Instant.now());
|
||||
//
|
||||
// // transfer the files & complete transfers
|
||||
// HttpResponse nonElRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
// getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||
// getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + secondCategoryRM3060 + "/" + secondFolderRM3060));
|
||||
//
|
||||
// String nonElRecordNameTransferId = getTransferId(nonElRecordNameHttpResponse,nonElRecordNameNodeRef);
|
||||
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
// getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),nonElRecordNameTransferId);
|
||||
//
|
||||
// HttpResponse elRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
// getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||
// getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM3060 + "/" + firstFolderRM3060));
|
||||
//
|
||||
// String elRecordNameTransferId = getTransferId(elRecordNameHttpResponse,elRecordNameNodeRef);
|
||||
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
// getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),elRecordNameTransferId);
|
||||
//
|
||||
// AssertJUnit.assertTrue("The file " + electronicRecordRM3060 + " has not been successfully transferred", getRestAPIFactory().getRecordsAPI().getRecord(firstElectronicRecord.getId()).getAspectNames().contains(TRANSFER_TYPE));
|
||||
// AssertJUnit.assertTrue("The file " + nonElectronicRecordRM3060 + " has not been successfully transferred.", getRestAPIFactory().getRecordsAPI().getRecord(secondNonElectronicRecord.getId()).getAspectNames().contains(TRANSFER_TYPE));
|
||||
//
|
||||
// // edit the disposition date for nonElectronicRecordRM3060 & electronicRecordRM3060
|
||||
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
// getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef);
|
||||
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
// getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRef);
|
||||
//
|
||||
// // destroy nonElectronicRecordRM3060 & electronicRecordRM3060 records
|
||||
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
// getAdminUser().getPassword(),new JSONObject().put("name","destroy"),nonElRecordNameNodeRef);
|
||||
// recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
// getAdminUser().getPassword(),new JSONObject().put("name","destroy"),elRecordNameNodeRef);
|
||||
//
|
||||
// // check the file is not displayed
|
||||
// assertNull("The file " + nonElectronicRecordRM3060 + " has not been successfully destroyed.", secondNonElectronicRecord.getContent());
|
||||
// assertNull("The file " + electronicRecordRM3060 + " has not been successfully destroyed.", firstElectronicRecord.getContent());
|
||||
//
|
||||
// // delete precondition
|
||||
// deleteRecordCategory(recordCategory.getId());
|
||||
// deleteRecordCategory(categorySecondId);
|
||||
// }
|
||||
|
||||
//create retention schedule
|
||||
dispositionScheduleService.createCategoryRetentionSchedule(Category1.getName(), false);
|
||||
|
||||
// add cut off step
|
||||
dispositionScheduleService.addCutOffAfterPeriodStep(Category1.getName(), "day|2", CREATED_DATE);
|
||||
|
||||
//create a copy of the category recordsCategory
|
||||
String CopyCategoryId = copyCategory(getAdminUser(),Category1.getId(), copyCategoryRM3077);
|
||||
|
||||
// create folders in both categories
|
||||
CatFolder = createRecordFolder(Category1.getId(), folderRM3077);
|
||||
CopyCatFolder = createRecordFolder(CopyCategoryId, copyFolderRM3077);
|
||||
|
||||
// create record files
|
||||
String electronicRecord = "RM-2801 electronic record";
|
||||
Record elRecord = createElectronicRecord(CatFolder.getId(), electronicRecord);
|
||||
String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||
getDataUser().usingAdmin().getAdminUser().getPassword(), CatFolder.getName(), electronicRecord);
|
||||
|
||||
String nonElectronicRecord = "RM-2801 non-electronic record";
|
||||
Record nonElRecord = createNonElectronicRecord(CatFolder.getId(), nonElectronicRecord);
|
||||
String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||
getDataUser().usingAdmin().getAdminUser().getPassword(), CatFolder.getName(), nonElectronicRecord);
|
||||
|
||||
// link the records to copy folder, then complete them
|
||||
List<String> recordLists = new ArrayList<>();
|
||||
recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + elRecord.getId());
|
||||
recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + nonElRecord.getId());
|
||||
|
||||
linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
||||
getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,copyCategoryRM3077 + "/" +
|
||||
copyFolderRM3077, recordLists);
|
||||
recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), elRecordFullName);
|
||||
recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), nonElRecordFullName);
|
||||
|
||||
// edit disposition date
|
||||
recordFoldersAPI.postFolderAction(getAdminUser().getUsername(),
|
||||
getAdminUser().getPassword(),editDispositionDateJson(),CatFolder.getName());
|
||||
|
||||
// cut off the Folder
|
||||
recordFoldersAPI.postFolderAction(getAdminUser().getUsername(),
|
||||
getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),CatFolder.getName());
|
||||
|
||||
// Verify the Content
|
||||
Node electronicNode = getNode(elRecord.getId());
|
||||
assertTrue("The content of " + electronicRecord + " is available",
|
||||
StringUtils.isEmpty(electronicNode.getNodeContent().getResponse().getBody().asString()));
|
||||
|
||||
// verify the Properties
|
||||
AssertJUnit.assertNull("The properties are present even after cutting off the record.", elRecord.getProperties().getTitle());
|
||||
|
||||
// delete precondition
|
||||
deleteRecordCategory(Category1.getId());
|
||||
deleteRecordCategory(CopyCategoryId);
|
||||
}
|
||||
/**
|
||||
* Test covering RM-3060
|
||||
* Check the disposition steps for a record can be executed
|
||||
* When the record is linked to a folder with the same disposition schedule
|
||||
* */
|
||||
@Test
|
||||
@AlfrescoTest (jira = "RM-3060")
|
||||
public void sameDispositionScheduleLinkedRecords() throws UnsupportedEncodingException {
|
||||
|
||||
// create a category with retention applied on records level
|
||||
RecordCategory recordCategory = getRestAPIFactory().getFilePlansAPI(rmAdmin)
|
||||
.createRootRecordCategory(RecordCategory.builder().name(firstCategoryRM3060).build(),
|
||||
RecordCategory.DEFAULT_FILE_PLAN_ALIAS);
|
||||
dispositionScheduleService.createCategoryRetentionSchedule(firstCategoryRM3060, true);
|
||||
dispositionScheduleService.addCutOffAfterPeriodStep(firstCategoryRM3060, "week|1", DATE_FILED);
|
||||
dispositionScheduleService.addTransferAfterEventStep(firstCategoryRM3060, TRANSFER_LOCATION, RMEvents.CASE_CLOSED.getEventName());
|
||||
dispositionScheduleService.addDestroyWithoutGhostingAfterPeriodStep(firstCategoryRM3060, "week|1", CUT_OFF_DATE);
|
||||
|
||||
// make a copy of the category created
|
||||
String categorySecondId = copyCategory(getAdminUser(), recordCategory.getId(), secondCategoryRM3060);
|
||||
|
||||
// create a folder on the category firstCategoryRM3060 with a complete electronic record
|
||||
RecordCategoryChild firstFolderRecordCategoryChild = createRecordFolder(recordCategory.getId(),firstFolderRM3060);
|
||||
Record firstElectronicRecord = createElectronicRecord(firstFolderRecordCategoryChild.getId(),electronicRecordRM3060);
|
||||
|
||||
String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().getAdminUser().getUsername(),
|
||||
getDataUser().getAdminUser().getPassword(),firstFolderRM3060, electronicRecordRM3060);
|
||||
String elRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||
getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM3060 + "/" + firstFolderRM3060);
|
||||
|
||||
recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(),
|
||||
getDataUser().getAdminUser().getPassword(), elRecordFullName);
|
||||
|
||||
// create a folder on the category secondCategoryRM3060 with a non electronic record
|
||||
RecordCategoryChild secondFolderRecordCategoryChild = createRecordFolder(categorySecondId,secondFolderRM3060);
|
||||
Record secondNonElectronicRecord = createNonElectronicRecord(secondFolderRecordCategoryChild.getId(),nonElectronicRecordRM3060);
|
||||
|
||||
// link the nonElectronicRecordRM3060 to firstFolderRM3060
|
||||
List<String> recordLists = new ArrayList<>();
|
||||
recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId());
|
||||
|
||||
linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
||||
getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,secondCategoryRM3060 + "/" +
|
||||
secondFolderRM3060, recordLists);
|
||||
String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||
getDataUser().usingAdmin().getAdminUser().getPassword(), secondFolderRM3060, secondNonElectronicRecord.getName());
|
||||
String nonElRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||
getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + secondCategoryRM3060 + "/" + secondFolderRM3060);
|
||||
|
||||
// complete records and cut them off
|
||||
recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(),
|
||||
getDataUser().getAdminUser().getPassword(), nonElRecordFullName);
|
||||
|
||||
// edit the disposition date
|
||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef);
|
||||
|
||||
// cut off the record
|
||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),nonElRecordNameNodeRef);
|
||||
|
||||
//check the record is cut off
|
||||
AssertJUnit.assertTrue("The file " + nonElectronicRecordRM3060 + " has not been successfully cut off.", getRestAPIFactory().getRecordsAPI().getRecord(secondNonElectronicRecord.getId()).getAspectNames().contains(CUT_OFF_ASPECT));
|
||||
|
||||
// link the electronic record to secondFolderRM3060
|
||||
recordLists.clear();
|
||||
recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId());
|
||||
linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(),
|
||||
getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,secondCategoryRM3060 + "/" +
|
||||
secondFolderRM3060, recordLists);
|
||||
|
||||
// edit the disposition date and cut off the record
|
||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRef);
|
||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),elRecordNameNodeRef);
|
||||
|
||||
AssertJUnit.assertTrue("The file " + electronicRecordRM3060 + " has not been successfully cut off.", getRestAPIFactory().getRecordsAPI().getRecord(firstElectronicRecord.getId()).getAspectNames().contains(CUT_OFF_ASPECT));
|
||||
|
||||
// open the record and complete the disposition schedule event
|
||||
rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(),
|
||||
getAdminUser().getPassword(), elRecordFullName, RMEvents.CASE_CLOSED, Instant.now());
|
||||
rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(),
|
||||
getAdminUser().getPassword(), nonElRecordFullName, RMEvents.CASE_CLOSED, Instant.now());
|
||||
|
||||
// transfer the files & complete transfers
|
||||
HttpResponse nonElRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||
getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + secondCategoryRM3060 + "/" + secondFolderRM3060));
|
||||
|
||||
String nonElRecordNameTransferId = getTransferId(nonElRecordNameHttpResponse,nonElRecordNameNodeRef);
|
||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),nonElRecordNameTransferId);
|
||||
|
||||
HttpResponse elRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(),
|
||||
getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM3060 + "/" + firstFolderRM3060));
|
||||
|
||||
String elRecordNameTransferId = getTransferId(elRecordNameHttpResponse,elRecordNameNodeRef);
|
||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),elRecordNameTransferId);
|
||||
|
||||
AssertJUnit.assertTrue("The file " + electronicRecordRM3060 + " has not been successfully transferred", getRestAPIFactory().getRecordsAPI().getRecord(firstElectronicRecord.getId()).getAspectNames().contains(TRANSFER_TYPE));
|
||||
AssertJUnit.assertTrue("The file " + nonElectronicRecordRM3060 + " has not been successfully transferred.", getRestAPIFactory().getRecordsAPI().getRecord(secondNonElectronicRecord.getId()).getAspectNames().contains(TRANSFER_TYPE));
|
||||
|
||||
// edit the disposition date for nonElectronicRecordRM3060 & electronicRecordRM3060
|
||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef);
|
||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRef);
|
||||
|
||||
// destroy nonElectronicRecordRM3060 & electronicRecordRM3060 records
|
||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
getAdminUser().getPassword(),new JSONObject().put("name","destroy"),nonElRecordNameNodeRef);
|
||||
recordFoldersAPI.postRecordAction(getAdminUser().getUsername(),
|
||||
getAdminUser().getPassword(),new JSONObject().put("name","destroy"),elRecordNameNodeRef);
|
||||
|
||||
// check the file is not displayed
|
||||
assertNull("The file " + nonElectronicRecordRM3060 + " has not been successfully destroyed.", secondNonElectronicRecord.getContent());
|
||||
assertNull("The file " + electronicRecordRM3060 + " has not been successfully destroyed.", firstElectronicRecord.getContent());
|
||||
|
||||
// delete precondition
|
||||
deleteRecordCategory(recordCategory.getId());
|
||||
deleteRecordCategory(categorySecondId);
|
||||
}
|
||||
private String copyCategory(UserModel user, String categoryId, String copyName) {
|
||||
RepoTestModel repoTestModel = new RepoTestModel() {};
|
||||
repoTestModel.setNodeRef(categoryId);
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>20.94</version>
|
||||
<version>23.1.0.155-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -1,3 +1,3 @@
|
||||
SOLR6_TAG=2.0.7-A2
|
||||
SOLR6_TAG=2.0.7-A5
|
||||
POSTGRES_TAG=14.4
|
||||
ACTIVEMQ_TAG=5.17.1-jre11-rockylinux8
|
||||
ACTIVEMQ_TAG=5.17.4-jre17-rockylinux8
|
||||
|
@@ -1,3 +1,4 @@
|
||||
ARG BASE_IMAGE
|
||||
# BUILD STAGE AGS
|
||||
FROM debian:11-slim AS AGSBUILDER
|
||||
|
||||
@@ -12,7 +13,7 @@ RUN unzip -q /build/gs-api-explorer-*.war -d /build/gs-api-explorer && \
|
||||
chmod -R g-w,o= /build
|
||||
|
||||
# ACTUAL IMAGE
|
||||
FROM alfresco/alfresco-community-repo-base:${image.tag}
|
||||
FROM ${BASE_IMAGE}
|
||||
|
||||
# Alfresco user does not have permissions to modify webapps or configuration. Switch to root.
|
||||
# The access will be fixed after all operations are done.
|
||||
@@ -24,7 +25,7 @@ COPY target/alfresco-share-services-*.amp /usr/local/tomcat/amps/
|
||||
# Install amps on alfresco.war
|
||||
RUN java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install \
|
||||
/usr/local/tomcat/amps \
|
||||
/usr/local/tomcat/webapps/alfresco -directory -nobackup
|
||||
/usr/local/tomcat/webapps/alfresco -directory -nobackup -force
|
||||
|
||||
### Copy gs-api-explorer
|
||||
COPY --chown=root:Alfresco --from=AGSBUILDER /build/gs-api-explorer /usr/local/tomcat/webapps/gs-api-explorer
|
||||
|
@@ -8,13 +8,15 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>20.94</version>
|
||||
<version>23.1.0.155-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<app.amp.client.war.folder>${project.build.directory}/${project.build.finalName}-war</app.amp.client.war.folder>
|
||||
|
||||
<image.name>alfresco/alfresco-governance-repository-community-base</image.name>
|
||||
<base.image>alfresco/alfresco-community-repo-base</base.image>
|
||||
<scripts.directory>${project.parent.parent.parent.parent.basedir}/scripts</scripts.directory>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -58,9 +60,12 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.mail</groupId>
|
||||
<artifactId>jakarta.mail-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.surf</groupId>
|
||||
@@ -434,7 +439,7 @@
|
||||
</run>
|
||||
</image>
|
||||
<image>
|
||||
<name>alfresco/alfresco-activemq:${dependency.activemq.version}-jre11-rockylinux8</name>
|
||||
<name>alfresco/alfresco-activemq:5.17.4-jre17-rockylinux8</name>
|
||||
<run>
|
||||
<ports>
|
||||
<port>${activemq.port1}:${activemq.port1}</port>
|
||||
@@ -505,7 +510,7 @@
|
||||
</run>
|
||||
</image>
|
||||
<image>
|
||||
<name>alfresco/alfresco-activemq:${dependency.activemq.version}-jre11-rockylinux8</name>
|
||||
<name>alfresco/alfresco-activemq:5.17.4-jre17-rockylinux8</name>
|
||||
<run>
|
||||
<ports>
|
||||
<port>${activemq.port1}:${activemq.port1}</port>
|
||||
@@ -537,9 +542,43 @@
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>build-docker-images</id>
|
||||
<!-- builds "image:latest" locally -->
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<images>
|
||||
<image>
|
||||
<name>${image.name}:${image.tag}</name>
|
||||
<build>
|
||||
<args>
|
||||
<BASE_IMAGE>${base.image}:${image.tag}</BASE_IMAGE>
|
||||
</args>
|
||||
<contextDir>${project.basedir}</contextDir>
|
||||
</build>
|
||||
</image>
|
||||
</images>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>build-image</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>build</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>build-docker-images</id>
|
||||
<!-- builds "image:latest" locally -->
|
||||
<id>build-multiarch-docker-images</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
@@ -548,20 +587,56 @@
|
||||
<configuration>
|
||||
<images>
|
||||
<image>
|
||||
<name>${image.name}:${image.tag}</name>
|
||||
<name>${local.registry}/${image.name}:${image.tag}</name>
|
||||
<build>
|
||||
<buildx>
|
||||
<platforms>
|
||||
<platform>linux/amd64</platform>
|
||||
<platform>linux/arm64</platform>
|
||||
</platforms>
|
||||
<builderName>${builder.name}</builderName>
|
||||
</buildx>
|
||||
<contextDir>${project.basedir}</contextDir>
|
||||
<args>
|
||||
<BASE_IMAGE>${local.registry}/${base.image}:${image.tag}</BASE_IMAGE>
|
||||
</args>
|
||||
</build>
|
||||
</image>
|
||||
</images>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>build-image</id>
|
||||
<id>build-push-image</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>build</goal>
|
||||
<goal>push</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>prepare-buildx</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>${scripts.directory}/prepare_buildx.sh</executable>
|
||||
<arguments>
|
||||
<argument>${builder.name}</argument>
|
||||
<argument>${image.registry}</argument>
|
||||
<argument>${image.name}</argument>
|
||||
<argument>${image.tag}</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
@@ -578,12 +653,37 @@
|
||||
<images>
|
||||
<image>
|
||||
<!-- Quay image -->
|
||||
<name>${image.name}:${image.tag}</name>
|
||||
<registry>${image.registry}</registry>
|
||||
<name>${image.registry}/${image.name}:${image.tag}</name>
|
||||
<build>
|
||||
<buildx>
|
||||
<platforms>
|
||||
<platform>linux/amd64</platform>
|
||||
<platform>linux/arm64</platform>
|
||||
</platforms>
|
||||
<builderName>${builder.name}</builderName>
|
||||
</buildx>
|
||||
<args>
|
||||
<BASE_IMAGE>${local.registry}/${base.image}:${image.tag}</BASE_IMAGE>
|
||||
</args>
|
||||
<contextDir>${project.basedir}</contextDir>
|
||||
</build>
|
||||
</image>
|
||||
<image>
|
||||
<!-- DockerHub image -->
|
||||
<name>${image.name}:${image.tag}</name>
|
||||
<build>
|
||||
<buildx>
|
||||
<platforms>
|
||||
<platform>linux/amd64</platform>
|
||||
<platform>linux/arm64</platform>
|
||||
</platforms>
|
||||
<builderName>${builder.name}</builderName>
|
||||
</buildx>
|
||||
<args>
|
||||
<BASE_IMAGE>${local.registry}/${base.image}:${image.tag}</BASE_IMAGE>
|
||||
</args>
|
||||
<contextDir>${project.basedir}</contextDir>
|
||||
</build>
|
||||
</image>
|
||||
</images>
|
||||
</configuration>
|
||||
@@ -598,6 +698,28 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>prepare-buildx</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>${scripts.directory}/prepare_buildx.sh</executable>
|
||||
<arguments>
|
||||
<argument>${builder.name}</argument>
|
||||
<argument>${image.registry}</argument>
|
||||
<argument>${image.name}</argument>
|
||||
<argument>${image.tag}</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
@@ -39,12 +39,12 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.mail.MessagingException;
|
||||
import javax.mail.Multipart;
|
||||
import javax.mail.Part;
|
||||
import javax.mail.internet.ContentType;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import javax.mail.internet.MimeUtility;
|
||||
import jakarta.mail.MessagingException;
|
||||
import jakarta.mail.Multipart;
|
||||
import jakarta.mail.Part;
|
||||
import jakarta.mail.internet.ContentType;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
import jakarta.mail.internet.MimeUtility;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
|
@@ -29,7 +29,7 @@ package org.alfresco.module.org_alfresco_module_rm.script;
|
||||
|
||||
import static org.alfresco.util.WebScriptUtils.getTemplateVars;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;
|
||||
|
@@ -27,7 +27,7 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.script;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
@@ -30,7 +30,7 @@ package org.alfresco.module.org_alfresco_module_rm.script;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService;
|
||||
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
||||
|
@@ -34,7 +34,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionActionDefinition;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule;
|
||||
|
@@ -34,7 +34,7 @@ import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
||||
|
@@ -33,7 +33,7 @@ import static org.alfresco.util.WebScriptUtils.getTemplateVars;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.relationship.RelationshipService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
@@ -27,7 +27,7 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.script;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
|
@@ -32,7 +32,7 @@ import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
||||
|
@@ -32,7 +32,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.Capability;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService;
|
||||
|
@@ -44,7 +44,7 @@
|
||||
*/
|
||||
package org.alfresco.repo.web.scripts.roles;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
|
@@ -54,7 +54,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;
|
||||
|
@@ -3,8 +3,8 @@
|
||||
#
|
||||
|
||||
# Version label
|
||||
version.major=7
|
||||
version.minor=4
|
||||
version.major=23
|
||||
version.minor=1
|
||||
version.revision=0
|
||||
version.label=
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>20.94</version>
|
||||
<version>23.1.0.155-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
@@ -36,24 +36,40 @@
|
||||
<id>start-api-explorer</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.tomcat.maven</groupId>
|
||||
<artifactId>tomcat7-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>run-war</id>
|
||||
<goals>
|
||||
<goal>run-war</goal>
|
||||
</goals>
|
||||
<phase>verify</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<useSeparateTomcatClassLoader>true</useSeparateTomcatClassLoader>
|
||||
<path>/api-explorer</path>
|
||||
<port>8085</port>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.cargo</groupId>
|
||||
<artifactId>cargo-maven3-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>run-war</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<container>
|
||||
<containerId>tomcat9x</containerId>
|
||||
<type>embedded</type>
|
||||
<log>target/cargo.log</log>
|
||||
</container>
|
||||
<configuration>
|
||||
<properties>
|
||||
<cargo.servlet.port>8085</cargo.servlet.port>
|
||||
</properties>
|
||||
</configuration>
|
||||
<deployables>
|
||||
<deployable>
|
||||
<type>war</type>
|
||||
<properties>
|
||||
<context>/api-explorer</context>
|
||||
</properties>
|
||||
<pingURL>http://localhost:8085/api-explorer</pingURL>
|
||||
</deployable>
|
||||
</deployables>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
@@ -38,9 +38,7 @@ tags:
|
||||
description: Retrieve and manage unfiled records containers
|
||||
- name: unfiled-record-folders
|
||||
description: Retrieve and manage unfiled record folders
|
||||
- name: events
|
||||
description: Retrieve and manage retention events
|
||||
|
||||
|
||||
paths:
|
||||
## GS sites
|
||||
'/gs-sites':
|
||||
@@ -2094,172 +2092,8 @@ paths:
|
||||
description: Unexpected error
|
||||
schema:
|
||||
$ref: '#/definitions/Error'
|
||||
'/events':
|
||||
get:
|
||||
tags:
|
||||
- events
|
||||
summary: List all available retention events
|
||||
description: |
|
||||
Gets the list of events that can be used by retention steps
|
||||
operationId: getAllEvents
|
||||
produces:
|
||||
- application/json
|
||||
parameters:
|
||||
- $ref: '#/parameters/skipCountParam'
|
||||
- $ref: '#/parameters/maxItemsParam'
|
||||
responses:
|
||||
'200':
|
||||
description: Successful response
|
||||
schema:
|
||||
$ref: '#/definitions/EventPaging'
|
||||
'400':
|
||||
description: |
|
||||
Invalid parameter: value of **maxItems** or **skipCount** is invalid
|
||||
'401':
|
||||
description: Authentication failed
|
||||
default:
|
||||
description: Unexpected error
|
||||
schema:
|
||||
$ref: '#/definitions/Error'
|
||||
|
||||
post:
|
||||
tags:
|
||||
- events
|
||||
summary: Create a new retention event
|
||||
description: |
|
||||
Creates a new event that can be used by retention schedules.
|
||||
operationId: createEvent
|
||||
parameters:
|
||||
- in: body
|
||||
name: eventBodyCreate
|
||||
description: The new event.
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/EventBody'
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
'201':
|
||||
description: Successful response
|
||||
schema:
|
||||
$ref: '#/definitions/EventEntry'
|
||||
'400':
|
||||
description: |
|
||||
Invalid parameter: **name** or **type** is invalid
|
||||
'401':
|
||||
description: Authentication failed
|
||||
'403':
|
||||
description: Current user does not have permission to create event
|
||||
'409':
|
||||
description: Cannot create event. An event with the name **name** already exists
|
||||
default:
|
||||
description: Unexpected error
|
||||
schema:
|
||||
$ref: '#/definitions/Error'
|
||||
|
||||
'/events/{eventId}':
|
||||
get:
|
||||
tags:
|
||||
- events
|
||||
summary: Return event for given eventId
|
||||
description: |
|
||||
Gets information about the retention event with id **eventId**.
|
||||
operationId: getEvent
|
||||
produces:
|
||||
- application/json
|
||||
parameters:
|
||||
- $ref: '#/parameters/eventIdParam'
|
||||
responses:
|
||||
'200':
|
||||
description: Successful response
|
||||
schema:
|
||||
$ref: '#/definitions/EventEntry'
|
||||
'400':
|
||||
description: |
|
||||
Invalid parameter: **eventId** is invalid
|
||||
'401':
|
||||
description: Authentication failed
|
||||
'404':
|
||||
description: "**eventId** does not exist"
|
||||
default:
|
||||
description: Unexpected error
|
||||
schema:
|
||||
$ref: '#/definitions/Error'
|
||||
put:
|
||||
tags:
|
||||
- events
|
||||
summary: Update event for given eventId
|
||||
operationId: updateEvent
|
||||
description: |
|
||||
Updates retention event with id **eventId**.
|
||||
produces:
|
||||
- application/json
|
||||
parameters:
|
||||
- $ref: '#/parameters/eventIdParam'
|
||||
- in: body
|
||||
name: eventBodyUpdate
|
||||
description: The event information to update.
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/EventBody'
|
||||
responses:
|
||||
'200':
|
||||
description: Successful response
|
||||
schema:
|
||||
$ref: '#/definitions/EventEntry'
|
||||
'400':
|
||||
description: |
|
||||
Invalid parameter: The update request is invalid or **eventId** is not a valid format or **eventBodyUpdate** is invalid
|
||||
'401':
|
||||
description: Authentication failed
|
||||
'403':
|
||||
description: Current user does not have permission to update events
|
||||
'404':
|
||||
description: "**eventId** does not exist"
|
||||
'409':
|
||||
description: Cannot update event. An event with the name **name** already exists
|
||||
default:
|
||||
description: Unexpected error
|
||||
schema:
|
||||
$ref: '#/definitions/Error'
|
||||
|
||||
'/event-types':
|
||||
get:
|
||||
tags:
|
||||
- events
|
||||
summary: List all the retention event types
|
||||
description: |
|
||||
Gets a list of all the retention event types.
|
||||
operationId: getAllEventTypes
|
||||
produces:
|
||||
- application/json
|
||||
parameters:
|
||||
- $ref: '#/parameters/skipCountParam'
|
||||
- $ref: '#/parameters/maxItemsParam'
|
||||
responses:
|
||||
'200':
|
||||
description: Successful response
|
||||
schema:
|
||||
$ref: '#/definitions/EventTypePaging'
|
||||
'400':
|
||||
description: |
|
||||
Invalid parameter: value of **maxItems** or **skipCount** is invalid
|
||||
'401':
|
||||
description: Authentication failed
|
||||
default:
|
||||
description: Unexpected error
|
||||
schema:
|
||||
$ref: '#/definitions/Error'
|
||||
parameters:
|
||||
## event
|
||||
eventIdParam:
|
||||
name: eventId
|
||||
in: path
|
||||
description: The identifier of an event.
|
||||
required: true
|
||||
type: string
|
||||
## File plans
|
||||
filePlanEntryIncludeParam:
|
||||
name: include
|
||||
@@ -3927,92 +3761,4 @@ definitions:
|
||||
- SiteConsumer
|
||||
- SiteCollaborator
|
||||
- SiteContributor
|
||||
- SiteManager
|
||||
EventPaging:
|
||||
type: object
|
||||
properties:
|
||||
list:
|
||||
type: object
|
||||
properties:
|
||||
pagination:
|
||||
$ref: '#/definitions/Pagination'
|
||||
entries:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/EventEntry'
|
||||
EventEntry:
|
||||
type: object
|
||||
required:
|
||||
- entry
|
||||
properties:
|
||||
entry:
|
||||
$ref: '#/definitions/Event'
|
||||
Event:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- name
|
||||
- type
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: this is the id of the event
|
||||
name:
|
||||
type: string
|
||||
description: This is the unique display label of the event
|
||||
type:
|
||||
type: string
|
||||
description: this is event type
|
||||
EventBody:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: This is the unique display label of the event
|
||||
type:
|
||||
type: string
|
||||
description: this is event type
|
||||
default: Simple
|
||||
EventTypePaging:
|
||||
type: object
|
||||
properties:
|
||||
list:
|
||||
type: object
|
||||
properties:
|
||||
pagination:
|
||||
$ref: '#/definitions/Pagination'
|
||||
entries:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/EventTypeEntry'
|
||||
EventTypeEntry:
|
||||
type: object
|
||||
required:
|
||||
- entry
|
||||
properties:
|
||||
entry:
|
||||
$ref: '#/definitions/EventType'
|
||||
EventType:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- name
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: this is the event type id
|
||||
name:
|
||||
type: string
|
||||
description: this is event type name
|
||||
isAutomatic:
|
||||
type: boolean
|
||||
description: Whether events of this type need completing manually or can be completed automatically
|
||||
default: true
|
||||
associationName:
|
||||
type: string
|
||||
description: The association used to determine whether automatic events of this type are complete
|
||||
actionOnAssociatedNode:
|
||||
type: string
|
||||
description: If an association name is set for this event type then it is possible to require an action to be completed on the associated node
|
||||
- SiteManager
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>20.94</version>
|
||||
<version>23.1.0.155-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>20.94</version>
|
||||
<version>23.1.0.155-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
@@ -121,12 +121,6 @@
|
||||
<version>${dependency.webscripts.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
@@ -134,9 +128,8 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SHA-2432 -->
|
||||
|
@@ -27,7 +27,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.repo.web.scripts.admin.NodeBrowserPost;
|
||||
|
@@ -23,6 +23,10 @@ function runAction(p_params)
|
||||
if (p_params.destNode.hasAspect("cm:lockable") && !p_params.destNode.hasAspect("trx:transferred"))
|
||||
{
|
||||
p_params.destNode.unlock();
|
||||
if(p_params.destNode.hasAspect("gd2:editingInGoogle"))
|
||||
{
|
||||
p_params.destNode.removeAspect("gd2:editingInGoogle");
|
||||
}
|
||||
}
|
||||
|
||||
var resultId = originalDoc.name,
|
||||
|
11
core/pom.xml
11
core/pom.xml
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>20.94</version>
|
||||
<version>23.1.0.155-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
@@ -111,9 +111,8 @@
|
||||
|
||||
<!-- provided dependencies -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Test only dependencies, as popped up while running mvn test -->
|
||||
@@ -137,6 +136,10 @@
|
||||
<artifactId>commons-dbcp2</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@@ -26,8 +26,8 @@ import java.net.UnknownHostException;
|
||||
import java.security.AlgorithmParameters;
|
||||
import java.util.Arrays;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.alfresco.encryption.MACUtils.MACInput;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
|
@@ -21,8 +21,8 @@ package org.alfresco.encryption;
|
||||
import java.io.IOException;
|
||||
import java.security.AlgorithmParameters;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.httpclient.HttpMethod;
|
||||
|
||||
|
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
package org.alfresco.httpclient;
|
||||
|
||||
import javax.net.ssl.KeyManager;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.apache.http.HttpHost;
|
||||
import org.apache.http.HttpRequestInterceptor;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.config.RegistryBuilder;
|
||||
import org.apache.http.conn.HttpClientConnectionManager;
|
||||
import org.apache.http.conn.socket.ConnectionSocketFactory;
|
||||
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
|
||||
import org.apache.http.conn.ssl.NoopHostnameVerifier;
|
||||
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.impl.client.StandardHttpRequestRetryHandler;
|
||||
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
||||
|
||||
|
||||
public class HttpClient4Factory
|
||||
{
|
||||
protected static final String TLS_PROTOCOL = "TLS";
|
||||
protected static final String HTTPS_PROTOCOL = "https";
|
||||
protected static final String HTTP_TARGET_HOST = "http.target_host";
|
||||
protected static final String TLS_V_1_2 = "TLSv1.2";
|
||||
protected static final String TLS_V_1_3 = "TLSv1.3";
|
||||
|
||||
private static SSLContext createSSLContext(HttpClientConfig config)
|
||||
{
|
||||
KeyManager[] keyManagers = config.getKeyStore().createKeyManagers();
|
||||
TrustManager[] trustManagers = config.getTrustStore().createTrustManagers();
|
||||
|
||||
try
|
||||
{
|
||||
SSLContext sslcontext = SSLContext.getInstance(TLS_PROTOCOL);
|
||||
sslcontext.init(keyManagers, trustManagers, null);
|
||||
return sslcontext;
|
||||
}
|
||||
catch(Throwable e)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to create SSL context", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static CloseableHttpClient createHttpClient(HttpClientConfig config)
|
||||
{
|
||||
return createHttpClient(config, null);
|
||||
}
|
||||
|
||||
public static CloseableHttpClient createHttpClient(HttpClientConfig config, HttpClientConnectionManager connectionManager)
|
||||
{
|
||||
HttpClientBuilder clientBuilder = HttpClients.custom();
|
||||
|
||||
if(config.isMTLSEnabled())
|
||||
{
|
||||
clientBuilder.addInterceptorFirst((HttpRequestInterceptor) (request, context) -> {
|
||||
if (!((HttpHost) context.getAttribute(HTTP_TARGET_HOST)).getSchemeName().equals(HTTPS_PROTOCOL))
|
||||
{
|
||||
String msg = "mTLS is enabled but provided URL does not use a secured protocol";
|
||||
throw new HttpClientException(msg);
|
||||
}
|
||||
});
|
||||
clientBuilder.setSSLSocketFactory(getSslConnectionSocketFactory(config));
|
||||
}
|
||||
|
||||
if (connectionManager != null)
|
||||
{
|
||||
clientBuilder.setConnectionManager(connectionManager);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Setting a connectionManager overrides these properties
|
||||
clientBuilder.setMaxConnTotal(config.getMaxTotalConnections());
|
||||
clientBuilder.setMaxConnPerRoute(config.getMaxHostConnections());
|
||||
}
|
||||
|
||||
RequestConfig requestConfig = RequestConfig.custom()
|
||||
.setConnectTimeout(config.getConnectionTimeout())
|
||||
.setSocketTimeout(config.getSocketTimeout())
|
||||
.setConnectionRequestTimeout(config.getConnectionRequestTimeout())
|
||||
.build();
|
||||
|
||||
clientBuilder.setDefaultRequestConfig(requestConfig);
|
||||
|
||||
clientBuilder.setRetryHandler(new StandardHttpRequestRetryHandler(5, false));
|
||||
|
||||
return clientBuilder.build();
|
||||
}
|
||||
|
||||
private static SSLConnectionSocketFactory getSslConnectionSocketFactory(HttpClientConfig config)
|
||||
{
|
||||
return new SSLConnectionSocketFactory(
|
||||
createSSLContext(config),
|
||||
new String[] { TLS_V_1_2, TLS_V_1_3 },
|
||||
null,
|
||||
config.isHostnameVerificationDisabled() ? new NoopHostnameVerifier() : SSLConnectionSocketFactory.getDefaultHostnameVerifier());
|
||||
}
|
||||
|
||||
public static PoolingHttpClientConnectionManager createPoolingConnectionManager(HttpClientConfig config)
|
||||
{
|
||||
PoolingHttpClientConnectionManager poolingHttpClientConnectionManager;
|
||||
if(config.isMTLSEnabled())
|
||||
{
|
||||
poolingHttpClientConnectionManager = new PoolingHttpClientConnectionManager(
|
||||
RegistryBuilder.<ConnectionSocketFactory>create()
|
||||
.register("https", getSslConnectionSocketFactory(config))
|
||||
.build());
|
||||
}
|
||||
else
|
||||
{
|
||||
poolingHttpClientConnectionManager = new PoolingHttpClientConnectionManager(
|
||||
RegistryBuilder.<ConnectionSocketFactory>create()
|
||||
.register("http", PlainConnectionSocketFactory.getSocketFactory())
|
||||
.build());
|
||||
}
|
||||
poolingHttpClientConnectionManager.setMaxTotal(config.getMaxTotalConnections());
|
||||
poolingHttpClientConnectionManager.setDefaultMaxPerRoute(config.getMaxHostConnections());
|
||||
|
||||
return poolingHttpClientConnectionManager;
|
||||
}
|
||||
}
|
202
core/src/main/java/org/alfresco/httpclient/HttpClientConfig.java
Normal file
202
core/src/main/java/org/alfresco/httpclient/HttpClientConfig.java
Normal file
@@ -0,0 +1,202 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
package org.alfresco.httpclient;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Properties;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.alfresco.encryption.AlfrescoKeyStore;
|
||||
import org.alfresco.encryption.AlfrescoKeyStoreImpl;
|
||||
import org.alfresco.encryption.KeyResourceLoader;
|
||||
import org.alfresco.encryption.ssl.SSLEncryptionParameters;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
public class HttpClientConfig
|
||||
{
|
||||
private static final String HTTPCLIENT_CONFIG = "httpclient.config.";
|
||||
|
||||
protected static final Log LOGGER = LogFactory.getLog(HttpClientConfig.class);
|
||||
|
||||
private Properties properties;
|
||||
private String serviceName;
|
||||
|
||||
private SSLEncryptionParameters sslEncryptionParameters;
|
||||
private KeyResourceLoader keyResourceLoader;
|
||||
|
||||
private AlfrescoKeyStore keyStore;
|
||||
private AlfrescoKeyStore trustStore;
|
||||
|
||||
private Map<String, String> config;
|
||||
|
||||
public void setProperties(Properties properties)
|
||||
{
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
public void setServiceName(String serviceName)
|
||||
{
|
||||
this.serviceName = serviceName;
|
||||
}
|
||||
|
||||
public void setSslEncryptionParameters(SSLEncryptionParameters sslEncryptionParameters)
|
||||
{
|
||||
this.sslEncryptionParameters = sslEncryptionParameters;
|
||||
}
|
||||
|
||||
public void setKeyResourceLoader(KeyResourceLoader keyResourceLoader)
|
||||
{
|
||||
this.keyResourceLoader = keyResourceLoader;
|
||||
}
|
||||
|
||||
public AlfrescoKeyStore getKeyStore()
|
||||
{
|
||||
return keyStore;
|
||||
}
|
||||
|
||||
public AlfrescoKeyStore getTrustStore()
|
||||
{
|
||||
return trustStore;
|
||||
}
|
||||
|
||||
public void init()
|
||||
{
|
||||
this.keyStore = new AlfrescoKeyStoreImpl(sslEncryptionParameters.getKeyStoreParameters(), keyResourceLoader);
|
||||
this.trustStore = new AlfrescoKeyStoreImpl(sslEncryptionParameters.getTrustStoreParameters(), keyResourceLoader);
|
||||
|
||||
config = retrieveConfig(serviceName);
|
||||
checkUnsupportedProperties(config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method used for retrieving HttpClient config from Global Properties
|
||||
* @param serviceName name of used service
|
||||
* @return map of properties
|
||||
*/
|
||||
private Map<String, String> retrieveConfig(String serviceName)
|
||||
{
|
||||
return properties.keySet().stream()
|
||||
.filter(key -> key instanceof String)
|
||||
.map(Object::toString)
|
||||
.filter(key -> key.startsWith(HTTPCLIENT_CONFIG + serviceName))
|
||||
.collect(Collectors.toMap(
|
||||
key -> key.replace(HTTPCLIENT_CONFIG + serviceName + ".", ""),
|
||||
key -> properties.getProperty(key, null)));
|
||||
}
|
||||
|
||||
private void checkUnsupportedProperties(Map<String, String> config)
|
||||
{
|
||||
config.keySet().stream()
|
||||
.filter(propertyName -> !HttpClientPropertiesEnum.isPropertyNameSupported(propertyName))
|
||||
.forEach(propertyName -> LOGGER.warn(String.format("For service [%s], an unsupported property [%s] is set", serviceName, propertyName)));
|
||||
}
|
||||
|
||||
private Integer getIntegerProperty(HttpClientPropertiesEnum property)
|
||||
{
|
||||
return Integer.parseInt(extractValueFromConfig(property).orElse("0"));
|
||||
}
|
||||
|
||||
private Boolean getBooleanProperty(HttpClientPropertiesEnum property)
|
||||
{
|
||||
return Boolean.parseBoolean(extractValueFromConfig(property).orElse("false"));
|
||||
}
|
||||
|
||||
private Optional<String> extractValueFromConfig(HttpClientPropertiesEnum property)
|
||||
{
|
||||
Optional<String> optionalProperty = Optional.ofNullable(config.get(property.name));
|
||||
if(property.isRequired && optionalProperty.isEmpty())
|
||||
{
|
||||
String msg = String.format("Required property: '%s' is empty.", property.name);
|
||||
throw new HttpClientException(msg);
|
||||
}
|
||||
return optionalProperty;
|
||||
}
|
||||
|
||||
public Integer getConnectionTimeout()
|
||||
{
|
||||
return getIntegerProperty(HttpClientPropertiesEnum.CONNECTION_REQUEST_TIMEOUT);
|
||||
}
|
||||
|
||||
public Integer getSocketTimeout()
|
||||
{
|
||||
return getIntegerProperty(HttpClientPropertiesEnum.SOCKET_TIMEOUT);
|
||||
}
|
||||
|
||||
public Integer getConnectionRequestTimeout()
|
||||
{
|
||||
return getIntegerProperty(HttpClientPropertiesEnum.CONNECTION_REQUEST_TIMEOUT);
|
||||
}
|
||||
|
||||
public Integer getMaxTotalConnections()
|
||||
{
|
||||
return getIntegerProperty(HttpClientPropertiesEnum.MAX_TOTAL_CONNECTIONS);
|
||||
}
|
||||
|
||||
public Integer getMaxHostConnections()
|
||||
{
|
||||
return getIntegerProperty(HttpClientPropertiesEnum.MAX_HOST_CONNECTIONS);
|
||||
}
|
||||
|
||||
public Boolean isMTLSEnabled()
|
||||
{
|
||||
return getBooleanProperty(HttpClientPropertiesEnum.MTLS_ENABLED);
|
||||
}
|
||||
|
||||
public boolean isHostnameVerificationDisabled()
|
||||
{
|
||||
return getBooleanProperty(HttpClientPropertiesEnum.HOSTNAME_VERIFICATION_DISABLED);
|
||||
}
|
||||
|
||||
private enum HttpClientPropertiesEnum
|
||||
{
|
||||
CONNECTION_TIMEOUT("connectionTimeout", true),
|
||||
SOCKET_TIMEOUT("socketTimeout", true),
|
||||
CONNECTION_REQUEST_TIMEOUT("connectionRequestTimeout", true),
|
||||
MAX_TOTAL_CONNECTIONS("maxTotalConnections", true),
|
||||
MAX_HOST_CONNECTIONS("maxHostConnections", true),
|
||||
HOSTNAME_VERIFICATION_DISABLED("hostnameVerificationDisabled", false),
|
||||
MTLS_ENABLED("mTLSEnabled", true);
|
||||
|
||||
private final String name;
|
||||
private final Boolean isRequired;
|
||||
|
||||
HttpClientPropertiesEnum(String propertyName, Boolean isRequired)
|
||||
{
|
||||
this.name = propertyName;
|
||||
this.isRequired = isRequired;
|
||||
}
|
||||
|
||||
private static final List<String> supportedProperties = new ArrayList<>();
|
||||
|
||||
static {
|
||||
for (HttpClientPropertiesEnum property : HttpClientPropertiesEnum.values()) {
|
||||
supportedProperties.add(property.name);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isPropertyNameSupported(String propertyName) {
|
||||
return supportedProperties.contains(propertyName);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
package org.alfresco.httpclient;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
|
||||
public class HttpClientException extends AlfrescoRuntimeException
|
||||
{
|
||||
public HttpClientException(String msgId)
|
||||
{
|
||||
super(msgId);
|
||||
}
|
||||
}
|
@@ -45,6 +45,13 @@ public class ListBackedPagingResults<R> implements PagingResults<R>
|
||||
size = list.size();
|
||||
hasMore = false;
|
||||
}
|
||||
|
||||
public ListBackedPagingResults(List<R> list, boolean hasMore)
|
||||
{
|
||||
this(list);
|
||||
this.hasMore = hasMore;
|
||||
}
|
||||
|
||||
public ListBackedPagingResults(List<R> list, PagingRequest paging)
|
||||
{
|
||||
// Excerpt
|
||||
|
@@ -20,13 +20,13 @@ package org.alfresco.web.scripts.servlet;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.Filter;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.FilterConfig;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.ServletResponse;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* Simple servlet filter to add a 'Cache-Control' HTTP header to a response.
|
||||
@@ -48,7 +48,7 @@ public class StaticAssetCacheFilter implements Filter
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see javax.servlet.Filter#init(javax.servlet.FilterConfig)
|
||||
* @see jakarta.servlet.Filter#init(jakarta.servlet.FilterConfig)
|
||||
*/
|
||||
public void init(FilterConfig config) throws ServletException
|
||||
{
|
||||
@@ -60,7 +60,7 @@ public class StaticAssetCacheFilter implements Filter
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
|
||||
* @see jakarta.servlet.Filter#doFilter(jakarta.servlet.ServletRequest, jakarta.servlet.ServletResponse, jakarta.servlet.FilterChain)
|
||||
*/
|
||||
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException,
|
||||
ServletException
|
||||
@@ -70,7 +70,7 @@ public class StaticAssetCacheFilter implements Filter
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see javax.servlet.Filter#destroy()
|
||||
* @see jakarta.servlet.Filter#destroy()
|
||||
*/
|
||||
public void destroy()
|
||||
{
|
||||
|
@@ -21,9 +21,9 @@ package org.alfresco.web.scripts.servlet;
|
||||
|
||||
import javax.management.*;
|
||||
import javax.security.auth.x500.X500Principal;
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.*;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.Set;
|
||||
@@ -134,7 +134,7 @@ public abstract class X509ServletFilterBase implements Filter
|
||||
logger.debug("Enforcing X509 request");
|
||||
}
|
||||
|
||||
X509Certificate[] certs = (X509Certificate[])httpRequest.getAttribute("javax.servlet.request.X509Certificate");
|
||||
X509Certificate[] certs = (X509Certificate[])httpRequest.getAttribute("jakarta.servlet.request.X509Certificate");
|
||||
if(validCert(certs))
|
||||
{
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>20.94</version>
|
||||
<version>23.1.0.155-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
@@ -90,9 +90,8 @@
|
||||
| see http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Jakarta... -->
|
||||
@@ -100,7 +99,6 @@
|
||||
<groupId>jakarta.activation</groupId>
|
||||
<artifactId>jakarta.activation-api</artifactId>
|
||||
</dependency>
|
||||
<!-- REPO-5047 - Replaces com.sun.activation:javax.activation -->
|
||||
<dependency>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>jakarta.activation</artifactId>
|
||||
@@ -119,7 +117,7 @@
|
||||
<dependency>
|
||||
<groupId>org.jibx</groupId>
|
||||
<artifactId>jibx-run</artifactId>
|
||||
<version>1.3.3</version>
|
||||
<version>1.4.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
@@ -134,7 +132,7 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.woodstox</groupId>
|
||||
<artifactId>woodstox-core</artifactId>
|
||||
<version>6.4.0</version>
|
||||
<version>6.5.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- the cxf libs were updated, see dependencyManagement section -->
|
||||
@@ -142,53 +140,11 @@
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-commons-impl</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.sun.xml.messaging.saaj</groupId>
|
||||
<artifactId>saaj-impl</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from com.fasterxml.woodstox:woodstox-core -->
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.woodstox</groupId>
|
||||
<artifactId>woodstox-core-asl</artifactId>
|
||||
</exclusion>
|
||||
<!-- [ACS-544] Excluded as conflicts with JDK9+ as it includes javax.transaction -->
|
||||
<exclusion>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-jta_1.1_spec</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-server-bindings</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from jakarta.jws:jakarta.jws-api -->
|
||||
<exclusion>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from jakarta.transaction:jakarta.transaction-api -->
|
||||
<exclusion>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-jta_1.1_spec</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from jakarta.annotation:jakarta.annotation-api -->
|
||||
<exclusion>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
</exclusion>
|
||||
<!-- Duplicates classes from com.sun.activation:jakarta.activation -->
|
||||
<exclusion>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>javax.activation</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- This is now deployed at:
|
||||
| http://artifacts.alfresco.com/nexus/content/repositories/thirdparty/org/acegisecurity/acegi-security/0.8.2_patched/
|
||||
|
@@ -27,7 +27,7 @@ package org.alfresco.util;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import jakarta.servlet.ServletContext;
|
||||
|
||||
import org.apache.chemistry.opencmis.commons.server.CmisServiceFactory;
|
||||
import org.apache.chemistry.opencmis.server.impl.CmisRepositoryContextListener;
|
||||
|
1
jakarta-dependencies/.gitignore
vendored
Normal file
1
jakarta-dependencies/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/projects
|
19
jakarta-dependencies/README.MD
Normal file
19
jakarta-dependencies/README.MD
Normal file
@@ -0,0 +1,19 @@
|
||||
## How to build dependencies
|
||||
```shell
|
||||
cd jakarta-dependencies
|
||||
./build-dependencies.sh
|
||||
```
|
||||
|
||||
## How to build the repo
|
||||
```shell
|
||||
#Use jakarta-migration branch
|
||||
mvn clean package -DskipTests -Dmaven.javadoc.skip=true -Pags
|
||||
```
|
||||
|
||||
## With TAS tests compilation
|
||||
```shell
|
||||
mvn clean package -DskipTests -Dmaven.javadoc.skip=true -Pags -Pall-tas-tests
|
||||
```
|
||||
* requires TAS test framework migration (similar approach to the greenmail/webscripts )
|
||||
* Search for `//JAKARTA_TO_DO|` in all repositories
|
||||
* Try running tests
|
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>apache-chemistry</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>chemistry-opencmis-client-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.0.0-jakarta</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>chemistry-opencmis-commons-api</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.transformer</groupId>
|
||||
<artifactId>transformer-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>transform-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifact>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-client-api</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
</artifact>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>apache-chemistry</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>chemistry-opencmis-client-bindings</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.0.0-jakarta</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>chemistry-opencmis-commons-impl</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-frontend-jaxws</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-transports-http</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.transformer</groupId>
|
||||
<artifactId>transformer-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>transform-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifact>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-client-bindings</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
</artifact>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>apache-chemistry</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>chemistry-opencmis-client-impl</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.0.0-jakarta</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>chemistry-opencmis-client-api</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>chemistry-opencmis-commons-impl</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>chemistry-opencmis-client-bindings</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-frontend-jaxws</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-transports-http</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-ws-policy</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.transformer</groupId>
|
||||
<artifactId>transformer-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>transform-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifact>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-client-impl</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
</artifact>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>apache-chemistry</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>chemistry-opencmis-commons-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.0.0-jakarta</version>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.transformer</groupId>
|
||||
<artifactId>transformer-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>transform-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifact>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-commons-api</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
</artifact>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>apache-chemistry</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>chemistry-opencmis-commons-impl</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.0.0-jakarta</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>chemistry-opencmis-commons-api</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.woodstox</groupId>
|
||||
<artifactId>woodstox-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.transformer</groupId>
|
||||
<artifactId>transformer-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>transform-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifact>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-commons-impl</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
</artifact>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>apache-chemistry</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>chemistry-opencmis-server-bindings</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.0.0-jakarta</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>chemistry-opencmis-server-support</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-frontend-jaxws</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-transports-http</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.transformer</groupId>
|
||||
<artifactId>transformer-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>transform-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifact>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-server-bindings</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
</artifact>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>apache-chemistry</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>chemistry-opencmis-server-support</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.0.0-jakarta</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>chemistry-opencmis-commons-impl</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr-runtime</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.transformer</groupId>
|
||||
<artifactId>transformer-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>transform-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifact>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-server-support</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
</artifact>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>apache-chemistry</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>chemistry-opencmis-test-tck</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.0.0-jakarta</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>chemistry-opencmis-client-impl</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.transformer</groupId>
|
||||
<artifactId>transformer-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>transform-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifact>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-test-tck</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
</artifact>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>binary-transformed-to-jakarta</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>apache-chemistry</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>Apache 2</name>
|
||||
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<properties>
|
||||
<dependency.opencmis.version>1.0.0</dependency.opencmis.version>
|
||||
<dependency.cxf.version>4.0.2</dependency.cxf.version>
|
||||
<dependency.woodstox-core.version>6.5.1</dependency.woodstox-core.version>
|
||||
<dependency.antlr.version>3.5.3</dependency.antlr.version>
|
||||
<dependency.commons-lang3.version>3.12.0</dependency.commons-lang3.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-server-bindings</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-server-support</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-test-tck</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-commons-impl</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-commons-api</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-client-api</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-client-impl</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-client-bindings</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-frontend-jaxws</artifactId>
|
||||
<version>${dependency.cxf.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.eclipse.angus</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-transports-http</artifactId>
|
||||
<version>${dependency.cxf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-ws-policy</artifactId>
|
||||
<version>${dependency.cxf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.woodstox</groupId>
|
||||
<artifactId>woodstox-core</artifactId>
|
||||
<version>${dependency.woodstox-core.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr-runtime</artifactId>
|
||||
<version>${dependency.antlr.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>${dependency.commons-lang3.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<modules>
|
||||
<module>chemistry-opencmis-server-bindings</module>
|
||||
<module>chemistry-opencmis-server-support</module>
|
||||
<module>chemistry-opencmis-test-tck</module>
|
||||
<module>chemistry-opencmis-commons-impl</module>
|
||||
<module>chemistry-opencmis-commons-api</module>
|
||||
<module>chemistry-opencmis-client-api</module>
|
||||
<module>chemistry-opencmis-client-impl</module>
|
||||
<module>chemistry-opencmis-client-bindings</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>binary-transformed-to-jakarta</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.5-jakarta</version>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>Apache 2</name>
|
||||
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
<version>1.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.transformer</groupId>
|
||||
<artifactId>transformer-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>transform-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifact>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
<version>1.5</version>
|
||||
</artifact>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@@ -0,0 +1,74 @@
|
||||
# Jakarta SOAP with Attachments string constants from jakarta.xml.soap-api-1.4.2.jar
|
||||
javax.xml.soap=jakarta.xml.soap
|
||||
javax.xml.soap.MetaFactory=jakarta.xml.soap.MetaFactory
|
||||
javax.xml.soap.character-set-encoding=jakarta.xml.soap.character-set-encoding
|
||||
javax.xml.soap.write-xml-declaration=jakarta.xml.soap.write-xml-declaration
|
||||
# Other
|
||||
javax.xml.soap.SOAPMessage=jakarta.xml.soap.SOAPMessage
|
||||
|
||||
# Jakarta XML Binding string constants from jakarta.xml.bind-api-2.3.3.jar
|
||||
javax.xml.bind=jakarta.xml.bind
|
||||
javax.xml.bind.JAXBContext=jakarta.xml.bind.JAXBContext
|
||||
javax.xml.bind.JAXBContextFactory=jakarta.xml.bind.JAXBContextFactory
|
||||
javax.xml.bind.context.factory=jakarta.xml.bind.context.factory
|
||||
javax/xml/bind/JAXBContext.class=jakarta/xml/bind/JAXBContext.class
|
||||
# Other
|
||||
javax.xml.bind.JAXBElement=jakarta.xml.bind.JAXBElement
|
||||
javax.xml.bind.annotation.XmlEnum=jakarta.xml.bind.annotation.XmlEnum
|
||||
com.sun.xml.bind.defaultNamespaceRemap=org.glassfish.jaxb.defaultNamespaceRemap
|
||||
com.sun.xml.internal.bind.defaultNamespaceRemap=org.glassfish.jaxb.defaultNamespaceRemap
|
||||
http\://java.sun.com/xml/ns/jaxb=https://jakarta.ee/xml/ns/jaxb
|
||||
|
||||
# Jakarta XML Web Services string constants from jakarta.xml.ws-api-2.3.3.jar
|
||||
javax.xml.ws=jakarta.xml.ws
|
||||
javax.xml.ws.RespectBindingFeature=jakarta.xml.ws.RespectBindingFeature
|
||||
javax.xml.ws.binding.attachments.inbound=jakarta.xml.ws.binding.attachments.inbound
|
||||
javax.xml.ws.binding.attachments.outbound=jakarta.xml.ws.binding.attachments.outbound
|
||||
javax.xml.ws.handler.message.outbound=jakarta.xml.ws.handler.message.outbound
|
||||
javax.xml.ws.http.request.headers=jakarta.xml.ws.http.request.headers
|
||||
javax.xml.ws.http.request.method=jakarta.xml.ws.http.request.method
|
||||
javax.xml.ws.http.request.pathinfo=jakarta.xml.ws.http.request.pathinfo
|
||||
javax.xml.ws.http.request.querystring=jakarta.xml.ws.http.request.querystring
|
||||
javax.xml.ws.http.response.code=jakarta.xml.ws.http.response.code
|
||||
javax.xml.ws.http.response.headers=jakarta.xml.ws.http.response.headers
|
||||
javax.xml.ws.reference.parameters=jakarta.xml.ws.reference.parameters
|
||||
javax.xml.ws.security.auth.password=jakarta.xml.ws.security.auth.password
|
||||
javax.xml.ws.security.auth.username=jakarta.xml.ws.security.auth.username
|
||||
javax.xml.ws.service.endpoint.address=jakarta.xml.ws.service.endpoint.address
|
||||
javax.xml.ws.servlet.context=jakarta.xml.ws.servlet.context
|
||||
javax.xml.ws.servlet.request=jakarta.xml.ws.servlet.request
|
||||
javax.xml.ws.servlet.response=jakarta.xml.ws.servlet.response
|
||||
javax.xml.ws.session.maintain=jakarta.xml.ws.session.maintain
|
||||
javax.xml.ws.soap.http.soapaction.uri=jakarta.xml.ws.soap.http.soapaction.uri
|
||||
javax.xml.ws.soap.http.soapaction.use=jakarta.xml.ws.soap.http.soapaction.use
|
||||
javax.xml.ws.spi.http.request.cert.X509Certificate=jakarta.xml.ws.spi.http.request.cert.X509Certificate
|
||||
javax.xml.ws.spi.http.request.cipher.suite=jakarta.xml.ws.spi.http.request.cipher.suite
|
||||
javax.xml.ws.spi.http.request.key.size=jakarta.xml.ws.spi.http.request.key.size
|
||||
javax.xml.ws.wsdl.description=jakarta.xml.ws.wsdl.description
|
||||
javax.xml.ws.wsdl.interface=jakarta.xml.ws.wsdl.interface
|
||||
javax.xml.ws.wsdl.operation=jakarta.xml.ws.wsdl.operation
|
||||
javax.xml.ws.wsdl.port=jakarta.xml.ws.wsdl.port
|
||||
javax.xml.ws.wsdl.service=jakarta.xml.ws.wsdl.service
|
||||
# Other
|
||||
javax.xml.ws.addressing.context=jakarta.xml.ws.addressing.context
|
||||
javax.xml.ws.addressing.context.inbound=jakarta.xml.ws.addressing.context.inbound
|
||||
javax.xml.ws.addressing.context.outbound=jakarta.xml.ws.addressing.context.outbound
|
||||
javax.jws.HandlerChain=jakarta.jws.HandlerChain
|
||||
javax.jws.WebService=jakarta.jws.WebService
|
||||
javax.xml.ws.Action=jakarta.xml.ws.Action
|
||||
javax.xml.ws.AsyncHandler=jakarta.xml.ws.AsyncHandler
|
||||
javax.xml.ws.BindingType=jakarta.xml.ws.BindingType
|
||||
javax.xml.ws.FaultAction=jakarta.xml.ws.FaultAction
|
||||
javax.xml.ws.Holder=jakarta.xml.ws.Holder
|
||||
javax.xml.ws.RespectBinding=jakarta.xml.ws.RespectBinding
|
||||
javax.xml.ws.Response=jakarta.xml.ws.Response
|
||||
javax.xml.ws.Service=jakarta.xml.ws.Service
|
||||
javax.xml.ws.ServiceMode=jakarta.xml.ws.ServiceMode
|
||||
javax.xml.ws.soap.Addressing=jakarta.xml.ws.soap.Addressing
|
||||
javax.xml.ws.soap.MTOM=jakarta.xml.ws.soap.MTOM
|
||||
javax.xml.ws.spi.Provider=jakarta.xml.ws.spi.Provider
|
||||
javax.xml.ws.WebServiceProvider=jakarta.xml.ws.WebServiceProvider
|
||||
javax.xml.ws.wsaddressing.W3CEndpointReference=jakarta.xml.ws.wsaddressing.W3CEndpointReference
|
||||
|
||||
com.ibm.xml.xlxp2.jaxb.JAXBContextFactory=org.glassfish.jaxb.runtime.v2.JAXBContextFactory
|
||||
com.sun.xml.bind.v2.ContextFactory=org.glassfish.jaxb.runtime.v2.ContextFactory
|
38
jakarta-dependencies/binary-transformed-to-jakarta/pom.xml
Normal file
38
jakarta-dependencies/binary-transformed-to-jakarta/pom.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>jakarta-dependencies</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>binary-transformed-to-jakarta</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<properties>
|
||||
<rules.path>${maven.multiModuleProjectDirectory}/binary-transformed-to-jakarta</rules.path>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.transformer</groupId>
|
||||
<artifactId>transformer-maven-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<rules>
|
||||
<renames>${rules.path}/rename-rules.properties</renames>
|
||||
<versions>${rules.path}/version-rules.properties</versions>
|
||||
<directs>${rules.path}/direct-rules.properties</directs>
|
||||
</rules>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<modules>
|
||||
<module>apache-chemistry</module>
|
||||
<module>commons-fileupload</module>
|
||||
</modules>
|
||||
</project>
|
@@ -0,0 +1,40 @@
|
||||
javax.activation=jakarta.activation
|
||||
|
||||
javax.annotation.security=jakarta.annotation.security
|
||||
javax.annotation.sql=jakarta.annotation.sql
|
||||
javax.annotation=jakarta.annotation
|
||||
|
||||
javax.mail.event=jakarta.mail.event
|
||||
javax.mail.internet=jakarta.mail.internet
|
||||
javax.mail.search=jakarta.mail.search
|
||||
javax.mail.util=jakarta.mail.util
|
||||
javax.mail=jakarta.mail
|
||||
|
||||
javax.servlet.annotation=jakarta.servlet.annotation
|
||||
javax.servlet.descriptor=jakarta.servlet.descriptor
|
||||
javax.servlet.http=jakarta.servlet.http
|
||||
javax.servlet.resources=jakarta.servlet.resources
|
||||
javax.servlet=jakarta.servlet
|
||||
|
||||
javax.jms=jakarta.jms
|
||||
|
||||
javax.jws.soap=jakarta.jws.soap
|
||||
javax.jws=jakarta.jws
|
||||
|
||||
javax.xml.bind.annotation.adapters=jakarta.xml.bind.annotation.adapters
|
||||
javax.xml.bind.annotation=jakarta.xml.bind.annotation
|
||||
javax.xml.bind.attachment=jakarta.xml.bind.attachment
|
||||
javax.xml.bind.helpers=jakarta.xml.bind.helpers
|
||||
javax.xml.bind.util=jakarta.xml.bind.util
|
||||
javax.xml.bind=jakarta.xml.bind
|
||||
|
||||
javax.xml.soap=jakarta.xml.soap
|
||||
|
||||
javax.xml.ws.handler.soap=jakarta.xml.ws.handler.soap
|
||||
javax.xml.ws.handler=jakarta.xml.ws.handler
|
||||
javax.xml.ws.http=jakarta.xml.ws.http
|
||||
javax.xml.ws.soap=jakarta.xml.ws.soap
|
||||
javax.xml.ws.spi.http=jakarta.xml.ws.spi.http
|
||||
javax.xml.ws.spi=jakarta.xml.ws.spi
|
||||
javax.xml.ws.wsaddressing=jakarta.xml.ws.wsaddressing
|
||||
javax.xml.ws=jakarta.xml.ws
|
@@ -0,0 +1,40 @@
|
||||
jakarta.activation=[2.0,3)
|
||||
|
||||
jakarta.annotation.security=[2.0,3)
|
||||
jakarta.annotation.sql=[2.0,3)
|
||||
jakarta.annotation=[2.0,3)
|
||||
|
||||
javax.mail.event=[2.0,3)
|
||||
javax.mail.internet=[2.0,3)
|
||||
javax.mail.search=[2.0,3)
|
||||
javax.mail.util=[2.0,3)
|
||||
javax.mail=[2.0,3)
|
||||
|
||||
jakarta.servlet.annotation=[5.0,6)
|
||||
jakarta.servlet.descriptor=[5.0,6)
|
||||
jakarta.servlet.http=[5.0,6)
|
||||
jakarta.servlet.resources=[5.0,6)
|
||||
jakarta.servlet=[5.0,6)
|
||||
|
||||
jakarta.jms=[3.0,4)
|
||||
|
||||
jakarta.jws.soap=[3.0,4)
|
||||
jakarta.jws=[3.0,4)
|
||||
|
||||
jakarta.xml.bind.annotation.adapters=[3.0,4)
|
||||
jakarta.xml.bind.annotation=[3.0,4)
|
||||
jakarta.xml.bind.attachment=[3.0,4)
|
||||
jakarta.xml.bind.helpers=[3.0,4)
|
||||
jakarta.xml.bind.util=[3.0,4)
|
||||
jakarta.xml.bind=[3.0,4)
|
||||
|
||||
jakarta.xml.soap=[3.0,4)
|
||||
|
||||
jakarta.xml.ws.handler.soap=[3.0,4)
|
||||
jakarta.xml.ws.handler=[3.0,4)
|
||||
jakarta.xml.ws.http=[3.0,4)
|
||||
jakarta.xml.ws.soap=[3.0,4)
|
||||
jakarta.xml.ws.spi.http=[3.0,4)
|
||||
jakarta.xml.ws.spi=[3.0,4)
|
||||
jakarta.xml.ws.wsaddressing=[3.0,4)
|
||||
jakarta.xml.ws=[3.0,4)
|
31
jakarta-dependencies/build-dependencies.sh
Executable file
31
jakarta-dependencies/build-dependencies.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
HTTP_CREDENTIALS=$1
|
||||
DEPENDENCIES_DIR="$(dirname "${BASH_SOURCE[0]}")"
|
||||
|
||||
mvn -f $DEPENDENCIES_DIR -B clean install
|
||||
|
||||
function clone_and_install {
|
||||
local project_path=$DEPENDENCIES_DIR/projects/$1
|
||||
local branch_name=${2:-jakarta-migration}
|
||||
if [ ! -d "$project_path" ]; then
|
||||
if [ -z "$HTTP_CREDENTIALS" ]; then
|
||||
git clone --single-branch --branch $branch_name git@github.com:Alfresco/$1.git $project_path
|
||||
else
|
||||
git clone --single-branch --branch $branch_name https://${HTTP_CREDENTIALS}@github.com/Alfresco/$1.git $project_path
|
||||
fi
|
||||
fi
|
||||
mvn -f $project_path -B clean install -DskipTests -Dmaven.javadoc.skip=true
|
||||
}
|
||||
|
||||
clone_and_install surf-webscripts
|
||||
clone_and_install alfresco-greenmail
|
||||
clone_and_install alfresco-tas-utility
|
||||
clone_and_install alfresco-tas-email
|
||||
clone_and_install alfresco-office-services
|
||||
|
||||
#Ugly hack to deal with AOS<->REPO circular dependencies
|
||||
mvn -f $DEPENDENCIES_DIR/.. install -pl :alfresco-remote-api -am -DskipTests -Dmaven.javadoc.skip=true
|
||||
clone_and_install alfresco-aos-module
|
24
jakarta-dependencies/pom.xml
Normal file
24
jakarta-dependencies/pom.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>jakarta-dependencies</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.transformer</groupId>
|
||||
<artifactId>transformer-maven-plugin</artifactId>
|
||||
<version>0.5.0</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<modules>
|
||||
<module>binary-transformed-to-jakarta</module>
|
||||
</modules>
|
||||
</project>
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>20.94</version>
|
||||
<version>23.1.0.155-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
@@ -31,6 +31,11 @@
|
||||
<artifactId>maven-artifact</artifactId>
|
||||
<version>${dependency.maven-artifact.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
|
@@ -9,6 +9,6 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>20.94</version>
|
||||
<version>23.1.0.155-SNAPSHOT</version>
|
||||
</parent>
|
||||
</project>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Fetch image based on Tomcat 9.0, Java 17 and Rocky Linux 8
|
||||
# More infos about this image: https://github.com/Alfresco/alfresco-docker-base-tomcat
|
||||
FROM alfresco/alfresco-base-tomcat:tomcat9-jre17-rockylinux8-202209261711
|
||||
FROM quay.io/alfresco/alfresco-base-tomcat:tomcat10-jre17-rockylinux8
|
||||
|
||||
# Set default docker_context.
|
||||
ARG resource_path=target
|
||||
@@ -48,7 +48,7 @@ COPY ${resource_path}/amps ${TOMCAT_DIR}/amps
|
||||
# Install amps on alfresco.war
|
||||
RUN java -jar ${TOMCAT_DIR}/alfresco-mmt/alfresco-mmt*.jar install \
|
||||
${TOMCAT_DIR}/amps \
|
||||
${TOMCAT_DIR}/webapps/alfresco -directory -nobackup
|
||||
${TOMCAT_DIR}/webapps/alfresco -directory -nobackup -force
|
||||
|
||||
# Move the log file
|
||||
RUN sed -i -e "s_appender.rolling.fileName\=alfresco.log_appender.rolling.fileName\=${TOMCAT_DIR}/logs\/alfresco.log_" \
|
||||
@@ -65,7 +65,7 @@ RUN sed -i -e "s_appender.rolling.fileName\=alfresco.log_appender.rolling.fileNa
|
||||
RUN yum install -y fontconfig-2.13.1-4.el8 \
|
||||
dejavu-fonts-common-2.35-7.el8 \
|
||||
fontpackages-filesystem-1.44-22.el8 \
|
||||
freetype-2.9.1-4.el8_3.1 \
|
||||
freetype-2.9.1-9.el8 \
|
||||
libpng-1.6.34-5.el8 \
|
||||
dejavu-sans-fonts-2.35-7.el8 && \
|
||||
yum clean all
|
||||
|
@@ -7,11 +7,12 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>20.94</version>
|
||||
<version>23.1.0.155-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<image.name>alfresco/alfresco-community-repo-base</image.name>
|
||||
<scripts.directory>${project.parent.parent.basedir}/scripts</scripts.directory>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
@@ -156,6 +157,67 @@
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>build-multiarch-docker-images</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<images>
|
||||
<image>
|
||||
<name>${local.registry}/${image.name}:${image.tag}</name>
|
||||
<build>
|
||||
<buildx>
|
||||
<platforms>
|
||||
<platform>linux/amd64</platform>
|
||||
<platform>linux/arm64</platform>
|
||||
</platforms>
|
||||
<builderName>${builder.name}</builderName>
|
||||
</buildx>
|
||||
<contextDir>${project.basedir}</contextDir>
|
||||
</build>
|
||||
</image>
|
||||
</images>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>build-push-image</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>build</goal>
|
||||
<goal>push</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>prepare-buildx</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>${scripts.directory}/prepare_buildx.sh</executable>
|
||||
<arguments>
|
||||
<argument>${builder.name}</argument>
|
||||
<argument>${image.registry}</argument>
|
||||
<argument>${image.name}</argument>
|
||||
<argument>${image.tag}</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>push-docker-images</id>
|
||||
<!-- publishes "image:latest" on Quay & DockerHub -->
|
||||
@@ -168,12 +230,29 @@
|
||||
<images>
|
||||
<!-- Quay image -->
|
||||
<image>
|
||||
<name>${image.name}:${image.tag}</name>
|
||||
<registry>${image.registry}</registry>
|
||||
<name>${image.registry}/${image.name}:${image.tag}</name>
|
||||
<build>
|
||||
<buildx>
|
||||
<platforms>
|
||||
<platform>linux/amd64</platform>
|
||||
<platform>linux/arm64</platform>
|
||||
</platforms>
|
||||
</buildx>
|
||||
<contextDir>${project.basedir}</contextDir>
|
||||
</build>
|
||||
</image>
|
||||
<!-- DockerHub image -->
|
||||
<image>
|
||||
<name>${image.name}:${image.tag}</name>
|
||||
<build>
|
||||
<buildx>
|
||||
<platforms>
|
||||
<platform>linux/amd64</platform>
|
||||
<platform>linux/arm64</platform>
|
||||
</platforms>
|
||||
</buildx>
|
||||
<contextDir>${project.basedir}</contextDir>
|
||||
</build>
|
||||
</image>
|
||||
</images>
|
||||
</configuration>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>20.94</version>
|
||||
<version>23.1.0.155-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -1,3 +1,3 @@
|
||||
SOLR6_TAG=2.0.7-A2
|
||||
SOLR6_TAG=2.0.7-A5
|
||||
POSTGRES_TAG=14.4
|
||||
ACTIVEMQ_TAG=5.17.1-jre11-rockylinux8
|
||||
ACTIVEMQ_TAG=5.17.4-jre17-rockylinux8
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>20.94</version>
|
||||
<version>23.1.0.155-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>20.94</version>
|
||||
<version>23.1.0.155-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<organization>
|
||||
@@ -16,12 +16,11 @@
|
||||
</organization>
|
||||
|
||||
<properties>
|
||||
<maven.build.sourceVersion>11</maven.build.sourceVersion>
|
||||
<maven.build.sourceVersion>17</maven.build.sourceVersion>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<chemistry-opencmis-commons-api>1.1.0</chemistry-opencmis-commons-api>
|
||||
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
|
||||
<maven-release.version>2.5.3</maven-release.version>
|
||||
<java.version>11</java.version>
|
||||
<java.version>17</java.version>
|
||||
<suiteXmlFile>${project.basedir}/src/test/resources/cmis-suite.xml</suiteXmlFile>
|
||||
<cmis.binding />
|
||||
<cmis.basePath />
|
||||
@@ -58,12 +57,6 @@
|
||||
</profiles>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jboss.resteasy</groupId>
|
||||
<artifactId>resteasy-jackson2-provider</artifactId>
|
||||
<version>4.7.1.Final</version>
|
||||
</dependency>
|
||||
|
||||
<!-- alfresco tester settings -->
|
||||
<dependency>
|
||||
<groupId>org.alfresco.tas</groupId>
|
||||
@@ -75,13 +68,6 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- open cmis settings -->
|
||||
<dependency>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-commons-api</artifactId>
|
||||
<version>${chemistry-opencmis-commons-api}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@@ -4,8 +4,6 @@ import org.alfresco.utility.data.AisToken;
|
||||
import org.alfresco.utility.data.auth.DataAIS;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.apache.chemistry.opencmis.commons.SessionParameter;
|
||||
import org.keycloak.authorization.client.util.HttpResponseException;
|
||||
import org.keycloak.representations.AccessTokenResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -86,9 +84,9 @@ public class AuthParameterProviderFactory
|
||||
parameters.put(SessionParameter.OAUTH_REFRESH_TOKEN, aisToken.getRefreshToken());
|
||||
parameters.put(SessionParameter.OAUTH_EXPIRATION_TIMESTAMP, String.valueOf(System.currentTimeMillis()
|
||||
+ (aisToken.getExpiresIn() * 1000))); // getExpiresIn is in seconds
|
||||
parameters.put(SessionParameter.OAUTH_TOKEN_ENDPOINT, cmisProperties.aisProperty().getAdapterConfig().getAuthServerUrl()
|
||||
parameters.put(SessionParameter.OAUTH_TOKEN_ENDPOINT, cmisProperties.aisProperty().getAuthServerUrl()
|
||||
+ "/realms/alfresco/protocol/openid-connect/token");
|
||||
parameters.put(SessionParameter.OAUTH_CLIENT_ID, cmisProperties.aisProperty().getAdapterConfig().getResource());
|
||||
parameters.put(SessionParameter.OAUTH_CLIENT_ID, cmisProperties.aisProperty().getResource());
|
||||
return parameters;
|
||||
}
|
||||
|
||||
@@ -110,10 +108,10 @@ public class AuthParameterProviderFactory
|
||||
// Attempt to get an access token for userModel from AIS
|
||||
aisToken = dataAIS.perform().getAccessToken(userModel);
|
||||
}
|
||||
catch (HttpResponseException e)
|
||||
catch (AssertionError e)
|
||||
{
|
||||
// Trying to authenticate with invalid user credentials so return an invalid access token
|
||||
if (e.getStatusCode() == 401)
|
||||
if (e.getMessage().contains("invalid_grant"))
|
||||
{
|
||||
STEP(String.format("%s Invalid user credentials were provided %s:%s. Using invalid token for reqest.",
|
||||
STEP_PREFIX, userModel.getUsername(), userModel.getPassword()));
|
||||
|
@@ -280,16 +280,26 @@ public class CmisUtil
|
||||
|
||||
protected boolean isPrivateWorkingCopy()
|
||||
{
|
||||
boolean result;
|
||||
final Document document;
|
||||
try
|
||||
{
|
||||
result = getPWCDocument().isVersionSeriesPrivateWorkingCopy();
|
||||
document = getPWCDocument();
|
||||
}
|
||||
catch (CmisVersioningException cmisVersioningException)
|
||||
{
|
||||
result = false;
|
||||
return false;
|
||||
}
|
||||
return result;
|
||||
|
||||
if (Boolean.FALSE.equals(document.isVersionable())) return false;
|
||||
if (Boolean.FALSE.equals(document.isVersionSeriesCheckedOut())) return false;
|
||||
|
||||
final Boolean isPWC = document.isPrivateWorkingCopy();
|
||||
if (isPWC != null) return isPWC;
|
||||
|
||||
final String vsCoId = document.getVersionSeriesCheckedOutId();
|
||||
if (vsCoId == null) return false;
|
||||
|
||||
return vsCoId.equals(document.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>20.94</version>
|
||||
<version>23.1.0.155-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
@@ -31,6 +31,11 @@
|
||||
<artifactId>email</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.mail</groupId>
|
||||
<artifactId>jakarta.mail-api</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@@ -11,8 +11,8 @@ import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import javax.mail.FolderNotFoundException;
|
||||
import javax.mail.MessagingException;
|
||||
import jakarta.mail.FolderNotFoundException;
|
||||
import jakarta.mail.MessagingException;
|
||||
|
||||
public class ImapCheckFolderTests extends EmailTest
|
||||
{
|
||||
|
@@ -10,8 +10,8 @@ import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import javax.mail.FolderNotFoundException;
|
||||
import javax.mail.MessagingException;
|
||||
import jakarta.mail.FolderNotFoundException;
|
||||
import jakarta.mail.MessagingException;
|
||||
|
||||
public class ImapCopyFolderTests extends EmailTest
|
||||
{
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package org.alfresco.email.imap;
|
||||
|
||||
import javax.mail.MessagingException;
|
||||
import jakarta.mail.MessagingException;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.email.EmailTest;
|
||||
|
@@ -12,7 +12,7 @@ import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import javax.mail.FolderNotFoundException;
|
||||
import jakarta.mail.FolderNotFoundException;
|
||||
|
||||
/**
|
||||
* Tests for Create Folder action using IMAP client
|
||||
|
@@ -10,7 +10,7 @@ import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import javax.mail.FolderNotFoundException;
|
||||
import jakarta.mail.FolderNotFoundException;
|
||||
|
||||
public class ImapDeleteFolderTests extends EmailTest
|
||||
{
|
||||
|
@@ -9,7 +9,7 @@ import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import javax.mail.MessagingException;
|
||||
import jakarta.mail.MessagingException;
|
||||
|
||||
public class ImapDeleteMessagesTests extends EmailTest
|
||||
{
|
||||
|
@@ -8,7 +8,7 @@ import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import javax.mail.Flags;
|
||||
import jakarta.mail.Flags;
|
||||
|
||||
public class ImapMessageFlagsTests extends EmailTest
|
||||
{
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package org.alfresco.email.imap;
|
||||
|
||||
import javax.mail.FolderNotFoundException;
|
||||
import jakarta.mail.FolderNotFoundException;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.email.EmailTest;
|
||||
|
@@ -10,8 +10,8 @@ import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import javax.mail.Flags;
|
||||
import javax.mail.MessagingException;
|
||||
import jakarta.mail.Flags;
|
||||
import jakarta.mail.MessagingException;
|
||||
import java.io.IOException;
|
||||
|
||||
public class ImapReadMessagesTests extends EmailTest
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package org.alfresco.email.imap;
|
||||
|
||||
import javax.mail.FolderNotFoundException;
|
||||
import jakarta.mail.FolderNotFoundException;
|
||||
|
||||
import org.alfresco.email.EmailTest;
|
||||
import org.alfresco.utility.constants.UserRole;
|
||||
|
@@ -8,8 +8,8 @@ import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import javax.mail.FolderNotFoundException;
|
||||
import javax.mail.MessagingException;
|
||||
import jakarta.mail.FolderNotFoundException;
|
||||
import jakarta.mail.MessagingException;
|
||||
|
||||
public class ImapSitesTests extends EmailTest
|
||||
{
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>20.94</version>
|
||||
<version>23.1.0.155-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
@@ -95,7 +95,6 @@
|
||||
<dependency>
|
||||
<groupId>com.jayway.jsonpath</groupId>
|
||||
<artifactId>json-path</artifactId>
|
||||
<version>${dependency.jakarta-json-path.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@@ -2,7 +2,7 @@ package org.alfresco.tas.integration;
|
||||
|
||||
import static org.alfresco.utility.report.log.Step.STEP;
|
||||
|
||||
import javax.mail.FolderNotFoundException;
|
||||
import jakarta.mail.FolderNotFoundException;
|
||||
|
||||
import org.alfresco.rest.model.RestCommentModel;
|
||||
import org.alfresco.rest.model.RestDeploymentModel;
|
||||
|
@@ -8,8 +8,8 @@ import io.restassured.RestAssured;
|
||||
import java.io.File;
|
||||
|
||||
import javax.json.JsonObject;
|
||||
import javax.mail.Flags;
|
||||
import javax.mail.MessagingException;
|
||||
import jakarta.mail.Flags;
|
||||
import jakarta.mail.MessagingException;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.dataprep.SiteService.Visibility;
|
||||
|
@@ -5,7 +5,7 @@ import static org.alfresco.utility.report.log.Step.STEP;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.mail.MessagingException;
|
||||
import jakarta.mail.MessagingException;
|
||||
|
||||
import org.alfresco.rest.model.RestCommentModel;
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
|
@@ -8,20 +8,19 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>20.94</version>
|
||||
<version>23.1.0.155-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<suiteXmlFile>${project.basedir}/src/test/resources/restapi-suite.xml</suiteXmlFile>
|
||||
<maven.build.sourceVersion>11</maven.build.sourceVersion>
|
||||
<maven.build.sourceVersion>17</maven.build.sourceVersion>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<rest.api.explorer.branch>master</rest.api.explorer.branch>
|
||||
<httpclient-osgi-version>4.5.6</httpclient-osgi-version>
|
||||
<org.glassfish.version>1.1.4</org.glassfish.version>
|
||||
<commons-lang3.version>3.12.0</commons-lang3.version>
|
||||
<scribejava-apis.version>8.3.1</scribejava-apis.version>
|
||||
<license-maven-plugin.version>2.0.1.alfresco-2</license-maven-plugin.version>
|
||||
<java.version>11</java.version>
|
||||
<scribejava-apis.version>8.3.3</scribejava-apis.version>
|
||||
<java.version>17</java.version>
|
||||
</properties>
|
||||
|
||||
<profiles>
|
||||
@@ -46,13 +45,9 @@
|
||||
</profiles>
|
||||
|
||||
<dependencies>
|
||||
<!-- fix the info log messages related to Could not instantiate TestExecutionListener
|
||||
[org.springframework.test.context.web.ServletTestExecutionListener -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.5</version>
|
||||
<scope>provided</scope>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- alfresco tester settings -->
|
||||
@@ -85,6 +80,13 @@
|
||||
<version>${commons-lang3.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.awaitility</groupId>
|
||||
<artifactId>awaitility</artifactId>
|
||||
<version>${dependency.awaitility.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- REST ASSURED -->
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
@@ -165,14 +167,14 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy</artifactId>
|
||||
<version>3.0.12</version>
|
||||
<version>3.0.17</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-json-->
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-json</artifactId>
|
||||
<version>3.0.12</version>
|
||||
<version>3.0.17</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@@ -30,7 +30,6 @@ import static org.alfresco.utility.report.log.Step.STEP;
|
||||
import org.alfresco.utility.data.AisToken;
|
||||
import org.alfresco.utility.data.auth.DataAIS;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.keycloak.authorization.client.util.HttpResponseException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -86,12 +85,11 @@ public class RestAisAuthentication
|
||||
// Attempt to get an access token for userModel from AIS
|
||||
aisToken = dataAIS.perform().getAccessToken(userModel);
|
||||
}
|
||||
catch (HttpResponseException e)
|
||||
catch (AssertionError e)
|
||||
{
|
||||
// Trying to authenticate with invalid user credentials or disabled
|
||||
// user so return an invalid access token
|
||||
String httpResponse = new String(e.getBytes());
|
||||
if (e.getStatusCode() == 401 || httpResponse.contains(USER_DISABLED_MSG))
|
||||
if (e.getMessage().contains("invalid_grant"))
|
||||
{
|
||||
STEP(String.format("%s User disabled or invalid user credentials were provided %s:%s. Using invalid token for request.", STEP_PREFIX,
|
||||
userModel.getUsername(), userModel.getPassword()));
|
||||
|
@@ -86,6 +86,7 @@ import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.testng.Assert;
|
||||
@@ -630,37 +631,27 @@ public class RestWrapper extends DSLWrapper<RestWrapper>
|
||||
|
||||
STEP(restRequest.toString());
|
||||
|
||||
Response returnedResponse;
|
||||
switch (restRequest.getHttpMethod())
|
||||
{
|
||||
case GET:
|
||||
returnedResponse = onRequest().get(restRequest.getPath(), restRequest.getPathParams()).andReturn();
|
||||
break;
|
||||
case DELETE:
|
||||
returnedResponse = onRequest().delete(restRequest.getPath(), restRequest.getPathParams()).andReturn();
|
||||
break;
|
||||
case HEAD:
|
||||
returnedResponse = onRequest().head(restRequest.getPath(), restRequest.getPathParams()).andReturn();
|
||||
break;
|
||||
case OPTIONS:
|
||||
returnedResponse = onRequest().options(restRequest.getPath(), restRequest.getPathParams()).andReturn();
|
||||
break;
|
||||
case POST:
|
||||
returnedResponse = onRequest().body(restRequest.getBody())
|
||||
.post(restRequest.getPath(), restRequest.getPathParams()).andReturn();
|
||||
break;
|
||||
case PUT:
|
||||
returnedResponse = onRequest().body(restRequest.getBody())
|
||||
.contentType(ContentType.JSON.withCharset(restRequest.getContentType()))
|
||||
.put(restRequest.getPath(), restRequest.getPathParams()).andReturn();
|
||||
break;
|
||||
case TRACE:
|
||||
returnedResponse = onRequest().get(restRequest.getPath(), restRequest.getPathParams()).andReturn();
|
||||
break;
|
||||
default:
|
||||
returnedResponse = onRequest().get(restRequest.getPath(), restRequest.getPathParams()).andReturn();
|
||||
break;
|
||||
}
|
||||
final Response returnedResponse;
|
||||
HttpMethod httpMethod = restRequest.getHttpMethod();
|
||||
if (HttpMethod.GET.equals(httpMethod))
|
||||
returnedResponse = onRequest().get(restRequest.getPath(), restRequest.getPathParams()).andReturn();
|
||||
else if (HttpMethod.DELETE.equals(httpMethod))
|
||||
returnedResponse = onRequest().delete(restRequest.getPath(), restRequest.getPathParams()).andReturn();
|
||||
else if (HttpMethod.HEAD.equals(httpMethod))
|
||||
returnedResponse = onRequest().head(restRequest.getPath(), restRequest.getPathParams()).andReturn();
|
||||
else if (HttpMethod.OPTIONS.equals(httpMethod))
|
||||
returnedResponse = onRequest().options(restRequest.getPath(), restRequest.getPathParams()).andReturn();
|
||||
else if (HttpMethod.POST.equals(httpMethod))
|
||||
returnedResponse = onRequest().body(restRequest.getBody())
|
||||
.post(restRequest.getPath(), restRequest.getPathParams()).andReturn();
|
||||
else if (HttpMethod.PUT.equals(httpMethod))
|
||||
returnedResponse = onRequest().body(restRequest.getBody())
|
||||
.contentType(ContentType.JSON.withCharset(restRequest.getContentType()))
|
||||
.put(restRequest.getPath(), restRequest.getPathParams()).andReturn();
|
||||
else if (HttpMethod.TRACE.equals(httpMethod))
|
||||
returnedResponse = onRequest().get(restRequest.getPath(), restRequest.getPathParams()).andReturn();
|
||||
else
|
||||
returnedResponse = onRequest().get(restRequest.getPath(), restRequest.getPathParams()).andReturn();
|
||||
|
||||
logResponseInformation(restRequest, returnedResponse);
|
||||
|
||||
@@ -680,17 +671,22 @@ public class RestWrapper extends DSLWrapper<RestWrapper>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (returnedResponse.getContentType().contains("image/png"))
|
||||
{
|
||||
LOG.info("On {} {}, received the response with an image and headers: \n{}", restRequest.getHttpMethod(), restRequest.getPath(),
|
||||
returnedResponse.getHeaders().toString());
|
||||
}
|
||||
else if (returnedResponse.getContentType().contains("application/json") && !returnedResponse.asString().isEmpty())
|
||||
if (returnedResponse.asString().isEmpty())
|
||||
{
|
||||
LOG.info("On {} {}, received the following response \n{}", restRequest.getHttpMethod(), restRequest.getPath(),
|
||||
Utility.prettyPrintJsonString(returnedResponse.asString()));
|
||||
returnedResponse.getStatusCode());
|
||||
}
|
||||
else if (returnedResponse.getContentType().contains("application/xml") && !returnedResponse.asString().isEmpty())
|
||||
else if (returnedResponse.getContentType().contains("image/png"))
|
||||
{
|
||||
LOG.info("On {} {}, received the response with an image and headers: \n{}", restRequest.getHttpMethod(), restRequest.getPath(),
|
||||
returnedResponse.getHeaders().toString());
|
||||
}
|
||||
else if (returnedResponse.getContentType().contains("application/json"))
|
||||
{
|
||||
LOG.info("On {} {}, received the following response \n{}", restRequest.getHttpMethod(), restRequest.getPath(),
|
||||
Utility.prettyPrintJsonString(returnedResponse.asString()));
|
||||
}
|
||||
else if (returnedResponse.getContentType().contains("application/xml"))
|
||||
{
|
||||
String response = parseXML(returnedResponse);
|
||||
LOG.info("On {} {}, received the following response \n{}", restRequest.getHttpMethod(), restRequest.getPath(), response);
|
||||
@@ -698,7 +694,7 @@ public class RestWrapper extends DSLWrapper<RestWrapper>
|
||||
else
|
||||
{
|
||||
LOG.info("On {} {}, received the following response \n{}", restRequest.getHttpMethod(), restRequest.getPath(),
|
||||
ToStringBuilder.reflectionToString(returnedResponse.asString(), ToStringStyle.MULTI_LINE_STYLE));
|
||||
ToStringBuilder.reflectionToString(returnedResponse.asString(), ToStringStyle.MULTI_LINE_STYLE));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -30,7 +30,10 @@ import static org.alfresco.utility.report.log.Step.STEP;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.alfresco.rest.core.IRestModelsCollection;
|
||||
import org.alfresco.utility.exception.TestConfigurationException;
|
||||
@@ -117,7 +120,7 @@ public class ModelsCollectionAssertion<C>
|
||||
return (C) modelCollection;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings("unchecked")
|
||||
public C entriesListDoesNotContain(String key, String value)
|
||||
{
|
||||
boolean exist = false;
|
||||
@@ -143,6 +146,53 @@ public class ModelsCollectionAssertion<C>
|
||||
return (C) modelCollection;
|
||||
}
|
||||
|
||||
public C entrySetContains(String key, String... expectedValues)
|
||||
{
|
||||
return entrySetContains(key, Arrays.stream(expectedValues).collect(Collectors.toSet()));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public C entrySetContains(String key, Collection<String> expectedValues)
|
||||
{
|
||||
Collection<String> actualValues = ((List<Model>) modelCollection.getEntries()).stream()
|
||||
.map(model -> extractValueAsString(model, key))
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
Assert.assertTrue(actualValues.containsAll(expectedValues), String.format("Entry with key: \"%s\" is expected to contain values: %s, but actual values are: %s",
|
||||
key, expectedValues, actualValues));
|
||||
|
||||
return (C) modelCollection;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public C entrySetMatches(String key, Collection<String> expectedValues)
|
||||
{
|
||||
Collection<String> actualValues = ((List<Model>) modelCollection.getEntries()).stream()
|
||||
.map(model -> extractValueAsString(model, key))
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
Assert.assertEqualsNoOrder(actualValues, expectedValues, String.format("Entry with key: \"%s\" is expected to match values: %s, but actual values are: %s",
|
||||
key, expectedValues, actualValues));
|
||||
|
||||
return (C) modelCollection;
|
||||
}
|
||||
|
||||
private String extractValueAsString(Model model, String key)
|
||||
{
|
||||
String fieldValue;
|
||||
Object modelObject = loadModel(model);
|
||||
try {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
String jsonInString = mapper.writeValueAsString(modelObject);
|
||||
fieldValue = JsonPath.with(jsonInString).get(key);
|
||||
} catch (Exception e) {
|
||||
throw new TestConfigurationException(String.format(
|
||||
"You try to assert field [%s] that doesn't exist in class: [%s]. Exception: %s, Please check your code!",
|
||||
key, getClass().getCanonicalName(), e.getMessage()));
|
||||
}
|
||||
return fieldValue;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public C entriesListDoesNotContain(String key)
|
||||
{
|
||||
|
@@ -52,6 +52,11 @@ This must be unique within the parent category.
|
||||
*/
|
||||
private long count;
|
||||
|
||||
/**
|
||||
The path to this category.
|
||||
*/
|
||||
private String path;
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return this.id;
|
||||
@@ -102,6 +107,14 @@ This must be unique within the parent category.
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
@@ -126,6 +139,7 @@ This must be unique within the parent category.
|
||||
", parentId='" + parentId + '\'' +
|
||||
", hasChildren=" + hasChildren +
|
||||
", count=" + count +
|
||||
", path=" + path +
|
||||
'}';
|
||||
}
|
||||
|
||||
|
@@ -60,7 +60,7 @@ public class RestErrorModel
|
||||
public static String INVALID_MAXITEMS = "Invalid paging parameter maxItems:%s";
|
||||
public static String INVALID_SKIPCOUNT = "Invalid paging parameter skipCount:%s";
|
||||
public static String INVALID_TAG = "Tag name must not contain %s char sequence";
|
||||
public static String EMPTY_TAG = "New tag cannot be null";
|
||||
public static String BLANK_TAG = "New tag cannot be blank";
|
||||
public static String UNKNOWN_ROLE = "Unknown role '%s'";
|
||||
public static String ALREADY_Site_MEMBER = "%s is already a member of site %s";
|
||||
public static String ALREADY_INVITED = "%s is already invited to site %s";
|
||||
|
@@ -0,0 +1,190 @@
|
||||
package org.alfresco.rest.search;
|
||||
|
||||
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 '2023-06-12 18:46' from 'Alfresco Content Services REST API' swagger file
|
||||
* Generated from 'Alfresco Content Services REST API' swagger file
|
||||
* Base Path {@linkplain /alfresco/api/-default-/public/search/versions/1}
|
||||
*/
|
||||
public class RestRequestDefaultsModel extends TestModel implements IRestModel<RestRequestDefaultsModel>
|
||||
{
|
||||
@JsonProperty(value = "entry")
|
||||
RestRequestDefaultsModel model;
|
||||
|
||||
@Override
|
||||
public RestRequestDefaultsModel onModel()
|
||||
{
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
A list of query fields/properties used to expand TEXT: queries.
|
||||
The default is cm:content.
|
||||
You could include all content properties using d:content or list all individual content properties or types.
|
||||
As more terms are included the query size, complexity, memory impact and query time will increase.
|
||||
|
||||
*/
|
||||
|
||||
private List<String> textAttributes;
|
||||
/**
|
||||
The default way to combine query parts when AND or OR is not explicitly stated - includes ! - +
|
||||
one two three
|
||||
(one two three)
|
||||
|
||||
*/
|
||||
|
||||
private String defaultFTSOperator;
|
||||
/**
|
||||
The default way to combine query parts in field query groups when AND or OR is not explicitly stated - includes ! - +
|
||||
FIELD:(one two three)
|
||||
|
||||
*/
|
||||
|
||||
private String defaultFTSFieldOperator;
|
||||
/**
|
||||
The default name space to use if one is not provided
|
||||
*/
|
||||
|
||||
private String namespace;
|
||||
|
||||
private String defaultFieldName;
|
||||
|
||||
public List<String> getTextAttributes()
|
||||
{
|
||||
return this.textAttributes;
|
||||
}
|
||||
|
||||
public void setTextAttributes(List<String> textAttributes)
|
||||
{
|
||||
this.textAttributes = textAttributes;
|
||||
}
|
||||
|
||||
public String getDefaultFTSOperator()
|
||||
{
|
||||
return this.defaultFTSOperator;
|
||||
}
|
||||
|
||||
public void setDefaultFTSOperator(String defaultFTSOperator)
|
||||
{
|
||||
this.defaultFTSOperator = defaultFTSOperator;
|
||||
}
|
||||
|
||||
public String getDefaultFTSFieldOperator()
|
||||
{
|
||||
return this.defaultFTSFieldOperator;
|
||||
}
|
||||
|
||||
public void setDefaultFTSFieldOperator(String defaultFTSFieldOperator)
|
||||
{
|
||||
this.defaultFTSFieldOperator = defaultFTSFieldOperator;
|
||||
}
|
||||
|
||||
public String getNamespace()
|
||||
{
|
||||
return this.namespace;
|
||||
}
|
||||
|
||||
public void setNamespace(String namespace)
|
||||
{
|
||||
this.namespace = namespace;
|
||||
}
|
||||
|
||||
public String getDefaultFieldName()
|
||||
{
|
||||
return this.defaultFieldName;
|
||||
}
|
||||
|
||||
public void setDefaultFieldName(String defaultFieldName)
|
||||
{
|
||||
this.defaultFieldName = defaultFieldName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "RestRequestDefaultsModel{" + "textAttributes=" + textAttributes + ", defaultFTSOperator='" + defaultFTSOperator + '\'' + ", defaultFTSFieldOperator='"
|
||||
+ defaultFTSFieldOperator + '\'' + ", namespace='" + namespace + '\'' + ", defaultFieldName='" + defaultFieldName + '\'' + '}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
RestRequestDefaultsModel that = (RestRequestDefaultsModel) o;
|
||||
return Objects.equals(textAttributes, that.textAttributes) && Objects.equals(defaultFTSOperator, that.defaultFTSOperator) && Objects.equals(
|
||||
defaultFTSFieldOperator, that.defaultFTSFieldOperator) && Objects.equals(namespace, that.namespace) && Objects.equals(defaultFieldName, that.defaultFieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return Objects.hash(textAttributes, defaultFTSOperator, defaultFTSFieldOperator, namespace, defaultFieldName);
|
||||
}
|
||||
|
||||
public static Builder builder()
|
||||
{
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public static class Builder
|
||||
{
|
||||
private List<String> textAttributes;
|
||||
private String defaultFTSOperator;
|
||||
private String defaultFTSFieldOperator;
|
||||
private String namespace;
|
||||
private String defaultFieldName;
|
||||
|
||||
public Builder textAttributes(List<String> textAttributes)
|
||||
{
|
||||
this.textAttributes = textAttributes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder defaultFTSOperator(String defaultFTSOperator)
|
||||
{
|
||||
this.defaultFTSOperator = defaultFTSOperator;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder defaultFTSFieldOperator(String defaultFTSFieldOperator)
|
||||
{
|
||||
this.defaultFTSFieldOperator = defaultFTSFieldOperator;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder namespace(String namespace)
|
||||
{
|
||||
this.namespace = namespace;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder defaultFieldName(String defaultFieldName)
|
||||
{
|
||||
this.defaultFieldName = defaultFieldName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RestRequestDefaultsModel create()
|
||||
{
|
||||
RestRequestDefaultsModel defaults = new RestRequestDefaultsModel();
|
||||
defaults.setTextAttributes(this.textAttributes);
|
||||
defaults.setDefaultFTSOperator(this.defaultFTSOperator);
|
||||
defaults.setDefaultFTSFieldOperator(this.defaultFTSFieldOperator);
|
||||
defaults.setNamespace(this.namespace);
|
||||
defaults.setDefaultFieldName(this.defaultFieldName);
|
||||
|
||||
return defaults;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,105 @@
|
||||
package org.alfresco.rest.search;
|
||||
|
||||
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 '2023-06-12 18:46' from 'Alfresco Content Services REST API' swagger file
|
||||
* Generated from 'Alfresco Content Services REST API' swagger file
|
||||
* Base Path {@linkplain /alfresco/api/-default-/public/search/versions/1}
|
||||
*/
|
||||
public class RestRequestTemplatesModel extends TestModel implements IRestModel<RestRequestTemplatesModel>
|
||||
{
|
||||
@JsonProperty(value = "entry")
|
||||
RestRequestTemplatesModel model;
|
||||
|
||||
@Override
|
||||
public RestRequestTemplatesModel onModel()
|
||||
{
|
||||
return model;
|
||||
}
|
||||
|
||||
private String name;
|
||||
|
||||
private String template;
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getTemplate()
|
||||
{
|
||||
return template;
|
||||
}
|
||||
|
||||
public void setTemplate(String template)
|
||||
{
|
||||
this.template = template;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "RestRequestTemplatesModel{" + "name='" + name + '\'' + ", template='" + template + '\'' + '}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
RestRequestTemplatesModel that = (RestRequestTemplatesModel) o;
|
||||
return Objects.equals(name, that.name) && Objects.equals(template, that.template);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return Objects.hash(name, template);
|
||||
}
|
||||
|
||||
public static Builder builder()
|
||||
{
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public static class Builder
|
||||
{
|
||||
private String name;
|
||||
private String template;
|
||||
|
||||
public Builder name(String name)
|
||||
{
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder template(String template)
|
||||
{
|
||||
this.template = template;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RestRequestTemplatesModel create()
|
||||
{
|
||||
RestRequestTemplatesModel template = new RestRequestTemplatesModel();
|
||||
template.setName(this.name);
|
||||
template.setTemplate(this.template);
|
||||
|
||||
return template;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -43,14 +43,15 @@
|
||||
*/
|
||||
package org.alfresco.rest.search;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import org.alfresco.rest.model.RestRequestRangesModel;
|
||||
import org.alfresco.rest.model.RestRequestSpellcheckModel;
|
||||
import org.alfresco.utility.model.TestModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Search Query object.
|
||||
* @author msuzuki
|
||||
@@ -76,6 +77,8 @@ public class SearchRequest extends TestModel
|
||||
String facetFormat;
|
||||
List<String> include;
|
||||
List<SortClause> sort;
|
||||
RestRequestDefaultsModel defaults;
|
||||
List<RestRequestTemplatesModel> templates;
|
||||
|
||||
public SearchRequest()
|
||||
{
|
||||
@@ -255,6 +258,26 @@ public class SearchRequest extends TestModel
|
||||
this.fields = fields;
|
||||
}
|
||||
|
||||
public RestRequestDefaultsModel getDefaults()
|
||||
{
|
||||
return defaults;
|
||||
}
|
||||
|
||||
public void setDefaults(RestRequestDefaultsModel defaults)
|
||||
{
|
||||
this.defaults = defaults;
|
||||
}
|
||||
|
||||
public List<RestRequestTemplatesModel> getTemplates()
|
||||
{
|
||||
return templates;
|
||||
}
|
||||
|
||||
public void setTemplates(List<RestRequestTemplatesModel> templates)
|
||||
{
|
||||
this.templates = templates;
|
||||
}
|
||||
|
||||
public List<SortClause> getSort()
|
||||
{
|
||||
if (sort == null)
|
||||
|
@@ -0,0 +1,223 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Remote API
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2023 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.categories;
|
||||
|
||||
import static org.alfresco.utility.data.RandomData.getRandomName;
|
||||
import static org.alfresco.utility.report.log.Step.STEP;
|
||||
import static org.springframework.http.HttpStatus.CREATED;
|
||||
import static org.springframework.http.HttpStatus.OK;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.rest.model.RestCategoryLinkBodyModel;
|
||||
import org.alfresco.rest.model.RestCategoryModel;
|
||||
import org.alfresco.rest.model.RestCategoryModelsCollection;
|
||||
import org.alfresco.utility.Utility;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.FolderModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
public class CategoriesPathTests extends CategoriesRestTest
|
||||
{
|
||||
private FileModel file;
|
||||
private RestCategoryModel category;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
@Override
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
STEP("Create user and site");
|
||||
user = dataUser.createRandomTestUser();
|
||||
SiteModel site = dataSite.usingUser(user).createPublicRandomSite();
|
||||
|
||||
STEP("Create a folder, file in it and a category");
|
||||
FolderModel folder = dataContent.usingUser(user).usingSite(site).createFolder();
|
||||
file = dataContent.usingUser(user).usingResource(folder).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
category = prepareCategoryUnderRoot();
|
||||
|
||||
STEP("Wait for indexing to complete");
|
||||
Utility.sleep(1000, 60000, () -> restClient.authenticateUser(user)
|
||||
.withCoreAPI()
|
||||
.usingCategory(category)
|
||||
.include(INCLUDE_PATH_PARAM)
|
||||
.getCategory()
|
||||
.assertThat()
|
||||
.field(FIELD_PATH)
|
||||
.isNotNull());
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify path for a category got by ID.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API })
|
||||
public void testGetCategoryById_includePath()
|
||||
{
|
||||
STEP("Get category and verify if path is a general path for categories");
|
||||
final RestCategoryModel actualCategory = restClient.authenticateUser(user)
|
||||
.withCoreAPI()
|
||||
.usingCategory(category)
|
||||
.include(INCLUDE_PATH_PARAM)
|
||||
.getCategory();
|
||||
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
actualCategory.assertThat().field(FIELD_ID).is(category.getId());
|
||||
actualCategory.assertThat().field(FIELD_PATH).is("/categories/General");
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify path for category.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API })
|
||||
public void testGetCategories_includePath()
|
||||
{
|
||||
STEP("Get few categories and verify its paths");
|
||||
final RestCategoryModel parentCategory = createCategoryModelWithId(ROOT_CATEGORY_ID);
|
||||
final RestCategoryModelsCollection actualCategories = restClient.authenticateUser(user)
|
||||
.withCoreAPI()
|
||||
.usingCategory(parentCategory)
|
||||
.include(INCLUDE_PATH_PARAM)
|
||||
.getCategoryChildren();
|
||||
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
assertTrue(actualCategories.getEntries().stream()
|
||||
.map(RestCategoryModel::onModel)
|
||||
.allMatch(cat -> cat.getPath().equals("/categories/General")));
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify path for child category.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API })
|
||||
public void testGetChildCategory_includePath()
|
||||
{
|
||||
STEP("Create parent and child categories");
|
||||
final RestCategoryModel parentCategory = prepareCategoryUnderRoot();
|
||||
final RestCategoryModel childCategory = prepareCategoryUnder(parentCategory);
|
||||
|
||||
STEP("Verify path for created child categories");
|
||||
final RestCategoryModelsCollection actualCategories = restClient.authenticateUser(user)
|
||||
.withCoreAPI()
|
||||
.usingCategory(parentCategory)
|
||||
.include(INCLUDE_PATH_PARAM)
|
||||
.getCategoryChildren();
|
||||
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
actualCategories.getEntries().stream()
|
||||
.map(RestCategoryModel::onModel)
|
||||
.forEach(cat -> cat.assertThat().field(FIELD_PATH).is("/categories/General/" + parentCategory.getName()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create category and verify that it has a path.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API })
|
||||
public void testCreateCategory_includingPath()
|
||||
{
|
||||
STEP("Create a category under root and verify if path is a general path for categories");
|
||||
final String categoryName = getRandomName("Category");
|
||||
final RestCategoryModel rootCategory = createCategoryModelWithId(ROOT_CATEGORY_ID);
|
||||
final RestCategoryModel aCategory = createCategoryModelWithName(categoryName);
|
||||
final RestCategoryModel createdCategory = restClient.authenticateUser(dataUser.getAdminUser())
|
||||
.withCoreAPI()
|
||||
.include(INCLUDE_PATH_PARAM)
|
||||
.usingCategory(rootCategory)
|
||||
.createSingleCategory(aCategory);
|
||||
|
||||
restClient.assertStatusCodeIs(CREATED);
|
||||
createdCategory.assertThat().field(FIELD_NAME).is(categoryName);
|
||||
createdCategory.assertThat().field(FIELD_PATH).is("/categories/General");
|
||||
}
|
||||
|
||||
/**
|
||||
* Update category and verify that it has a path.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API })
|
||||
public void testUpdateCategory_includePath()
|
||||
{
|
||||
STEP("Update linked category and verify if path is a general path for categories");
|
||||
final String categoryNewName = getRandomName("NewCategoryName");
|
||||
final RestCategoryModel fixedCategoryModel = createCategoryModelWithName(categoryNewName);
|
||||
final RestCategoryModel updatedCategory = restClient.authenticateUser(dataUser.getAdminUser())
|
||||
.withCoreAPI()
|
||||
.usingCategory(category)
|
||||
.include(INCLUDE_PATH_PARAM)
|
||||
.updateCategory(fixedCategoryModel);
|
||||
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
updatedCategory.assertThat().field(FIELD_ID).is(category.getId());
|
||||
updatedCategory.assertThat().field(FIELD_PATH).is("/categories/General");
|
||||
}
|
||||
|
||||
/**
|
||||
* Link node to categories and verify that they have path.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API })
|
||||
public void testLinkNodeToCategories_includePath()
|
||||
{
|
||||
STEP("Link node to categories and verify if path is a general path");
|
||||
final RestCategoryLinkBodyModel categoryLinkModel = createCategoryLinkModelWithId(category.getId());
|
||||
final RestCategoryModel linkedCategory = restClient.authenticateUser(dataUser.getAdminUser())
|
||||
.withCoreAPI()
|
||||
.usingNode(file)
|
||||
.include(INCLUDE_PATH_PARAM)
|
||||
.linkToCategory(categoryLinkModel);
|
||||
|
||||
restClient.assertStatusCodeIs(CREATED);
|
||||
linkedCategory.assertThat().field(FIELD_ID).is(category.getId());
|
||||
linkedCategory.assertThat().field(FIELD_PATH).is("/categories/General");
|
||||
}
|
||||
|
||||
/**
|
||||
* List categories for given node and verify that they have a path.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API })
|
||||
public void testListCategoriesForNode_includePath()
|
||||
{
|
||||
STEP("Link file to category");
|
||||
final RestCategoryLinkBodyModel categoryLink = createCategoryLinkModelWithId(category.getId());
|
||||
final RestCategoryModel linkedCategory = restClient.authenticateUser(dataUser.getAdminUser())
|
||||
.withCoreAPI()
|
||||
.usingNode(file)
|
||||
.include(INCLUDE_PATH_PARAM)
|
||||
.linkToCategory(categoryLink);
|
||||
|
||||
STEP("Get linked category and verify if path is a general path");
|
||||
final RestCategoryModelsCollection linkedCategories = restClient.authenticateUser(dataUser.getAdminUser())
|
||||
.withCoreAPI()
|
||||
.usingNode(file)
|
||||
.include(INCLUDE_PATH_PARAM)
|
||||
.getLinkedCategories();
|
||||
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
linkedCategories.assertThat().entriesListCountIs(1);
|
||||
linkedCategories.getEntries().get(0).onModel().assertThat().field(FIELD_ID).is(category.getId());
|
||||
linkedCategories.getEntries().get(0).onModel().assertThat().field(FIELD_PATH).is("/categories/General");
|
||||
}
|
||||
}
|
@@ -46,6 +46,7 @@ import org.testng.annotations.BeforeClass;
|
||||
abstract class CategoriesRestTest extends RestTest
|
||||
{
|
||||
protected static final String INCLUDE_COUNT_PARAM = "count";
|
||||
protected static final String INCLUDE_PATH_PARAM = "path";
|
||||
protected static final String ROOT_CATEGORY_ID = "-root-";
|
||||
protected static final String CATEGORY_NAME_PREFIX = "CategoryName";
|
||||
protected static final String FIELD_NAME = "name";
|
||||
@@ -53,6 +54,7 @@ abstract class CategoriesRestTest extends RestTest
|
||||
protected static final String FIELD_PARENT_ID = "parentId";
|
||||
protected static final String FIELD_HAS_CHILDREN = "hasChildren";
|
||||
protected static final String FIELD_COUNT = "count";
|
||||
protected static final String FIELD_PATH = "path";
|
||||
|
||||
protected UserModel user;
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
package org.alfresco.rest.renditions;
|
||||
|
||||
import java.time.Duration;
|
||||
import com.google.common.base.Predicates;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.core.RestResponse;
|
||||
import org.alfresco.rest.model.RestNodeModel;
|
||||
@@ -8,6 +10,8 @@ import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.FolderModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.awaitility.Awaitility;
|
||||
import org.awaitility.Durations;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
@@ -68,15 +72,23 @@ public abstract class RenditionIntegrationTests extends RestTest
|
||||
*/
|
||||
protected RestNodeModel uploadFile(String sourceFile) throws Exception
|
||||
{
|
||||
FolderModel folder = FolderModel.getRandomFolderModel();
|
||||
folder = dataContent.usingUser(user).usingSite(site).createFolder(folder);
|
||||
FolderModel folder = Awaitility
|
||||
.await()
|
||||
.atMost(Duration.ofSeconds(30))
|
||||
.pollInterval(Durations.ONE_SECOND)
|
||||
.ignoreExceptions()
|
||||
.until(() -> {
|
||||
FolderModel randomFolderModel = FolderModel.getRandomFolderModel();
|
||||
return dataContent.usingUser(user).usingSite(site).createFolder(randomFolderModel);
|
||||
}, Predicates.notNull());
|
||||
restClient.authenticateUser(user).configureRequestSpec()
|
||||
.addMultiPart("filedata", Utility.getResourceTestDataFile(sourceFile));
|
||||
.addMultiPart("filedata", Utility.getResourceTestDataFile(sourceFile));
|
||||
RestNodeModel fileNode = restClient.authenticateUser(user).withCoreAPI().usingNode(folder).createNode();
|
||||
|
||||
Assert.assertEquals(Integer.valueOf(restClient.getStatusCode()).intValue(), HttpStatus.CREATED.value(),
|
||||
"Failed to created a node for rendition tests using file " + sourceFile);
|
||||
"Failed to created a node for rendition tests using file " + sourceFile);
|
||||
|
||||
return fileNode;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,5 +1,10 @@
|
||||
package org.alfresco.rest.tags;
|
||||
|
||||
import static org.alfresco.utility.data.RandomData.getRandomName;
|
||||
import static org.alfresco.utility.report.log.Step.STEP;
|
||||
import static org.springframework.http.HttpStatus.CREATED;
|
||||
import static org.springframework.http.HttpStatus.OK;
|
||||
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestTagModel;
|
||||
import org.alfresco.utility.constants.UserRole;
|
||||
@@ -14,9 +19,14 @@ import org.testng.annotations.Test;
|
||||
public class GetTagTests extends TagsDataPrep
|
||||
{
|
||||
|
||||
private static final String FIELD_ID = "id";
|
||||
private static final String FIELD_TAG = "tag";
|
||||
private static final String FIELD_COUNT = "count";
|
||||
private static final String TAG_NAME_PREFIX = "tag-name";
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION, description = "Verify admin user gets tag using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void adminIsAbleToGetTag() throws Exception
|
||||
public void adminIsAbleToGetTag()
|
||||
{
|
||||
RestTagModel returnedTag = restClient.authenticateUser(adminUserModel).withCoreAPI().getTag(documentTag);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
@@ -25,7 +35,7 @@ public class GetTagTests extends TagsDataPrep
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify user with Manager role gets tag using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
|
||||
public void userWithManagerRoleIsAbleToGetTag() throws Exception
|
||||
public void userWithManagerRoleIsAbleToGetTag()
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
|
||||
@@ -37,7 +47,7 @@ public class GetTagTests extends TagsDataPrep
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION, description = "Verify user with Collaborator role gets tag using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void userWithCollaboratorRoleIsAbleToGetTag() throws Exception
|
||||
public void userWithCollaboratorRoleIsAbleToGetTag()
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||
RestTagModel returnedTag = restClient.withCoreAPI().getTag(documentTag);
|
||||
@@ -47,7 +57,7 @@ public class GetTagTests extends TagsDataPrep
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION, description = "Verify user with Contributor role gets tag using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void userWithContributorRoleIsAbleToGetTag() throws Exception
|
||||
public void userWithContributorRoleIsAbleToGetTag()
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor));
|
||||
RestTagModel returnedTag = restClient.withCoreAPI().getTag(documentTag);
|
||||
@@ -57,7 +67,7 @@ public class GetTagTests extends TagsDataPrep
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION, description = "Verify user with Consumer role gets tag using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void userWithConsumerRoleIsAbleToGetTag() throws Exception
|
||||
public void userWithConsumerRoleIsAbleToGetTag()
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
|
||||
RestTagModel returnedTag = restClient.withCoreAPI().getTag(documentTag);
|
||||
@@ -68,7 +78,7 @@ public class GetTagTests extends TagsDataPrep
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify Manager user gets status code 401 if authentication call fails")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
|
||||
// @Bug(id="MNT-16904", description = "It fails only on environment with tenants")
|
||||
public void managerIsNotAbleToGetTagIfAuthenticationFails() throws Exception
|
||||
public void managerIsNotAbleToGetTagIfAuthenticationFails()
|
||||
{
|
||||
UserModel managerUser = dataUser.usingAdmin().createRandomTestUser();
|
||||
String managerPassword = managerUser.getPassword();
|
||||
@@ -82,7 +92,7 @@ public class GetTagTests extends TagsDataPrep
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that if tag id is invalid status code returned is 400")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void invalidTagIdTest() throws Exception
|
||||
public void invalidTagIdTest()
|
||||
{
|
||||
String tagId = documentTag.getId();
|
||||
documentTag.setId("random_tag_value");
|
||||
@@ -94,7 +104,7 @@ public class GetTagTests extends TagsDataPrep
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS },
|
||||
executionType = ExecutionType.REGRESSION, description = "Check that properties filter is applied when getting tag using Manager user.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void checkPropertiesFilterIsApplied() throws Exception
|
||||
public void checkPropertiesFilterIsApplied()
|
||||
{
|
||||
RestTagModel returnedTag = restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager))
|
||||
.withParams("properties=id,tag").withCoreAPI().getTag(documentTag);
|
||||
@@ -107,7 +117,7 @@ public class GetTagTests extends TagsDataPrep
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS },
|
||||
executionType = ExecutionType.REGRESSION, description = "Check that Manager user can get tag of a folder.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void getTagOfAFolder() throws Exception
|
||||
public void getTagOfAFolder()
|
||||
{
|
||||
RestTagModel returnedTag = restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager))
|
||||
.withCoreAPI().getTag(folderTag);
|
||||
@@ -118,7 +128,7 @@ public class GetTagTests extends TagsDataPrep
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS },
|
||||
executionType = ExecutionType.REGRESSION, description = "Check default error model schema. Use invalid skipCount parameter.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void checkDefaultErrorModelSchema() throws Exception
|
||||
public void checkDefaultErrorModelSchema()
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager))
|
||||
.withParams("skipCount=abc").withCoreAPI().getTag(documentTag);
|
||||
@@ -128,4 +138,44 @@ public class GetTagTests extends TagsDataPrep
|
||||
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that count field is not present for searched tag when not requested.
|
||||
*/
|
||||
@Test(groups = {TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION})
|
||||
public void testGetTag_notIncludingCount()
|
||||
{
|
||||
STEP("Create single tag as admin");
|
||||
String tagName = getRandomName(TAG_NAME_PREFIX).toLowerCase();
|
||||
final RestTagModel tagModel = createTagModelWithName(tagName);
|
||||
final RestTagModel createdTag = restClient.authenticateUser(adminUserModel).withCoreAPI().createSingleTag(tagModel);
|
||||
|
||||
restClient.assertStatusCodeIs(CREATED);
|
||||
|
||||
STEP("Get a single tag, not including count and verify if it is not present in the response");
|
||||
final RestTagModel searchedTag = restClient.withCoreAPI().getTag(createdTag);
|
||||
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
RestTagModel expected = RestTagModel.builder().id(createdTag.getId()).tag(tagName).create();
|
||||
searchedTag.assertThat().isEqualTo(expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that the count field can be included.
|
||||
*/
|
||||
@Test (groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTag_includeCount()
|
||||
{
|
||||
STEP("Create unused tag as admin");
|
||||
String tagName = getRandomName(TAG_NAME_PREFIX).toLowerCase();
|
||||
RestTagModel tagModel = createTagModelWithName(tagName);
|
||||
RestTagModel createdTag = restClient.authenticateUser(adminUserModel).withCoreAPI().createSingleTag(tagModel);
|
||||
|
||||
STEP("Get a single tag with the count field");
|
||||
RestTagModel searchedTag = restClient.withCoreAPI().include("count").getTag(createdTag);
|
||||
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
RestTagModel expected = RestTagModel.builder().id(createdTag.getId()).tag(tagName).count(0).create();
|
||||
searchedTag.assertThat().isEqualTo(expected);
|
||||
}
|
||||
}
|
||||
|
@@ -1,79 +1,219 @@
|
||||
package org.alfresco.rest.tags;
|
||||
|
||||
import static org.alfresco.utility.data.RandomData.getRandomName;
|
||||
import static org.alfresco.utility.report.log.Step.STEP;
|
||||
import static org.springframework.http.HttpStatus.BAD_REQUEST;
|
||||
import static org.springframework.http.HttpStatus.OK;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.rest.model.RestErrorModel;
|
||||
import org.alfresco.rest.model.RestTagModel;
|
||||
import org.alfresco.rest.model.RestTagModelsCollection;
|
||||
import org.alfresco.utility.constants.UserRole;
|
||||
import org.alfresco.utility.data.RandomData;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import static org.alfresco.utility.report.log.Step.STEP;
|
||||
|
||||
@Test(groups = {TestGroup.REQUIRE_SOLR})
|
||||
public class GetTagsTests extends TagsDataPrep
|
||||
{
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
init();
|
||||
}
|
||||
private static final String FIELD_ID = "id";
|
||||
private static final String FIELD_TAG = "tag";
|
||||
private static final String FIELD_COUNT = "count";
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Verify user with Manager role gets tags using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
|
||||
public void getTagsWithManagerRole() throws Exception
|
||||
public void getTagsWithManagerRole()
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
returnedCollection = restClient.withParams("maxItems=10000").withCoreAPI().getTags();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListContains("tag", documentTagValue.toLowerCase())
|
||||
.and().entriesListContains("tag", documentTagValue2.toLowerCase());
|
||||
.and().entriesListContains("tag", documentTagValue)
|
||||
.and().entriesListContains("tag", documentTagValue2);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION, description = "Verify user with Collaborator role gets tags using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void getTagsWithCollaboratorRole() throws Exception
|
||||
public void getTagsWithCollaboratorRole()
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||
returnedCollection = restClient.withParams("maxItems=10000").withCoreAPI().getTags();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListContains("tag", documentTagValue.toLowerCase())
|
||||
.and().entriesListContains("tag", documentTagValue2.toLowerCase());
|
||||
.and().entriesListContains("tag", documentTagValue)
|
||||
.and().entriesListContains("tag", documentTagValue2);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION, description = "Verify user with Contributor role gets tags using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void getTagsWithContributorRole() throws Exception
|
||||
public void getTagsWithContributorRole()
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor));
|
||||
returnedCollection = restClient.withParams("maxItems=10000").withCoreAPI().getTags();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListContains("tag", documentTagValue.toLowerCase())
|
||||
.and().entriesListContains("tag", documentTagValue2.toLowerCase());
|
||||
.and().entriesListContains("tag", documentTagValue)
|
||||
.and().entriesListContains("tag", documentTagValue2);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION, description = "Verify user with Consumer role gets tags using REST API and status code is OK (200)")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void getTagsWithConsumerRole() throws Exception
|
||||
public void getTagsWithConsumerRole()
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
|
||||
returnedCollection = restClient.withParams("maxItems=10000").withCoreAPI().getTags();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListContains("tag", documentTagValue.toLowerCase())
|
||||
.and().entriesListContains("tag", documentTagValue2.toLowerCase());
|
||||
.and().entriesListContains("tag", documentTagValue)
|
||||
.and().entriesListContains("tag", documentTagValue2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Include count in the query parameters and ensure count is as expected for returned tags.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_withIncludeCount()
|
||||
{
|
||||
STEP("Get tags including count filter and ensure count is as expected for returned tags");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("include=count")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
|
||||
returnedCollection.getEntries().stream()
|
||||
.filter(e -> e.onModel().getTag().equals(folderTagValue) || e.onModel().getTag().equals(documentTagValue))
|
||||
.forEach(e -> e.onModel().assertThat().field("count").is(2));
|
||||
|
||||
returnedCollection.getEntries().stream()
|
||||
.filter(e -> e.onModel().getTag().equals(documentTagValue2))
|
||||
.forEach(e -> e.onModel().assertThat().field("count").is(1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tags and order results by count. Default sort order should be ascending
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_withOrderByCountDefaultOrderShouldBeAsc()
|
||||
{
|
||||
STEP("Get tags and order results by count. Default sort order should be ascending");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("include=count&orderBy=count")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsSortedAscBy("count");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tags and order results by count in ascending order
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_withOrderByCountAsc()
|
||||
{
|
||||
STEP("Get tags and order results by count in ascending order");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("include=count&orderBy=count ASC")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsSortedAscBy("count");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tags and order results by count in descending order
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_withOrderByCountDesc()
|
||||
{
|
||||
STEP("Get tags and order results by count in descending order");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("include=count&orderBy=count DESC")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsSortedDescBy("count");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tags and order results by tag name. Default sort order should be ascending
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_withOrderByTagDefaultOrderShouldBeAsc()
|
||||
{
|
||||
STEP("Get tags and order results by tag name. Default sort order should be ascending");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("orderBy=tag")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsSortedAscBy("tag");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tags and order results by tag name in ascending order
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_withOrderByTagAsc()
|
||||
{
|
||||
STEP("Get tags and order results by tag name in ascending order");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("orderBy=tag ASC")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsSortedAscBy("tag");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tags and order results by tag name in descending order
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_withOrderByTagDesc()
|
||||
{
|
||||
STEP("Get tags and order results by tag name in descending order");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("orderBy=tag DESC")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsSortedDescBy("tag");
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that we get a 400 error when we request to order by count without also including the tag count.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_orderByCountWithoutIncludeCount()
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel)
|
||||
.withParams("orderBy=count")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(BAD_REQUEST);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.SANITY, description = "Failed authentication get tags call returns status code 401 with Manager role")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
|
||||
// @Bug(id="MNT-16904", description = "It fails only on environment with tenants")
|
||||
public void failedAuthenticationReturnsUnauthorizedStatus() throws Exception
|
||||
public void failedAuthenticationReturnsUnauthorizedStatus()
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
userModel = dataUser.createRandomTestUser();
|
||||
@@ -87,7 +227,7 @@ public class GetTagsTests extends TagsDataPrep
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that if maxItems is invalid status code returned is 400")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION})
|
||||
public void maxItemsInvalidValueTest() throws Exception
|
||||
public void maxItemsInvalidValueTest()
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel).withParams("maxItems=abc").withCoreAPI().getTags();
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError().containsSummary(String.format(RestErrorModel.INVALID_MAXITEMS, "abc"));
|
||||
@@ -96,7 +236,7 @@ public class GetTagsTests extends TagsDataPrep
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that if skipCount is invalid status code returned is 400")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION})
|
||||
public void skipCountInvalidValueTest() throws Exception
|
||||
public void skipCountInvalidValueTest()
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel).withParams("skipCount=abc").withCoreAPI().getTags();
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError().containsSummary(String.format(RestErrorModel.INVALID_SKIPCOUNT, "abc"));
|
||||
@@ -105,55 +245,55 @@ public class GetTagsTests extends TagsDataPrep
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that file tag is retrieved")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION})
|
||||
public void fileTagIsRetrieved() throws Exception
|
||||
public void fileTagIsRetrieved()
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
returnedCollection = restClient.withParams("maxItems=10000").withCoreAPI().getTags();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListContains("tag", documentTagValue.toLowerCase())
|
||||
.and().entriesListContains("tag", documentTagValue2.toLowerCase());
|
||||
.and().entriesListContains("tag", documentTagValue)
|
||||
.and().entriesListContains("tag", documentTagValue2);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify that folder tag is retrieved")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION})
|
||||
public void folderTagIsRetrieved() throws Exception
|
||||
public void folderTagIsRetrieved()
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
returnedCollection = restClient.withParams("maxItems=10000").withCoreAPI().getTags();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListContains("tag", folderTagValue.toLowerCase());
|
||||
.and().entriesListContains("tag", folderTagValue);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify site Manager is able to get tags using properties parameter."
|
||||
+ "Check that properties filter is applied.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void siteManagerIsAbleToRetrieveTagsWithPropertiesParameter() throws Exception
|
||||
public void siteManagerIsAbleToRetrieveTagsWithPropertiesParameter()
|
||||
{
|
||||
returnedCollection = restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager))
|
||||
.withParams("maxItems=5000&properties=tag").withCoreAPI().getTags();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListContains("tag", documentTagValue.toLowerCase())
|
||||
.and().entriesListContains("tag", documentTagValue2.toLowerCase())
|
||||
.and().entriesListContains("tag", documentTagValue)
|
||||
.and().entriesListContains("tag", documentTagValue2)
|
||||
.and().entriesListDoesNotContain("id");
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "With admin get tags and use skipCount parameter. Check pagination")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void useSkipCountCheckPagination() throws Exception
|
||||
public void useSkipCountCheckPagination()
|
||||
{
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel).withCoreAPI().getTags();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
|
||||
RestTagModel firstTag = returnedCollection.getEntries().get(0).onModel();
|
||||
RestTagModel secondTag = returnedCollection.getEntries().get(1).onModel();
|
||||
RestTagModelsCollection tagsWithSkipCount = restClient.withParams("skipCount=2").withCoreAPI().getTags();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
|
||||
tagsWithSkipCount.assertThat().entriesListDoesNotContain("tag", firstTag.getTag())
|
||||
.assertThat().entriesListDoesNotContain("tag", secondTag.getTag());
|
||||
@@ -163,15 +303,15 @@ public class GetTagsTests extends TagsDataPrep
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "With admin get tags and use maxItems parameter. Check pagination")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void useMaxItemsParameterCheckPagination() throws Exception
|
||||
public void useMaxItemsParameterCheckPagination()
|
||||
{
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel).withCoreAPI().getTags();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
|
||||
RestTagModel firstTag = returnedCollection.getEntries().get(0).onModel();
|
||||
RestTagModel secondTag = returnedCollection.getEntries().get(1).onModel();
|
||||
RestTagModelsCollection tagsWithMaxItems = restClient.withParams("maxItems=2").withCoreAPI().getTags();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
|
||||
tagsWithMaxItems.assertThat().entriesListContains("tag", firstTag.getTag())
|
||||
.assertThat().entriesListContains("tag", secondTag.getTag())
|
||||
@@ -182,23 +322,22 @@ public class GetTagsTests extends TagsDataPrep
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "With manager get tags and use high skipCount parameter. Check pagination")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void useHighSkipCountCheckPagination() throws Exception
|
||||
public void useHighSkipCountCheckPagination()
|
||||
{
|
||||
returnedCollection = restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager))
|
||||
.withParams("skipCount=20000").withCoreAPI().getTags();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
returnedCollection.assertThat().entriesListIsEmpty()
|
||||
.getPagination().assertThat().field("maxItems").is(100)
|
||||
.and().field("hasMoreItems").is("false")
|
||||
.and().field("count").is("0")
|
||||
.and().field("skipCount").is(20000)
|
||||
.and().field("totalItems").isNull();
|
||||
.and().field("skipCount").is(20000);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "With Collaborator user get tags and use maxItems with value zero. Check default error model schema")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void useMaxItemsWithValueZeroCheckDefaultErrorModelSchema() throws Exception
|
||||
public void useMaxItemsWithValueZeroCheckDefaultErrorModelSchema()
|
||||
{
|
||||
returnedCollection = restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator))
|
||||
.withParams("maxItems=0").withCoreAPI().getTags();
|
||||
@@ -212,18 +351,167 @@ public class GetTagsTests extends TagsDataPrep
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION,
|
||||
description = "With Manager user delete tag. Check it is not retrieved anymore.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void checkThatDeletedTagIsNotRetrievedAnymore() throws Exception
|
||||
public void checkThatDeletedTagIsNotRetrievedAnymore()
|
||||
{
|
||||
String removedTag = RandomData.getRandomName("tag3");
|
||||
String removedTag = getRandomName("tag3");
|
||||
|
||||
RestTagModel deletedTag = restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager))
|
||||
.withCoreAPI().usingResource(document).addTag(removedTag);
|
||||
|
||||
restClient.withCoreAPI().usingResource(document).deleteTag(deletedTag);
|
||||
restClient.authenticateUser(adminUserModel).withCoreAPI().usingTag(deletedTag).deleteTag();
|
||||
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
|
||||
returnedCollection = restClient.withParams("maxItems=10000").withCoreAPI().getTags();
|
||||
returnedCollection.assertThat().entriesListIsNotEmpty()
|
||||
.and().entriesListDoesNotContain("tag", removedTag.toLowerCase());
|
||||
.and().entriesListDoesNotContain("tag", removedTag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if exact name filter can be applied.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_withSingleNameFilter()
|
||||
{
|
||||
STEP("Get tags with names filter using EQUALS and expect one item in result");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("where=(tag='" + documentTag.getTag() + "')")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
returnedCollection.assertThat()
|
||||
.entrySetMatches("tag", Set.of(documentTagValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if multiple names can be applied as a filter.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_withTwoNameFilters()
|
||||
{
|
||||
STEP("Get tags with names filter using IN and expect two items in result");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("where=(tag IN ('" + documentTag.getTag() + "', '" + folderTag.getTag() + "'))")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
returnedCollection.assertThat()
|
||||
.entrySetMatches("tag", Set.of(documentTagValue, folderTagValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if alike name filter can be applied.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_whichNamesStartsWithOrphan()
|
||||
{
|
||||
STEP("Get tags with names filter using MATCHES and expect one item in result");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("where=(tag MATCHES ('orphan*'))", "maxItems=10000")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
returnedCollection.assertThat()
|
||||
.entrySetContains("tag", orphanTag.getTag());
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that tags can be filtered by exact name and alike name at the same time.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_withExactNameAndAlikeFilters()
|
||||
{
|
||||
STEP("Get tags with names filter using EQUALS and MATCHES and expect four items in result");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("where=(tag MATCHES ('*tag*'))", "maxItems=10000")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
returnedCollection.assertThat()
|
||||
.entrySetContains("tag", documentTagValue, documentTagValue2, folderTagValue, orphanTag.getTag());
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if multiple alike filters can be applied.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_withTwoAlikeFilters()
|
||||
{
|
||||
STEP("Get tags applying names filter using MATCHES twice and expect four items in result");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("where=(tag MATCHES ('orphan*') OR tag MATCHES ('tag*'))", "maxItems=10000")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
returnedCollection.assertThat()
|
||||
.entrySetContains("tag", documentTagValue, documentTagValue2, folderTagValue, orphanTag.getTag());
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that providing incorrect field name in where query will result with 400 (Bad Request).
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_withWrongWherePropertyNameAndExpect400()
|
||||
{
|
||||
STEP("Try to get tags with names filter using EQUALS and wrong property name and expect 400");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("where=(name=gat)")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
||||
.assertLastError().containsSummary("Where query error: property with name: name is not expected");
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify tht AND operator is not supported in where query and expect 400 (Bad Request).
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
|
||||
public void testGetTags_queryAndOperatorNotSupported()
|
||||
{
|
||||
STEP("Try to get tags applying names filter using AND operator and expect 400");
|
||||
returnedCollection = restClient.authenticateUser(adminUserModel)
|
||||
.withParams("where=(name=tag AND name IN ('tag-', 'gat'))")
|
||||
.withCoreAPI()
|
||||
.getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
|
||||
.assertLastError().containsSummary("An invalid WHERE query was received. Unsupported Predicate");
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if count field is present for searched tags.
|
||||
*/
|
||||
@Test(groups = {TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION})
|
||||
public void testGetTags_includingCount()
|
||||
{
|
||||
STEP("Get tags including count and verify if it is present in the response");
|
||||
final RestTagModelsCollection searchedTags = restClient.withCoreAPI().include(FIELD_COUNT).getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
searchedTags.assertThat().entriesListIsNotEmpty()
|
||||
.assertThat().entriesListContains(FIELD_COUNT)
|
||||
.assertThat().entriesListContains(FIELD_TAG)
|
||||
.assertThat().entriesListContains(FIELD_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if count field is not present for searched tags.
|
||||
*/
|
||||
@Test(groups = {TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION})
|
||||
public void testGetTags_notIncludingCount()
|
||||
{
|
||||
STEP("Get tags, not including count and verify if it is not in the response");
|
||||
final RestTagModelsCollection searchedTags = restClient.withCoreAPI().getTags();
|
||||
|
||||
restClient.assertStatusCodeIs(OK);
|
||||
searchedTags.assertThat().entriesListIsNotEmpty()
|
||||
.assertThat().entriesListDoesNotContain(FIELD_COUNT)
|
||||
.assertThat().entriesListContains(FIELD_TAG)
|
||||
.assertThat().entriesListContains(FIELD_ID);
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user