From ce47b25fd858379eb0d22e2ab1cebdeb9d137cd2 Mon Sep 17 00:00:00 2001 From: "Damian.Ujma@hyland.com" Date: Mon, 5 Dec 2022 09:31:23 +0100 Subject: [PATCH] ACS-3841 Test AlphabeticallyPriorityInterceptor [ags] --- .travis.yml | 1 + .../AlphabeticallyPriorityInterceptor.java | 20 +++++++++++++++++++ .../src/test/resources/testng.xml | 12 ++++------- 3 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 amps/ags/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/utils/AlphabeticallyPriorityInterceptor.java diff --git a/.travis.yml b/.travis.yml index 482f323820..618d27987d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -385,6 +385,7 @@ jobs: - name: "AGS Community Rest API Tests" if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip ags\]/) OR commit_message =~ /\[ags\]/ + runs-on: ubuntu-18.04 install: travis_retry travis_wait 40 env REQUIRES_LOCAL_IMAGES=true bash scripts/travis/build.sh addons: artifacts: diff --git a/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/utils/AlphabeticallyPriorityInterceptor.java b/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/utils/AlphabeticallyPriorityInterceptor.java new file mode 100644 index 0000000000..375c835be8 --- /dev/null +++ b/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/utils/AlphabeticallyPriorityInterceptor.java @@ -0,0 +1,20 @@ +package org.alfresco.rest.rm.community.utils; + +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; + +import org.testng.IMethodInstance; +import org.testng.IMethodInterceptor; +import org.testng.ITestContext; + +public class AlphabeticallyPriorityInterceptor implements IMethodInterceptor +{ + @Override + public List intercept(List methods, + ITestContext context) + { + return methods.stream().sorted(Comparator.comparing(el -> el.getMethod().getTestClass().toString())) + .collect(Collectors.toList()); + } +} \ No newline at end of file diff --git a/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/resources/testng.xml b/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/resources/testng.xml index 1fbf832fe7..c5cec17c3f 100644 --- a/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/resources/testng.xml +++ b/amps/ags/rm-automation/rm-automation-community-rest-api/src/test/resources/testng.xml @@ -1,16 +1,12 @@ - - - - - + + + - - - +