diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..94ddb90 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,31 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..0280335 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,33 @@ +name: Build + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Build and test + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + SONAR_TOKEN: ${{secrets.SONAR_TOKEN}} + run: ./mvnw -B clean verify sonar:sonar -Dsonar.login=${{ secrets.SONAR_TOKEN }} + - run: mkdir staging && cp target/*.zip staging + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: Connectors + path: staging diff --git a/.github/workflows/commit-message-check.yml b/.github/workflows/commit-message-check.yml new file mode 100644 index 0000000..148fd99 --- /dev/null +++ b/.github/workflows/commit-message-check.yml @@ -0,0 +1,19 @@ +name: 'Commit Message Check' +on: + pull_request: + types: + - opened + - edited + - reopened + - synchronize +jobs: + check-commit-message: + name: Check Commit Message + runs-on: ubuntu-latest + steps: + - name: Check Commit Type + uses: gsactions/commit-message-checker@v1 + with: + pattern: '^\S+\((.+)\):\s(.+)$' + flags: 'gm' + error: 'Your first line has to matches the following pattern: type(category): description [flags], where flags is an optional coma separated list. Check the contributing guidlines for more details.' diff --git a/.github/workflows/createRelease.yml b/.github/workflows/createRelease.yml new file mode 100644 index 0000000..9b64e38 --- /dev/null +++ b/.github/workflows/createRelease.yml @@ -0,0 +1,59 @@ +name: Create release + +on: + push: + branches: + - release-* + +jobs: + build: + name: Release pipeline + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Extract version + shell: bash + run: echo "##[set-output name=version;]$(echo ${GITHUB_REF#refs/heads/} | sed 's/release-//g')" + id: extract_version + + - name: changelog + uses: scottbrenner/generate-changelog-action@master + id: Changelog + env: + REPO: ${{ github.repository }} + + - name: Create Release + id: create_release + uses: actions/create-release@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ steps.extract_version.outputs.version }} + release_name: Release ${{ steps.extract_version.outputs.version }} + body: | + ${{ steps.Changelog.outputs.changelog }} + draft: false + prerelease: false + + - name: Build Release + run: ./mvnw -B verify + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: target/bonita-connector-uipath-${{ steps.extract_version.outputs.version }}-all.zip + asset_name: bonita-connector-uipath-${{ steps.extract_version.outputs.version }}-all.zip + asset_content_type: application/zip \ No newline at end of file diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index 42fa4da..d6f02e6 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -1 +1 @@ -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip \ No newline at end of file +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..f3f7f70 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,42 @@ +## Contributing + +We are pleased to receive any kind of contribution (issues, pull requests, suggestions ...). + +#### Commit message format + +Here is the expected commit format, please respect it, we rely on it to [automatically generate the changelog](https://github.com/lob/generate-changelog#usage): + +``` +type(category): description [flags] + +< commit description > +``` + +Where `type` is one of the following: + +- `breaking` +- `build` +- `ci` +- `chore` +- `docs` +- `feat` +- `fix` +- `other` +- `perf` +- `refactor` +- `revert` +- `style` +- `test` + +Where `flags` is an optional comma-separated list of one or more of the following (must be surrounded in square brackets): + +- `breaking`: alters `type` to be a breaking change + +And `category` can be anything of your choice. If you use a type not found in the list (but it still follows the same format of the message), it'll be grouped under `other`. + +#### Tests + +Ensure that your contribution is correctly tested: + + - Any update on the generated project must be tested through the generated unit tests + - Any update on the archetype must be tested through the integration test suite (*src/test/resources/projects*) diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 2f55d34..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,22 +0,0 @@ -timestamps { - ansiColor('xterm') { - node { - stage('Setup') { - checkout scm - } - - stage('Build') { - try { - if(env.BRANCH_NAME.equals('master')){ - sh "./mvnw -B clean deploy -DaltDeploymentRepository=${env.ALT_DEPLOYMENT_REPOSITORY_SNAPSHOTS} -Djvm=${env.JAVA_HOME_11}/bin/java" - }else{ - sh "./mvnw -B clean verify -Djvm=${env.JAVA_HOME_11}/bin/java" - } - archiveArtifacts 'target/bonita-connector-uipath-*.zip' - } finally { - junit '**/target/surefire-reports/*.xml' - } - } - } - } -} diff --git a/README.MD b/README.MD deleted file mode 100644 index 5b4cde2..0000000 --- a/README.MD +++ /dev/null @@ -1,15 +0,0 @@ -# UiPath Connector - -## Build - -__Clone__ or __fork__ this repository, then at the root of the project run: - -`./mvnw clean verify` - -## Release - -Before releasing a new version make sure that the versionning of `.def` files are consistent with the implementation. In order to create a new release of the connector use the [_maven release plugin_](http://maven.apache.org/maven-release/maven-release-plugin/): - -`./mvnw release:prepare` - -It creates a new git _tag_ and update the current development version. New tags are automatically built on our CI infrastructure. diff --git a/README.md b/README.md new file mode 100644 index 0000000..3ebda53 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# UIPath Connector + +![](https://github.com/bonitasoft/bonita-connector-uipath/workflows/Build/badge.svg) +[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=bonitasoft_bonita-connector-uipath&metric=alert_status)](https://sonarcloud.io/dashboard?id=bonitasoft_bonita-connector-uipath) +[![GitHub version](https://badge.fury.io/gh/bonitasoft%2Fbonita-connector-uipath.svg)](https://badge.fury.io/gh/bonitasoft%2Fbonita-connector-uipath) + +## Build + +__Clone__ or __fork__ this repository, then at the root of the project run: + +`./mvnw` + +## Release + +In order to create a new release push a `release-` branch with the desired version in pom.xml. +Update the `master` with the next SNAPSHOT version. + +## Contributing + +We would love you to contribute, pull requests are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for more information. + +## License + +The sources and documentation in this project are released under the [GPLv2 License](LICENSE) + diff --git a/connector-assembly.xml b/connector-assembly.xml deleted file mode 100644 index 48c00f4..0000000 --- a/connector-assembly.xml +++ /dev/null @@ -1,41 +0,0 @@ - - all - - zip - - false - - - / - target/classes - - *.* - /classpath - - - - /classpath - ${basedir}/target - - *-sources.jar - - - - /classpath - ${basedir}/target - - *:jar - - - - - - false - runtime - /classpath - - - \ No newline at end of file diff --git a/infrastructure/release.groovy b/infrastructure/release.groovy deleted file mode 100644 index 048475e..0000000 --- a/infrastructure/release.groovy +++ /dev/null @@ -1,18 +0,0 @@ -timestamps { - node { - stage('Setup') { - checkout scm - } - - stage('Release') { - withCredentials([usernamePassword( - credentialsId: 'github', - passwordVariable: 'GIT_PASSWORD', - usernameVariable: 'GIT_USERNAME')]) { - sh """ - ./mvnw -B release:prepare release:perform -Darguments="-DaltDeploymentRepository=${env.ALT_DEPLOYMENT_REPOSITORY_TAG} -Djvm=${env.JAVA_HOME_11}/bin/java" - """ - } - } - } -} diff --git a/package.json b/package.json new file mode 100644 index 0000000..8be61a8 --- /dev/null +++ b/package.json @@ -0,0 +1,4 @@ +{ + "name": "bonita-connector-uipath", + "version": "1.0.0" +} diff --git a/pom.xml b/pom.xml index aed8909..91b95a5 100644 --- a/pom.xml +++ b/pom.xml @@ -1,185 +1,288 @@ - - 4.0.0 - - - bonita-connectors - org.bonitasoft.connectors - 1.0.0 - - - bonita-connector-uipath - 2.0.1-SNAPSHOT - - - 7.7.0 - - - - - bonita-common - org.bonitasoft.engine - ${bonita.engine.version} - provided - - - com.squareup.retrofit2 - retrofit - 2.4.0 - - - com.squareup.retrofit2 - converter-jackson - 2.4.0 - - - com.fasterxml.jackson.core - jackson-databind - - - - - com.squareup.okhttp3 - logging-interceptor - 3.11.0 - - - org.projectlombok - lombok - 1.18.2 - provided - - - junit - junit - test - - - com.github.tomakehurst - wiremock - 2.18.0 - test - - - com.fasterxml.jackson.core - jackson-databind - - - - - org.assertj - assertj-core - 3.11.1 - test - - - org.mockito - mockito-all - 1.9.5 - test - - - com.github.tomakehurst - wiremock - 1.50 - standalone - test - - - - - - - - - org.apache.maven.plugins - maven-release-plugin - 2.5.3 - - @{project.version} - - - - maven-assembly-plugin - 2.5 - - - assemble - none - - - - - - - - - org.apache.maven.plugins - maven-release-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - 1.8 - 1.8 - - - - maven-assembly-plugin - - - all - package - - single - - - ${basedir}/connector-assembly.xml - true - - - - start-job - package - - single - - - ${basedir}/startjob-assembly.xml - - - - get-job - package - - single - - - ${basedir}/getjob-assembly.xml - - - - add-queueItem-job - package - - single - - - ${basedir}/add-queueItem-assembly.xml - - - - - - - - - - scm:git:https://${env.GIT_USERNAME}:${env.GIT_PASSWORD}@github.com/bonitasoft/bonita-connector-uipath.git - scm:git:https://${env.GIT_USERNAME}:${env.GIT_PASSWORD}@github.com/bonitasoft/bonita-connector-uipath.git - https://github.com/bonitasoft/bonita-connector-uipath - HEAD - + + 4.0.0 + + org.bonitasoft.connectors + bonita-connector-uipath + 2.0.1-SNAPSHOT + + + + 1.8 + UTF-8 + UTF-8 + yyyy.MM.dd-hh.mm + + + uipath-add-queueItem + 2.0.0 + ${uipath-add-queueItem.def.id}-impl + ${project.version} + org.bonitasoft.engine.connector.uipath.UIPathAddToQueueConnector + + + uipath-getjob + 2.0.0 + ${uipath-getjob.def.id}-impl + ${project.version} + org.bonitasoft.engine.connector.uipath.UIPathGetJobConnector + + + uipath-startjob + 2.0.0 + ${uipath-startjob.def.id}-impl + ${project.version} + org.bonitasoft.engine.connector.uipath.UIPathStartJobsConnector + + ${project.artifactId} + 1.0 + ${definition-id}-impl + ${project.version} + org.bonitasoft.actorfilter.UsersListFilter + 2.4.0 + 3.11.0 + 1.18.2 + + + 7.7.0 + + + 5.6.2 + 1.6.2 + 2.26.3 + 3.16.1 + 3.3.3 + 1.2.3 + 0.8.5 + 3.7.0.1746 + + + 3.8.1 + ${java.version} + ${java.version} + 3.1.1 + 2.1.1 + 2.4.16 + 3.0.0-M4 + + + bonitasoft_bonita-connector-uipath + bonitasoft + https://sonarcloud.io + + + + + + bonita-common + org.bonitasoft.engine + ${bonita.engine.version} + provided + + + + + com.squareup.retrofit2 + retrofit + ${retrofit.version} + + + com.squareup.retrofit2 + converter-jackson + ${retrofit.version} + + + com.fasterxml.jackson.core + jackson-databind + + + + + com.squareup.okhttp3 + logging-interceptor + ${logging-interceptor.version} + + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-jupiter-engine.version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.assertj + assertj-core + ${assertj-core.version} + test + + + org.mockito + mockito-junit-jupiter + ${mockito-core.version} + test + + + ch.qos.logback + logback-classic + ${logback-classic.version} + test + + + com.github.tomakehurst + wiremock + ${wiremock.version} + test + + + com.fasterxml.jackson.core + jackson-databind + + + + + + + + verify + + + src/main/resources-filtered + true + + + src/main/resources + false + + + + + + maven-assembly-plugin + ${maven-assembly-plugin.version} + + ${project.basedir}/src/assembly + + + + package-connectors + package + + single + + + true + + + + + + org.codehaus.gmaven + groovy-maven-plugin + ${groovy-maven-plugin.version} + + + org.codehaus.groovy + groovy-all + ${groovy-all.version} + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + true + 1 + true + + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + + + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + true + + + + prepare-agent + + prepare-agent + + + + prepare-agent-integration + + prepare-agent-integration + + + + jacoco-site + verify + + report + + + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${sonar-maven-plugin.version} + + + + + + + org.codehaus.gmaven + groovy-maven-plugin + + + generate-resources + + execute + + + ${project.basedir}/src/script/dependencies-as-var.groovy + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + org.jacoco + jacoco-maven-plugin + + + + diff --git a/add-queueItem-assembly.xml b/src/assembly/add-queueItem-assembly.xml similarity index 81% rename from add-queueItem-assembly.xml rename to src/assembly/add-queueItem-assembly.xml index 6260178..873cbad 100644 --- a/add-queueItem-assembly.xml +++ b/src/assembly/add-queueItem-assembly.xml @@ -9,22 +9,22 @@ false - / + target/classes uipath-add-queueItem.impl - /classpath + classpath - /classpath + classpath ${basedir}/target *-sources.jar - /classpath + classpath ${basedir}/target *:jar @@ -35,7 +35,7 @@ false runtime - /classpath + classpath \ No newline at end of file diff --git a/src/assembly/all-assembly.xml b/src/assembly/all-assembly.xml new file mode 100644 index 0000000..9eb64a6 --- /dev/null +++ b/src/assembly/all-assembly.xml @@ -0,0 +1,35 @@ + + all + + + zip + + false + + + + target/classes + + + *.* + + + + classpath + ${basedir}/target + + *:jar + + + + + + false + runtime + classpath + + + \ No newline at end of file diff --git a/getjob-assembly.xml b/src/assembly/getjob-assembly.xml similarity index 81% rename from getjob-assembly.xml rename to src/assembly/getjob-assembly.xml index af88c11..b46e0ed 100644 --- a/getjob-assembly.xml +++ b/src/assembly/getjob-assembly.xml @@ -9,22 +9,22 @@ false - / + target/classes uipath-getjob.impl - /classpath + classpath - /classpath + classpath ${basedir}/target *-sources.jar - /classpath + classpath ${basedir}/target *:jar @@ -35,7 +35,7 @@ false runtime - /classpath + classpath \ No newline at end of file diff --git a/startjob-assembly.xml b/src/assembly/startjob-assembly.xml similarity index 81% rename from startjob-assembly.xml rename to src/assembly/startjob-assembly.xml index fd71d2d..c098ffe 100644 --- a/startjob-assembly.xml +++ b/src/assembly/startjob-assembly.xml @@ -9,22 +9,22 @@ false - / + target/classes uipath-startjob.impl - /classpath + classpath - /classpath + classpath ${basedir}/target *-sources.jar - /classpath + classpath ${basedir}/target *:jar @@ -35,7 +35,7 @@ false runtime - /classpath + classpath \ No newline at end of file diff --git a/src/main/resources/uipath-add-queueItem.def b/src/main/resources-filtered/uipath-add-queueItem.def similarity index 96% rename from src/main/resources/uipath-add-queueItem.def rename to src/main/resources-filtered/uipath-add-queueItem.def index 2ece1dc..2e54077 100644 --- a/src/main/resources/uipath-add-queueItem.def +++ b/src/main/resources-filtered/uipath-add-queueItem.def @@ -1,7 +1,7 @@ - uipath-add-queueItem - 2.0.0 + ${uipath-add-queueItem.def.id} + ${uipath-add-queueItem.def.version} uipath.png diff --git a/src/main/resources-filtered/uipath-add-queueItem.impl b/src/main/resources-filtered/uipath-add-queueItem.impl new file mode 100644 index 0000000..80deb20 --- /dev/null +++ b/src/main/resources-filtered/uipath-add-queueItem.impl @@ -0,0 +1,14 @@ + + + ${uipath-add-queueItem.impl.id} + ${uipath-add-queueItem.impl.version} + ${uipath-add-queueItem.def.id} + ${uipath-add-queueItem.def.version} + ${uipath-add-queueItem.main-class} + false + The implementation of the add to queue UiPath Connector. + + +${connector-dependencies} + + diff --git a/src/main/resources/uipath-getjob.def b/src/main/resources-filtered/uipath-getjob.def similarity index 94% rename from src/main/resources/uipath-getjob.def rename to src/main/resources-filtered/uipath-getjob.def index ae7561b..7c18c93 100644 --- a/src/main/resources/uipath-getjob.def +++ b/src/main/resources-filtered/uipath-getjob.def @@ -1,7 +1,7 @@ - uipath-getjob - 2.0.0 + ${uipath-getjob.def.id} + ${uipath-getjob.def.version} uipath.png diff --git a/src/main/resources-filtered/uipath-getjob.impl b/src/main/resources-filtered/uipath-getjob.impl new file mode 100644 index 0000000..da8fa34 --- /dev/null +++ b/src/main/resources-filtered/uipath-getjob.impl @@ -0,0 +1,14 @@ + + + ${uipath-getjob.impl.id} + ${uipath-getjob.impl.version} + ${uipath-getjob.def.id} + ${uipath-getjob.def.version} + ${uipath-getjob.main-class} + false + The implementation of the get job UiPath Connector. + + +${connector-dependencies} + + diff --git a/src/main/resources/uipath-startjob.def b/src/main/resources-filtered/uipath-startjob.def similarity index 96% rename from src/main/resources/uipath-startjob.def rename to src/main/resources-filtered/uipath-startjob.def index 0885dcd..d9c5361 100644 --- a/src/main/resources/uipath-startjob.def +++ b/src/main/resources-filtered/uipath-startjob.def @@ -1,7 +1,7 @@ - uipath-startjob - 2.0.0 + ${uipath-startjob.def.id} + ${uipath-startjob.def.version} uipath.png diff --git a/src/main/resources-filtered/uipath-startjob.impl b/src/main/resources-filtered/uipath-startjob.impl new file mode 100644 index 0000000..c584f51 --- /dev/null +++ b/src/main/resources-filtered/uipath-startjob.impl @@ -0,0 +1,14 @@ + + + ${uipath-startjob.impl.id} + ${uipath-startjob.impl.version} + ${uipath-startjob.def.id} + ${uipath-startjob.def.version} + ${uipath-startjob.main-class} + false + The implementation of the start jobs UiPath Connector. + + +${connector-dependencies} + + diff --git a/src/main/resources/uipath-add-queueItem.impl b/src/main/resources/uipath-add-queueItem.impl deleted file mode 100644 index 0ce4011..0000000 --- a/src/main/resources/uipath-add-queueItem.impl +++ /dev/null @@ -1,13 +0,0 @@ - - - uipath-add-queueItem-impl - $implementation.version$ - uipath-add-queueItem - 2.0.0 - org.bonitasoft.engine.connector.uipath.UIPathAddToQueueConnector - false - The implementation of the add to queue UiPath Connector. - -$Dependencies$ - - diff --git a/src/main/resources/uipath-getjob.impl b/src/main/resources/uipath-getjob.impl deleted file mode 100644 index 35c9880..0000000 --- a/src/main/resources/uipath-getjob.impl +++ /dev/null @@ -1,13 +0,0 @@ - - - uipath-getjob-impl - $implementation.version$ - uipath-getjob - 2.0.0 - org.bonitasoft.engine.connector.uipath.UIPathGetJobConnector - false - The implementation of the get job UiPath Connector. - -$Dependencies$ - - diff --git a/src/main/resources/uipath-startjob.impl b/src/main/resources/uipath-startjob.impl deleted file mode 100644 index dfbfab9..0000000 --- a/src/main/resources/uipath-startjob.impl +++ /dev/null @@ -1,13 +0,0 @@ - - - uipath-startjob-impl - $implementation.version$ - uipath-startjob - 2.0.0 - org.bonitasoft.engine.connector.uipath.UIPathStartJobsConnector - false - The implementation of the start jobs UiPath Connector. - -$Dependencies$ - - diff --git a/src/script/dependencies-as-var.groovy b/src/script/dependencies-as-var.groovy new file mode 100644 index 0000000..5b08e4b --- /dev/null +++ b/src/script/dependencies-as-var.groovy @@ -0,0 +1,15 @@ +import groovy.xml.MarkupBuilder + +def xml = new StringWriter() +def builder = new MarkupBuilder(xml) +builder.jarDependencies { + jarDependency("${project.artifactId}-${project.version}.${project.packaging}") + project.artifacts + .findAll { artifact -> artifact.scope == "compile" || artifact.scope == "runtime" } + .sort { artifact -> artifact.artifactId } + .each { artifact -> + jarDependency("${artifact.artifactId}-${artifact.version}.${artifact.type}") + } +} +def deps = xml.toString() +project.properties.setProperty("connector-dependencies", deps) \ No newline at end of file diff --git a/src/test/java/org/bonitasoft/engine/connector/uipath/UIPathConnectorTest.java b/src/test/java/org/bonitasoft/engine/connector/uipath/UIPathConnectorTest.java index fc17d73..ddb7629 100644 --- a/src/test/java/org/bonitasoft/engine/connector/uipath/UIPathConnectorTest.java +++ b/src/test/java/org/bonitasoft/engine/connector/uipath/UIPathConnectorTest.java @@ -7,7 +7,7 @@ import org.bonitasoft.engine.connector.ConnectorException; import org.bonitasoft.engine.connector.ConnectorValidationException; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class UIPathConnectorTest { diff --git a/src/test/java/org/bonitasoft/engine/connector/uipath/UIPathGetJobConnectorTest.java b/src/test/java/org/bonitasoft/engine/connector/uipath/UIPathGetJobConnectorTest.java index 8b5ccc9..dd42b7f 100644 --- a/src/test/java/org/bonitasoft/engine/connector/uipath/UIPathGetJobConnectorTest.java +++ b/src/test/java/org/bonitasoft/engine/connector/uipath/UIPathGetJobConnectorTest.java @@ -21,24 +21,30 @@ import java.util.Map; import org.bonitasoft.engine.connector.uipath.model.JobState; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import com.github.tomakehurst.wiremock.client.WireMock; import com.github.tomakehurst.wiremock.junit.WireMockRule; public class UIPathGetJobConnectorTest { - @Rule - public ExpectedException expectedException = ExpectedException.none(); + private static WireMockRule uiPathService; - @ClassRule - public static WireMockRule uiPathService = new WireMockRule(8888); + @BeforeAll + public static void startMockServer() { + uiPathService = new WireMockRule(8888); + uiPathService.start(); + } + + @AfterAll + public static void stopMockServer() { + uiPathService.stop(); + } - @Before + @BeforeEach public void configureStubs() throws Exception { uiPathService.stubFor(WireMock.post(WireMock.urlEqualTo("/api/account/authenticate")) .willReturn(WireMock.aResponse() diff --git a/src/test/java/org/bonitasoft/engine/connector/uipath/UIPathStartJobsConnectorTest.java b/src/test/java/org/bonitasoft/engine/connector/uipath/UIPathStartJobsConnectorTest.java index 544eded..7e032dc 100644 --- a/src/test/java/org/bonitasoft/engine/connector/uipath/UIPathStartJobsConnectorTest.java +++ b/src/test/java/org/bonitasoft/engine/connector/uipath/UIPathStartJobsConnectorTest.java @@ -24,29 +24,33 @@ import org.bonitasoft.engine.connector.ConnectorValidationException; import org.bonitasoft.engine.connector.uipath.model.Release; import org.bonitasoft.engine.connector.uipath.model.Robot; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; +import org.junit.Assert; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import com.github.tomakehurst.wiremock.client.WireMock; import com.github.tomakehurst.wiremock.junit.WireMockRule; import lombok.Data; -@RunWith(MockitoJUnitRunner.class) public class UIPathStartJobsConnectorTest { - @Rule - public ExpectedException expectedException = ExpectedException.none(); - - @ClassRule - public static WireMockRule uiPathService = new WireMockRule(8888); + public static WireMockRule uiPathService; + + @BeforeAll + public static void startMockServer() { + uiPathService = new WireMockRule(8888); + uiPathService.start(); + } + + @AfterAll + public static void stopMockServer() { + uiPathService.stop(); + } - @Before + @BeforeEach public void configureStubs() throws Exception { uiPathService.stubFor(WireMock.post(WireMock.urlEqualTo("/api/account/authenticate")) .willReturn(WireMock.aResponse() @@ -108,10 +112,10 @@ public void should_start_jobs() throws Exception { UIPathConnector uiPathConnector = createConnector(); uiPathConnector.connect(); Map outputs = uiPathConnector.execute(); - List startedJobs = (List) outputs.get("startedJobs"); - - assertThat(startedJobs).hasSize(1); - String job = startedJobs.get(0); + Object startedJobs = outputs.get("startedJobs"); + assertThat(startedJobs).isInstanceOf(List.class); + assertThat((List)startedJobs).hasSize(1); + String job = (String) ((List) startedJobs).get(0); assertThat(job).contains("54"); } @@ -125,11 +129,10 @@ public void should_throw_a_ConnectorValidationException_if_input_arguments_has_n inputArgs.put(1, "value2"); inputs.put(UIPathStartJobsConnector.INPUT_ARGS, inputArgs); uiPathConnector.setInputParameters(inputs); - - expectedException.expect(ConnectorValidationException.class); - expectedException.expectMessage("Only String keys are allowed in job input arguments. Found [1]."); - - uiPathConnector.checkArgsInput(); + + Assert.assertThrows("Only String keys are allowed in job input arguments. Found [1].", + ConnectorValidationException.class, + () -> uiPathConnector.checkArgsInput()); }