From 18c94ca4ab40a08e058b52605064dfe992508919 Mon Sep 17 00:00:00 2001 From: bonita-ci <4921474+bonita-ci@users.noreply.github.com> Date: Tue, 18 Feb 2025 09:38:27 +0000 Subject: [PATCH 1/2] feat(openapi): update version to 1.0.2 * Remove deleted API files * Use Maintenance API to enable maintenance mode instead of pausing tenant * Remove unsupported runtime versions from tests * Update version in README to 9.0 * Update test versions in github action * fix version compare in IT test Covers [BPM-418](https://bonitasoft.atlassian.net/browse/BPM-418) --- .github/workflows/_reusable_build.yml | 9 +- .openapi-generator-ignore | 2 +- .openapi-generator/FILES | 7 - .../openapi.yaml-default.sha256 | 2 +- README.adoc | 4 +- api/openapi.yaml | 953 +++--------------- pom.xml | 4 +- .../bonitasoft/web/client/BonitaClient.java | 17 +- .../web/client/api/AuthenticationApi.java | 43 +- .../org/bonitasoft/web/client/api/BdmApi.java | 8 +- .../client/api/PortalAuthenticationApi.java | 109 -- .../web/client/api/SystemTenantApi.java | 97 -- .../bonitasoft/web/client/api/TenantApi.java | 298 ------ .../bonitasoft/web/client/api/UploadApi.java | 8 +- .../web/client/feign/BonitaFeignClient.java | 9 +- .../invoker/auth/BonitaLoginService.java | 12 +- .../web/client/model/ActivityVariable.java | 68 +- .../model/ArchivedProcessInstanceComment.java | 33 +- .../web/client/model/BDMAccessControl.java | 2 +- .../org/bonitasoft/web/client/model/Bdm.java | 2 +- .../bonitasoft/web/client/model/Group.java | 2 +- .../web/client/model/Membership.java | 2 +- .../client/model/ProcessInstanceComment.java | 33 +- .../org/bonitasoft/web/client/model/Role.java | 2 +- .../web/client/model/SystemTenant.java | 136 --- .../bonitasoft/web/client/model/Tenant.java | 363 ------- .../web/client/model/TenantCreateRequest.java | 201 ---- .../web/client/model/TenantPauseRequest.java | 105 -- .../web/client/model/TenantUpdateRequest.java | 301 ------ .../web/client/services/LoginService.java | 2 +- .../web/client/services/SystemService.java | 2 +- .../services/impl/DefaultBdmService.java | 34 +- .../services/impl/DefaultSystemService.java | 20 +- .../bonitasoft/web/client/BonitaClientIT.java | 2 +- .../web/client/feign/BonitaClientTest.java | 6 +- .../invoker/auth/BonitaLoginServiceTest.java | 37 +- .../services/impl/DefaultBdmServiceTest.java | 36 +- .../impl/DefaultSystemServiceTest.java | 33 +- src/test/resources/application.xml | 4 +- 39 files changed, 222 insertions(+), 2786 deletions(-) delete mode 100644 src/main/java/org/bonitasoft/web/client/api/PortalAuthenticationApi.java delete mode 100644 src/main/java/org/bonitasoft/web/client/api/SystemTenantApi.java delete mode 100644 src/main/java/org/bonitasoft/web/client/api/TenantApi.java delete mode 100644 src/main/java/org/bonitasoft/web/client/model/SystemTenant.java delete mode 100644 src/main/java/org/bonitasoft/web/client/model/Tenant.java delete mode 100644 src/main/java/org/bonitasoft/web/client/model/TenantCreateRequest.java delete mode 100644 src/main/java/org/bonitasoft/web/client/model/TenantPauseRequest.java delete mode 100644 src/main/java/org/bonitasoft/web/client/model/TenantUpdateRequest.java diff --git a/.github/workflows/_reusable_build.yml b/.github/workflows/_reusable_build.yml index 47d997ca..a043497f 100644 --- a/.github/workflows/_reusable_build.yml +++ b/.github/workflows/_reusable_build.yml @@ -51,7 +51,7 @@ jobs: - name: Compile and test project env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - run: ./mvnw -B -ntp clean verify sonar:sonar -Dsonar.scanner.force-deprecated-java-version=true -Dbonita.image=${{ vars.BONITASOFT_DOCKER_REGISTRY }}/${{ vars.DOCKER_SNAPSHOTS_REPOSITORY }}/bonita-community:10.2-SNAPSHOT + run: ./mvnw -B -ntp clean verify sonar:sonar -Dsonar.scanner.force-deprecated-java-version=true -Dbonita.image=${{ vars.BONITASOFT_DOCKER_REGISTRY }}/${{ vars.DOCKER_SNAPSHOTS_REPOSITORY }}/bonita-community:10.3-SNAPSHOT # Build and Push snapshots to maven central - name: Deploy snapshots to Maven central @@ -62,12 +62,11 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - bonita-version: - - '7.15.0' - - '8.0.0' + bonita-version: - '9.0.0' - '10.0.0' - '10.1.0' + - '10.2.0' steps: - uses: actions/checkout@v4 - uses: Keeper-Security/ksm-action@v1 @@ -91,4 +90,4 @@ jobs: password: ${{ env.JFROG_TOKEN }} - name: ${{ matrix.bonita-version }} Integration tests - run: ./mvnw -B -ntp verify -Dbonita.image=${{ vars.BONITASOFT_DOCKER_REGISTRY }}/${{ vars.INTERNAL_DOCKER_REPOSITORY_RELEASE }}/bonita-community:${{ matrix.bonita-version }} \ No newline at end of file + run: ./mvnw -B -ntp verify -Dbonita.image=${{ vars.BONITASOFT_DOCKER_REGISTRY }}/${{ vars.INTERNAL_DOCKER_REPOSITORY_RELEASE }}/bonita-community:${{ matrix.bonita-version }} diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore index 3401337a..052d17fd 100644 --- a/.openapi-generator-ignore +++ b/.openapi-generator-ignore @@ -23,7 +23,7 @@ #!docs/README.md # Ignore below APIs to keep client iso to legacy Bonita APIs -**/org/bonitasoft/web/client/api/PortalAuthenticationApi.java +**/org/bonitasoft/web/client/api/AuthenticationApi.java **/org/bonitasoft/web/client/api/LicenseApi.java **/org/bonitasoft/web/client/api/SessionApi.java diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 198780f7..ed9f9dd9 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -65,9 +65,7 @@ src/main/java/org/bonitasoft/web/client/api/ProfileEntryApi.java src/main/java/org/bonitasoft/web/client/api/ProfileMemberApi.java src/main/java/org/bonitasoft/web/client/api/RoleApi.java src/main/java/org/bonitasoft/web/client/api/SignalApi.java -src/main/java/org/bonitasoft/web/client/api/SystemTenantApi.java src/main/java/org/bonitasoft/web/client/api/TaskApi.java -src/main/java/org/bonitasoft/web/client/api/TenantApi.java src/main/java/org/bonitasoft/web/client/api/ThemeApi.java src/main/java/org/bonitasoft/web/client/api/TimerEventTriggerApi.java src/main/java/org/bonitasoft/web/client/api/UploadApi.java @@ -207,13 +205,8 @@ src/main/java/org/bonitasoft/web/client/model/RoleUpdateRequest.java src/main/java/org/bonitasoft/web/client/model/Session.java src/main/java/org/bonitasoft/web/client/model/Signal.java src/main/java/org/bonitasoft/web/client/model/SystemInformation.java -src/main/java/org/bonitasoft/web/client/model/SystemTenant.java src/main/java/org/bonitasoft/web/client/model/Task.java -src/main/java/org/bonitasoft/web/client/model/Tenant.java -src/main/java/org/bonitasoft/web/client/model/TenantCreateRequest.java -src/main/java/org/bonitasoft/web/client/model/TenantPauseRequest.java src/main/java/org/bonitasoft/web/client/model/TenantResourceState.java -src/main/java/org/bonitasoft/web/client/model/TenantUpdateRequest.java src/main/java/org/bonitasoft/web/client/model/ThemeCreateRequest.java src/main/java/org/bonitasoft/web/client/model/ThemeRestoreRequest.java src/main/java/org/bonitasoft/web/client/model/TimerEventTrigger.java diff --git a/.openapi-generator/openapi.yaml-default.sha256 b/.openapi-generator/openapi.yaml-default.sha256 index 62feeb82..c28d3ff5 100644 --- a/.openapi-generator/openapi.yaml-default.sha256 +++ b/.openapi-generator/openapi.yaml-default.sha256 @@ -1 +1 @@ -045f82ebacb0378879418950f6c4c90dfd67a456fe4c2d7dfa7ad7734bdb7675 \ No newline at end of file +1e1f41b83db2d2a372230c512270f63642561921258e976830396d4b9acfeb34 \ No newline at end of file diff --git a/README.adoc b/README.adoc index 7ff99a16..d77910b7 100644 --- a/README.adoc +++ b/README.adoc @@ -25,8 +25,8 @@ endif::[] // Vars :project-group-id: org.bonitasoft.web :project-artifact-id: bonita-java-client -:project-version: 2.0.0-SNAPSHOT -:bonita-short-version: 7.15 +:project-version: 3.0.0-SNAPSHOT +:bonita-short-version: 9.0 :orga: bonitasoft :uri-org: https://github.com/{orga} :uri-repo: {uri-org}/{project-artifact-id} diff --git a/api/openapi.yaml b/api/openapi.yaml index 6425d421..50adc0c4 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -104,7 +104,7 @@ info: name: GPL-v2.0 url: http://www.gnu.org/licenses/gpl-2.0.txt title: Bonita API - version: 0.0.23 + version: 1.0.2 x-logo: url: images/bonitasoft-logo.svg backgroundColor: '#19465f' @@ -181,27 +181,27 @@ tags: - description: ArchivedUserTask name: ArchivedUserTask x-displayName: ArchivedUserTask -- description: Portal Authentication - name: PortalAuthentication - x-displayName: Portal Authentication +- description: Authentication + name: Authentication + x-displayName: Authentication - description: Platform Authentication name: PlatformAuthentication x-displayName: Platform Authentication - description: | Show status or install or update the Business Data Model. - Installing or updating a BDM on your tenant needs to be done in two successive steps: + Installing or updating a BDM needs to be done in two successive steps: 1. Upload a BDM file 2. Install/Update the previously uploaded file - **To do this, your tenant services need to be paused.** + **To do this, the maintenance mode needs to be enabled.** - **In Enterprise editions, if you have an access control file installed on your tenant, you need to delete it before installing or updating your BDM.** + **In Enterprise editions, if you have an access control file installed, you need to delete it before installing or updating your BDM.** name: BDM x-displayName: Business Data Model -- description: "BDM Access control is available to protect the tenant BDM. You can\ - \ use this API to get the access control status (lastUpdatedBy, lastUpdateDate...)." +- description: "BDM Access control is available to protect the BDM. You can use this\ + \ API to get the access control status (lastUpdatedBy, lastUpdateDate...)." name: BDMAccessControl x-displayName: BDMAccessControl - description: BDM Rest APIs allow to query Bonita Business Data. @@ -307,9 +307,6 @@ tags: \ get one, log in as the platform administrator using the platform login service." name: Platform x-displayName: Platform -- description: PlatformTenant - name: PlatformTenant - x-displayName: PlatformTenant - description: "Deploy and manage process definitions. In addition, you can instantiate\ \ a process, which will create a new process instance (case)." name: Process @@ -344,16 +341,9 @@ tags: - description: Session name: Session x-displayName: Session -- description: SystemTenant - name: SystemTenant - x-displayName: SystemTenant - description: Task name: Task x-displayName: Task -- description: Handle the tenants (**Enterprise editions only**). This requires a - platform session. Log in using the platform login service. - name: Tenant - x-displayName: Tenant - description: Theme name: Theme x-displayName: Theme @@ -400,6 +390,10 @@ paths: $ref: '#/components/schemas/LoginRequest' responses: "204": + content: + text/plain: + schema: + type: string description: Login success headers: Set-Cookie: @@ -456,7 +450,6 @@ paths: summary: Login tags: - Authentication - - PortalAuthentication x-codeSamples: - lang: Shell label: Curl @@ -469,6 +462,7 @@ paths: x-content-type: application/x-www-form-urlencoded x-accepts: - application/json + - text/plain /logoutservice: get: description: | @@ -529,7 +523,6 @@ paths: summary: Logout the current user tags: - Authentication - - PortalAuthentication x-codeSamples: - lang: Shell label: Curl @@ -14408,97 +14401,21 @@ paths: x-content-type: application/json x-accepts: - application/json - /API/platform/tenant: + /API/platform/license: get: deprecated: true description: | - ![edition](https://img.shields.io/badge/edition-entreprise-blue) - - Finds Tenants with pagination params and filters - - - can order on `id` - - can search on `displayName` - - can filter on `displayName` - - Warning: Since Bonita 7.12, multi-tenancy is deprecated - operationId: searchTenants - parameters: - - description: index of the page to display - example: "0" - explode: true - in: query - name: p - required: true - schema: - default: 0 - format: int32 - minimum: 0 - type: integer - style: form - - description: maximum number of elements to retrieve - example: "10" - explode: true - in: query - name: c - required: true - schema: - default: 20 - format: int32 - minimum: 1 - type: integer - style: form - - description: "can filter on attributes with the format f={filter\\_name}={filter\\\ - _value} with the name/value pair as url encoded string." - example: abc%3d123 - explode: true - in: query - name: f - required: false - schema: - items: - maxLength: 250 - pattern: "^[A-Za-z0-9%]{0,250}$" - type: string - type: array - style: form - - description: can order on attributes - example: myProp%20ASC - explode: true - in: query - name: o - required: false - schema: - maxLength: 250 - pattern: "^[A-Za-z0-9%]{0,250}$" - type: string - style: form - - description: can search on attributes - explode: true - in: query - name: s - required: false - schema: - maxLength: 250 - pattern: "^[A-Za-z0-9%]{0,250}$" - type: string - style: form + Returns the current platform License. + This requires a platform session. Log in using the platform login service. + Warning: Since Bonita 10.2 (2024.3), this API is deprecated: use the API `GET /system/information` instead. + operationId: getPlatformLicense responses: "200": content: application/json: schema: - items: - $ref: '#/components/schemas/Tenant' - type: array - description: 'Success ' - headers: - Content-Range: - description: The total number of matching items - explode: false - schema: - format: int64 - type: integer - style: simple + $ref: '#/components/schemas/PlatformLicense' + description: Success "400": content: application/json: @@ -14525,6 +14442,14 @@ paths: $ref: '#/components/schemas/Error' description: "Forbidden, The request contained valid data and was understood\ \ by the server, but the server is refusing action." + "404": + content: + application/json: + example: + message: Resource not found. + schema: + $ref: '#/components/schemas/Error' + description: The resource for the specified ID was not found. "5XX": content: application/json: @@ -14533,34 +14458,34 @@ paths: schema: $ref: '#/components/schemas/Error' description: Unexpected error. - summary: Finds Tenants + summary: Get the platform License tags: - - Tenant + - License x-accepts: - application/json + /portal/processUpload: post: deprecated: true description: | - ![edition](https://img.shields.io/badge/edition-entreprise-blue) - - Create the Tenant. + Upload a bar file - Warning: Since Bonita 7.12, multi-tenancy is deprecated. Creating new tenants is strongly discouraged. - operationId: createTenant + Warning: as of 9.0.0, uploading a bar file using the portal is deprecated. + operationId: uploadProcess requestBody: content: - application/json: + multipart/form-data: schema: - $ref: '#/components/schemas/TenantCreateRequest' - description: Partial Tenant description - required: true + $ref: '#/components/schemas/FileUploadRequest' responses: "200": content: - application/json: + text/plain: schema: - $ref: '#/components/schemas/Tenant' - description: 'Success ' + example: tmp_11199343585454336281.bar + maxLength: 250 + pattern: "^[A-Za-z0-9\\_\\-\\.]{0,250}$" + type: string + description: the temporary file name once uploaded on the server "400": content: application/json: @@ -14595,35 +14520,36 @@ paths: schema: $ref: '#/components/schemas/Error' description: Unexpected error. - summary: Create the Tenant + summary: Upload a bar file tags: - - Tenant - x-codegen-request-body-name: body - x-content-type: application/json + - Process + - Upload + x-content-type: multipart/form-data x-accepts: - application/json - /API/platform/tenant/{id}: - delete: + - text/plain + /portal/pageUpload: + post: deprecated: true description: | - ![edition](https://img.shields.io/badge/edition-entreprise-blue) + Upload Page - Delete the single Tenant for the given ID - operationId: deleteTenantById - parameters: - - description: ID of the Tenant to delete - explode: false - in: path - name: id - required: true - schema: - maxLength: 250 - pattern: "^[A-Za-z0-9\\_\\-\\.]{0,250}$" - type: string - style: simple + Warning: as of 9.0.0, uploading a page using the portal is deprecated. + operationId: uploadPage + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/FileUploadRequest' responses: "200": - description: OK + content: + text/plain: + schema: + maxLength: 250 + pattern: "^[A-Za-z0-9\\_\\-\\.]{0,250}$" + type: string + description: "Success: the temp file name as present on the server" "400": content: application/json: @@ -14650,14 +14576,6 @@ paths: $ref: '#/components/schemas/Error' description: "Forbidden, The request contained valid data and was understood\ \ by the server, but the server is refusing action." - "404": - content: - application/json: - example: - message: Resource not found. - schema: - $ref: '#/components/schemas/Error' - description: The resource for the specified ID was not found. "5XX": content: application/json: @@ -14666,37 +14584,36 @@ paths: schema: $ref: '#/components/schemas/Error' description: Unexpected error. - summary: Delete the Tenant by ID + summary: Upload a Page tags: - - Tenant + - Page + - Upload + x-content-type: multipart/form-data x-accepts: - application/json - get: - deprecated: true + - text/plain + /portal/fileUpload: + post: description: | - ![edition](https://img.shields.io/badge/edition-entreprise-blue) + Upload file. - Returns the single Tenant for the given ID - Warning: Since Bonita 7.12, multi-tenancy is deprecated - operationId: getTenantById - parameters: - - description: ID of the Tenant to return - explode: false - in: path - name: id - required: true - schema: - maxLength: 250 - pattern: "^[A-Za-z0-9\\_\\-\\.]{0,250}$" - type: string - style: simple + **NOTE:** If this file is a BDM zip, to do this, Maintenance mode needs to be enabled. + In Enterprise editions, if you have an access control file installed, you need to delete it before installing or updating your BDM. + operationId: uploadFile + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/FileUploadRequest' responses: "200": content: - application/json: + text/plain: schema: - $ref: '#/components/schemas/Tenant' - description: 'Success ' + maxLength: 250 + pattern: "^[A-Za-z0-9\\_\\-\\.]{0,250}$" + type: string + description: "Success: the temp file name as present on the server" "400": content: application/json: @@ -14723,14 +14640,6 @@ paths: $ref: '#/components/schemas/Error' description: "Forbidden, The request contained valid data and was understood\ \ by the server, but the server is refusing action." - "404": - content: - application/json: - example: - message: Resource not found. - schema: - $ref: '#/components/schemas/Error' - description: The resource for the specified ID was not found. "5XX": content: application/json: @@ -14739,371 +14648,40 @@ paths: schema: $ref: '#/components/schemas/Error' description: Unexpected error. - summary: Finds the Tenant by ID + summary: Upload a file tags: - - Tenant + - Upload + - BDM + x-content-type: multipart/form-data x-accepts: - application/json - put: - deprecated: true + - text/plain + /API/portal/page: + get: description: | - ![edition](https://img.shields.io/badge/edition-entreprise-blue) ![edition](https://img.shields.io/badge/edition-community-brightgreen) - - Update a Tenant + Finds Pages with pagination params and filters - Warning: Since Bonita 7.12, multi-tenancy is deprecated - operationId: updateTenantById + - can search on `displayName`,`description` + - can filter on `createdBy`,`contentType` + operationId: searchPages parameters: - - description: "ID of the Tenant to update. In Subscription edition, it is mandatory;\ - \ not in Community edition, as there is only one tenant" - explode: false - in: path - name: id + - description: index of the page to display + example: "0" + explode: true + in: query + name: p required: true schema: - maxLength: 250 - pattern: "^[A-Za-z0-9\\_\\-\\.]{0,250}$" - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TenantUpdateRequest' - description: Partial Tenant description - required: true - responses: - "200": - description: OK - "400": - content: - application/json: - example: - message: Bad request - schema: - $ref: '#/components/schemas/Error' - description: Bad request. - "401": - content: - application/json: - example: - message: Unauthorized - schema: - $ref: '#/components/schemas/Error' - description: Authorization information is missing or invalid. - "403": - content: - application/json: - example: - message: "Forbidden, The request contained valid data and was understood\ - \ by the server, but the server is refusing action." - schema: - $ref: '#/components/schemas/Error' - description: "Forbidden, The request contained valid data and was understood\ - \ by the server, but the server is refusing action." - "404": - content: - application/json: - example: - message: Resource not found. - schema: - $ref: '#/components/schemas/Error' - description: The resource for the specified ID was not found. - "5XX": - content: - application/json: - example: - message: An unexpected error occured. - schema: - $ref: '#/components/schemas/Error' - description: Unexpected error. - summary: Update the Tenant by ID - tags: - - Tenant - x-content-type: application/json - x-accepts: - - application/json - /API/platform/license: - get: - deprecated: true - description: | - Returns the current platform License. - This requires a platform session. Log in using the platform login service. - Warning: Since Bonita 10.2 (2024.3), this API is deprecated: use the API `GET /system/information` instead. - operationId: getPlatformLicense - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/PlatformLicense' - description: Success - "400": - content: - application/json: - example: - message: Bad request - schema: - $ref: '#/components/schemas/Error' - description: Bad request. - "401": - content: - application/json: - example: - message: Unauthorized - schema: - $ref: '#/components/schemas/Error' - description: Authorization information is missing or invalid. - "403": - content: - application/json: - example: - message: "Forbidden, The request contained valid data and was understood\ - \ by the server, but the server is refusing action." - schema: - $ref: '#/components/schemas/Error' - description: "Forbidden, The request contained valid data and was understood\ - \ by the server, but the server is refusing action." - "404": - content: - application/json: - example: - message: Resource not found. - schema: - $ref: '#/components/schemas/Error' - description: The resource for the specified ID was not found. - "5XX": - content: - application/json: - example: - message: An unexpected error occured. - schema: - $ref: '#/components/schemas/Error' - description: Unexpected error. - summary: Get the platform License - tags: - - License - x-accepts: - - application/json - /portal/processUpload: - post: - deprecated: true - description: | - Upload a bar file - - Warning: as of 9.0.0, uploading a bar file using the portal is deprecated. - operationId: uploadProcess - requestBody: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/FileUploadRequest' - responses: - "200": - content: - text/plain: - schema: - example: tmp_11199343585454336281.bar - maxLength: 250 - pattern: "^[A-Za-z0-9\\_\\-\\.]{0,250}$" - type: string - description: the temporary file name once uploaded on the server - "400": - content: - application/json: - example: - message: Bad request - schema: - $ref: '#/components/schemas/Error' - description: Bad request. - "401": - content: - application/json: - example: - message: Unauthorized - schema: - $ref: '#/components/schemas/Error' - description: Authorization information is missing or invalid. - "403": - content: - application/json: - example: - message: "Forbidden, The request contained valid data and was understood\ - \ by the server, but the server is refusing action." - schema: - $ref: '#/components/schemas/Error' - description: "Forbidden, The request contained valid data and was understood\ - \ by the server, but the server is refusing action." - "5XX": - content: - application/json: - example: - message: An unexpected error occured. - schema: - $ref: '#/components/schemas/Error' - description: Unexpected error. - summary: Upload a bar file - tags: - - Process - - Upload - x-content-type: multipart/form-data - x-accepts: - - application/json - - text/plain - /portal/pageUpload: - post: - deprecated: true - description: | - Upload Page - - Warning: as of 9.0.0, uploading a page using the portal is deprecated. - operationId: uploadPage - requestBody: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/FileUploadRequest' - responses: - "200": - content: - text/plain: - schema: - maxLength: 250 - pattern: "^[A-Za-z0-9\\_\\-\\.]{0,250}$" - type: string - description: "Success: the temp file name as present on the server" - "400": - content: - application/json: - example: - message: Bad request - schema: - $ref: '#/components/schemas/Error' - description: Bad request. - "401": - content: - application/json: - example: - message: Unauthorized - schema: - $ref: '#/components/schemas/Error' - description: Authorization information is missing or invalid. - "403": - content: - application/json: - example: - message: "Forbidden, The request contained valid data and was understood\ - \ by the server, but the server is refusing action." - schema: - $ref: '#/components/schemas/Error' - description: "Forbidden, The request contained valid data and was understood\ - \ by the server, but the server is refusing action." - "5XX": - content: - application/json: - example: - message: An unexpected error occured. - schema: - $ref: '#/components/schemas/Error' - description: Unexpected error. - summary: Upload a Page - tags: - - Page - - Upload - x-content-type: multipart/form-data - x-accepts: - - application/json - - text/plain - /portal/fileUpload: - post: - description: | - Upload file. - - **NOTE:** If this file is a BDM zip, to do this, your tenant services need to be paused. - In Enterprise editions, if you have an access control file installed on your tenant, you need to delete it before installing or updating your BDM. - operationId: uploadFile - requestBody: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/FileUploadRequest' - responses: - "200": - content: - text/plain: - schema: - maxLength: 250 - pattern: "^[A-Za-z0-9\\_\\-\\.]{0,250}$" - type: string - description: "Success: the temp file name as present on the server" - "400": - content: - application/json: - example: - message: Bad request - schema: - $ref: '#/components/schemas/Error' - description: Bad request. - "401": - content: - application/json: - example: - message: Unauthorized - schema: - $ref: '#/components/schemas/Error' - description: Authorization information is missing or invalid. - "403": - content: - application/json: - example: - message: "Forbidden, The request contained valid data and was understood\ - \ by the server, but the server is refusing action." - schema: - $ref: '#/components/schemas/Error' - description: "Forbidden, The request contained valid data and was understood\ - \ by the server, but the server is refusing action." - "5XX": - content: - application/json: - example: - message: An unexpected error occured. - schema: - $ref: '#/components/schemas/Error' - description: Unexpected error. - summary: Upload a file - tags: - - Upload - - BDM - x-content-type: multipart/form-data - x-accepts: - - application/json - - text/plain - /API/portal/page: - get: - description: | - Finds Pages with pagination params and filters - - - can search on `displayName`,`description` - - can filter on `createdBy`,`contentType` - operationId: searchPages - parameters: - - description: index of the page to display - example: "0" - explode: true - in: query - name: p - required: true - schema: - default: 0 - format: int32 - minimum: 0 - type: integer - style: form - - description: maximum number of elements to retrieve - example: "10" - explode: true - in: query - name: c + default: 0 + format: int32 + minimum: 0 + type: integer + style: form + - description: maximum number of elements to retrieve + example: "10" + explode: true + in: query + name: c required: true schema: default: 20 @@ -16932,155 +16510,6 @@ paths: curl -b saved_cookies.txt -X GET --url 'http://localhost:8080/bonita/API/system/session/unusedId' x-accepts: - application/json - /API/system/tenant/{id}: - get: - deprecated: true - description: | - Pause and resume tenant services in order to do maintenance on a tenant. - - Warning: since Bonita 9.0.0, /API/system/tenant API resource is deprecated. Use /API/system/maintenance instead to retrieve the maintenance state. - operationId: getSystemTenant - parameters: - - description: ID of the tenant - explode: false - in: path - name: id - required: true - schema: - maxLength: 250 - pattern: "^[A-Za-z0-9\\_\\-\\.]{0,250}$" - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SystemTenant' - description: 'Success ' - "400": - content: - application/json: - example: - message: Bad request - schema: - $ref: '#/components/schemas/Error' - description: Bad request. - "401": - content: - application/json: - example: - message: Unauthorized - schema: - $ref: '#/components/schemas/Error' - description: Authorization information is missing or invalid. - "403": - content: - application/json: - example: - message: "Forbidden, The request contained valid data and was understood\ - \ by the server, but the server is refusing action." - schema: - $ref: '#/components/schemas/Error' - description: "Forbidden, The request contained valid data and was understood\ - \ by the server, but the server is refusing action." - "404": - content: - application/json: - example: - message: Resource not found. - schema: - $ref: '#/components/schemas/Error' - description: The resource for the specified ID was not found. - "5XX": - content: - application/json: - example: - message: An unexpected error occured. - schema: - $ref: '#/components/schemas/Error' - description: Unexpected error. - summary: Get the current Tenant - tags: - - SystemTenant - x-accepts: - - application/json - put: - deprecated: true - description: | - Pause or resume the current tenant. - - Warning: since Bonita 9.0.0, /API/system/tenant API resource is deprecated. Use /API/system/maintenance instead to enable the maintenance mode (same behavior as pausing the tenant). - operationId: updateSystemTenant - parameters: - - description: ID of the tenant - explode: false - in: path - name: id - required: true - schema: - maxLength: 250 - pattern: "^[A-Za-z0-9\\_\\-\\.]{0,250}$" - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TenantPauseRequest' - description: Partial SystemTenant description - required: true - responses: - "200": - description: OK - "400": - content: - application/json: - example: - message: Bad request - schema: - $ref: '#/components/schemas/Error' - description: Bad request. - "401": - content: - application/json: - example: - message: Unauthorized - schema: - $ref: '#/components/schemas/Error' - description: Authorization information is missing or invalid. - "403": - content: - application/json: - example: - message: "Forbidden, The request contained valid data and was understood\ - \ by the server, but the server is refusing action." - schema: - $ref: '#/components/schemas/Error' - description: "Forbidden, The request contained valid data and was understood\ - \ by the server, but the server is refusing action." - "404": - content: - application/json: - example: - message: Resource not found. - schema: - $ref: '#/components/schemas/Error' - description: The resource for the specified ID was not found. - "5XX": - content: - application/json: - example: - message: An unexpected error occured. - schema: - $ref: '#/components/schemas/Error' - description: Unexpected error. - summary: Update the current Tenant - tags: - - SystemTenant - x-content-type: application/json - x-accepts: - - application/json /API/system/maintenance: get: description: | @@ -17255,7 +16684,7 @@ paths: /API/system/license/unusedid: get: description: | - Returns license information for the current server. Requires to be logged in as a tenant technical administrator. + Returns license information for the current server. Requires to be logged in as a technical administrator. The same information can be retrieved as a user having simply the Admin profile through the API `GET /system/information`. operationId: getLicense responses: @@ -17921,9 +17350,6 @@ components: description: the password format: password type: string - tenant: - description: the user tenant - type: string redirect: default: "false" description: '"true" or "false". "false" indicates that the service should @@ -18390,7 +17816,7 @@ components: $ref: '#/components/schemas/TenantResourceState' lastUpdatedBy: description: "If `lastUpdatedBy: -1` it means that the access control were\ - \ last installed or updated by tenant_technical_user." + \ last installed or updated by technical admin." type: string lastUpdateDate: description: Last date when the access control were installed or updated. @@ -19413,8 +18839,6 @@ components: \ variable name for a specific process instance (or case). Only persistent\ \ variables are concerned by this resource, not transient variables." example: - tenantId: 0 - tenantId_string: 0 id: 5010 id_string: 5010 name: RequestValidationData @@ -19426,15 +18850,6 @@ components: containerType: ACTIVITY_INSTANCE value: Confirmed properties: - tenantId: - description: The ID of the tenant where the current user is logged in (technical - information) - maxLength: 250 - pattern: "^[A-Za-z0-9\\_\\-\\.]{0,250}$" - type: string - tenantId_string: - description: number (since 7.0.1) - type: string id: description: The identifier of the variable maxLength: 250 @@ -20073,7 +19488,6 @@ components: description: "" example: content: Need to review the last inputs of this case - tenantId: "1" id: "20005" processInstanceId: "1" postDate: 2016-06-16 14:51:33.053 @@ -20085,9 +19499,6 @@ components: content: description: the comment content type: string - tenantId: - description: the id of the tenant the comment is associated to - type: string processInstanceId: description: the process instance (case) the comment is associated to type: string @@ -20129,7 +19540,6 @@ components: example: archivedDate: archivedDate processInstanceId: processInstanceId - tenantId: tenantId postDate: postDate id: id userId: userId @@ -21441,7 +20851,7 @@ components: type: string created_by_user_id: description: id of the user who created the group (-1 if the group was created - by the tenant admin or by an organisation import) + by the technical admin or by an organisation import) type: string last_update_date: description: "last update date (format: `2014-12-31 15:17:24.736`)" @@ -21520,7 +20930,7 @@ components: type: integer assigned_by_user_id: description: id of the user who created the membership (-1 if the role was - created by the tenant admin or by an organisation import) + created by the technical admin or by an organisation import) type: string group_id: description: id of the group of this membership @@ -21580,7 +20990,7 @@ components: type: string created_by_user_id: description: Id of the user who created the role (-1 if the role was created - by the tenant admin or by an organisation import) + by the technical admin or by an organisation import) type: string last_update_date: description: "last update date (format: `2014-12-31 15:17:24.736`)" @@ -21829,105 +21239,6 @@ components: - stop type: string type: object - Tenant: - deprecated: true - description: "Since Bonita 7.12, tenant management is deprecated" - example: - id: 1 - creation: 2014-12-04 15:46:46.256 - icon: /default.png - username: "" - description: Default tenant - name: default - state: ACTIVATED - password: "" - properties: - id: - description: id of the tenant - type: string - creation: - description: the creation date - type: string - icon: - description: the path of the icon - type: string - name: - description: the name of the tenant - type: string - description: - description: the description - type: string - username: - description: the username - type: string - password: - description: the password - format: password - type: string - state: - description: the tenant state - enum: - - ACTIVATED - - DEACTIVATED - type: string - type: object - TenantCreateRequest: - deprecated: true - description: "Since Bonita 7.12, tenant creation is deprecated" - example: - name: MyTenant - description: My tenant - username: john - password: bpm - properties: - name: - description: the name of the tenant - type: string - description: - description: the description - type: string - username: - description: the username - type: string - password: - description: the password - format: password - type: string - type: object - TenantUpdateRequest: - deprecated: true - description: "Since Bonita 7.12, tenant update is deprecated" - example: - name: MyTenant - description: My new tenant description - username: john - password: bpm - icon: /default.png - state: ACTIVATED - properties: - name: - description: the name of the tenant - type: string - description: - description: the description - type: string - username: - description: the username - type: string - password: - description: the password - format: password - type: string - icon: - description: the path of the icon - type: string - state: - description: the tenant state - enum: - - ACTIVATED - - DEACTIVATED - type: string - type: object PlatformLicense: description: "" example: @@ -22364,27 +21675,6 @@ components: description: bonita copyright type: string type: object - SystemTenant: - description: "" - example: - id: 1 - paused: false - properties: - id: - description: system tenant id - type: string - paused: - description: whether the system tenant is paused or not - type: boolean - type: object - TenantPauseRequest: - example: - paused: true - properties: - paused: - description: wether the system tenant should be paused or not - type: string - type: object MaintenanceDetails: example: maintenanceState: DISABLED @@ -22545,8 +21835,8 @@ components: $ref: '#/components/schemas/TenantResourceState' lastUpdatedBy: default: "-1" - description: This value is always -1 because only the tenant_technical_user - can install BDM. + description: This value is always -1 because only the technical admin can + install BDM. type: string lastUpdateDate: description: Last date when the BDM was installed or updated. @@ -22777,7 +22067,7 @@ components: x-tagGroups: - name: Authentication tags: - - PortalAuthentication + - Authentication - PlatformAuthentication - name: Application tags: @@ -22849,8 +22139,6 @@ x-tagGroups: tags: - PlatformAuthentication - Platform - - PlatformTenant - - Tenant - License - Information - name: Portal @@ -22867,7 +22155,6 @@ x-tagGroups: - I18ntranslation - Session - Maintenance - - SystemTenant - name: Other tags: - RestAPIextensions diff --git a/pom.xml b/pom.xml index 49ff5d18..2fc72ca6 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.bonitasoft.web bonita-java-client - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT jar bonita-java-client Java client for Bonita REST API @@ -47,7 +47,7 @@ UTF-8 UTF-8 - 0.0.23 + 1.0.2 1.6.14 3.0.0 3.0.2 diff --git a/src/main/java/org/bonitasoft/web/client/BonitaClient.java b/src/main/java/org/bonitasoft/web/client/BonitaClient.java index 12ee4f22..c3a5b263 100644 --- a/src/main/java/org/bonitasoft/web/client/BonitaClient.java +++ b/src/main/java/org/bonitasoft/web/client/BonitaClient.java @@ -28,8 +28,6 @@ /** A Bonita client that communicate via http request with a Bonita running instance. */ public interface BonitaClient extends ApiProvider { - String DEFAULT_TENANT_ID = "1"; - String USER_PROFILE_NAME = "User"; String ADMIN_PROFILE_NAME = "Administrator"; @@ -47,7 +45,6 @@ static > BonitaClientBuilder builder(String /** * Perform client authentication. Authentication will be stored internally to be used for the * future requests
- * Account tenant default to 1 * * @param username Account username * @param password Account password @@ -56,18 +53,6 @@ static > BonitaClientBuilder builder(String */ Session login(String username, String password); - /** - * Perform client authentication. Authentication will be stored internally to be used for the - * future requests - * - * @param username Account username - * @param password Account password - * @param tenant Account tenant - * @return A session with the authenticated user info - * @throws org.bonitasoft.web.client.exception.UnauthorizedException if authentication failed - */ - Session login(String username, String password, String tenant); - /** Logout the current user */ void logout(); @@ -124,7 +109,7 @@ static > BonitaClientBuilder builder(String ProcessService processes(); /** - * Return the system tenant API + * Return the system service * * @return */ diff --git a/src/main/java/org/bonitasoft/web/client/api/AuthenticationApi.java b/src/main/java/org/bonitasoft/web/client/api/AuthenticationApi.java index 61fc07e4..94f0897e 100644 --- a/src/main/java/org/bonitasoft/web/client/api/AuthenticationApi.java +++ b/src/main/java/org/bonitasoft/web/client/api/AuthenticationApi.java @@ -38,45 +38,19 @@ public interface AuthenticationApi extends ApiClient.Api { * * @param username the username (required) * @param password the password (required) - * @param tenant the user tenant (optional) * @param redirect \\\"true\\\" or \\\"false\\\". \\\"false\\\" indicates that the service should not redirect to Bonita Portal * (after a successful login) or to the login page (after a login failure). (optional, default to false) * @param redirectURL the URL of the page to be displayed after login (optional, default to ) + * @return Response */ @RequestLine("POST /loginservice") @Headers({ "Content-Type: application/x-www-form-urlencoded", "Accept: application/json", }) - void login(@Param("username") String username, @Param("password") String password, @Param("tenant") String tenant, + Response login(@Param("username") String username, @Param("password") String password, @Param("redirect") String redirect, @Param("redirectURL") String redirectURL); - /** - * Login - * Similar to login but it also returns the http response headers . - * A call to the `/loginservice` will generates a set-cookie header in the response. The `JSESSIONID` cookie must be transfered with each - * subsequent calls. (If the REST API is used in an application running in a web browser, this is handled automatically by the web browser just like any - * cookies). Additional protection agains CSRF attacks is enabled by default for all fresh installations This security relies on `X-Bonita-API-Token` - * information. The `X-Bonita-API-Token` value can be found in the cookie named: `X-Bonita-API-Token`. All the subsequence REST API calls - * performing changes in the system using DELETE, POST, or PUT HTTP methods must contain the **HTTP header** below: ``` X-Bonita-API-Token: - * example-dummy-not-be-used-value ``` - * - * @param username the username (required) - * @param password the password (required) - * @param tenant the user tenant (optional) - * @param redirect \\\"true\\\" or \\\"false\\\". \\\"false\\\" indicates that the service should not redirect to Bonita Portal - * (after a successful login) or to the login page (after a login failure). (optional, default to false) - * @param redirectURL the URL of the page to be displayed after login (optional, default to ) - */ - @RequestLine("POST /loginservice") - @Headers({ - "Content-Type: application/x-www-form-urlencoded", - "Accept: application/json", - }) - ApiResponse loginWithHttpInfo(@Param("username") String username, @Param("password") String password, - @Param("tenant") String tenant, @Param("redirect") String redirect, - @Param("redirectURL") String redirectURL); - /** * Logout the current user * Logout the current user from the system @@ -89,19 +63,6 @@ ApiResponse loginWithHttpInfo(@Param("username") String username, @Param(" }) void logout(@Param("redirect") String redirect); - /** - * Logout the current user - * Similar to logout but it also returns the http response headers . - * Logout the current user from the system - * - * @param redirect Setting the redirect parameter to false indicates that the service should not redirect to the login page after logging out. (optional) - */ - @RequestLine("GET /logoutservice?redirect={redirect}") - @Headers({ - "Accept: application/json", - }) - ApiResponse logoutWithHttpInfo(@Param("redirect") String redirect); - /** * Logout the current user * Logout the current user from the system diff --git a/src/main/java/org/bonitasoft/web/client/api/BdmApi.java b/src/main/java/org/bonitasoft/web/client/api/BdmApi.java index e2798009..9cf25f7b 100644 --- a/src/main/java/org/bonitasoft/web/client/api/BdmApi.java +++ b/src/main/java/org/bonitasoft/web/client/api/BdmApi.java @@ -244,8 +244,8 @@ public SearchBusinessDataByIdsQueryParams ids(final String value) { /** * Upload a file - * Upload file. **NOTE:** If this file is a BDM zip, to do this, your tenant services need to be paused. In Enterprise editions, if you have an access control - * file installed on your tenant, you need to delete it before installing or updating your BDM. + * Upload file. **NOTE:** If this file is a BDM zip, to do this, Maintenance mode needs to be enabled. In Enterprise editions, if you have an access control + * file installed, you need to delete it before installing or updating your BDM. * * @param file (optional) * @return String @@ -260,8 +260,8 @@ public SearchBusinessDataByIdsQueryParams ids(final String value) { /** * Upload a file * Similar to uploadFile but it also returns the http response headers . - * Upload file. **NOTE:** If this file is a BDM zip, to do this, your tenant services need to be paused. In Enterprise editions, if you have an access control - * file installed on your tenant, you need to delete it before installing or updating your BDM. + * Upload file. **NOTE:** If this file is a BDM zip, to do this, Maintenance mode needs to be enabled. In Enterprise editions, if you have an access control + * file installed, you need to delete it before installing or updating your BDM. * * @param file (optional) * @return A ApiResponse that wraps the response boyd and the http headers. diff --git a/src/main/java/org/bonitasoft/web/client/api/PortalAuthenticationApi.java b/src/main/java/org/bonitasoft/web/client/api/PortalAuthenticationApi.java deleted file mode 100644 index 38bbcc3e..00000000 --- a/src/main/java/org/bonitasoft/web/client/api/PortalAuthenticationApi.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * Copyright (C) 2023 BonitaSoft S.A. - * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2.0 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.bonitasoft.web.client.api; - -import java.util.HashMap; -import java.util.Map; - -import org.bonitasoft.web.client.invoker.ApiClient; -import org.bonitasoft.web.client.invoker.EncodingUtils; - -import feign.Headers; -import feign.Param; -import feign.QueryMap; -import feign.RequestLine; -import feign.Response; - -public interface PortalAuthenticationApi extends ApiClient.Api { - - /** - * Login A call to the `/loginservice` will generates a set-cookie header in the - * response. The `JSESSIONID` cookie must be transfered with each subsequent calls. (If - * the REST API is used in an application running in a web browser, this is handled automatically - * by the web browser just like any cookies). Additional protection agains CSRF attacks is enabled - * by default for all fresh installations This security relies on `X-Bonita-API-Token` - * information. The `X-Bonita-API-Token` value can be found in the cookie named: - * `X-Bonita-API-Token`. All the subsequence REST API calls performing changes in the - * system using DELETE, POST, or PUT HTTP methods must contain the **HTTP header** below: - * ``` X-Bonita-API-Token: example-dummy-not-be-used-value ``` - * - * @param username the username (required) - * @param password the password (required) - * @param tenant the user tenant (optional) - * @param redirect \\\"true\\\" or \\\"false\\\". \\\"false\\\" - * indicates that the service should not redirect to Bonita Portal (after a successful login) - * or to the login page (after a login failure). (optional, default to "false") - * @param redirectURL the URL of the page to be displayed after login (optional, default to - * "") - * @return String - */ - @RequestLine("POST /loginservice") - @Headers({ - "Content-Type: application/x-www-form-urlencoded", - "Accept: application/json", - }) - Response login( - @Param("username") String username, - @Param("password") String password, - @Param("tenant") String tenant, - @Param("redirect") String redirect, - @Param("redirectURL") String redirectURL); - - /** - * Logout the current user Logout the current user from the system - * - * @param redirect Setting the redirect parameter to false indicates that the service should not - * redirect to the login page after logging out. (optional) - */ - @RequestLine("GET /logoutservice?redirect={redirect}") - @Headers({ - "Accept: application/json", - }) - void logout(@Param("redirect") String redirect); - - /** - * Logout the current user Logout the current user from the system Note, this is equivalent to the - * other logout method, but with the query parameters collected into a single Map - * parameter. This is convenient for services with optional query parameters, especially when used - * with the {@link LogoutQueryParams} class that allows for building up this map in a fluent - * style. - * - * @param queryParams Map of query parameters as name-value pairs - *

The following elements may be specified in the query map: - *

    - *
  • redirect - Setting the redirect parameter to false indicates that the service should - * not redirect to the login page after logging out. (optional) - *
- */ - @RequestLine("GET /logoutservice?redirect={redirect}") - @Headers({ - "Accept: application/json", - }) - void logout(@QueryMap(encoded = true) Map queryParams); - - /** - * A convenience class for generating query parameters for the logout method in a - * fluent style. - */ - class LogoutQueryParams extends HashMap { - - public LogoutQueryParams redirect(final String value) { - put("redirect", EncodingUtils.encode(value)); - return this; - } - } -} diff --git a/src/main/java/org/bonitasoft/web/client/api/SystemTenantApi.java b/src/main/java/org/bonitasoft/web/client/api/SystemTenantApi.java deleted file mode 100644 index 637151bf..00000000 --- a/src/main/java/org/bonitasoft/web/client/api/SystemTenantApi.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Copyright (C) 2025 BonitaSoft S.A. - * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2.0 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.bonitasoft.web.client.api; - -import org.bonitasoft.web.client.invoker.ApiClient; -import org.bonitasoft.web.client.model.ApiResponse; -import org.bonitasoft.web.client.model.SystemTenant; -import org.bonitasoft.web.client.model.TenantPauseRequest; - -import feign.*; - -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -public interface SystemTenantApi extends ApiClient.Api { - - /** - * Get the current Tenant - * Pause and resume tenant services in order to do maintenance on a tenant. Warning: since Bonita 9.0.0, /API/system/tenant API resource is deprecated. Use - * /API/system/maintenance instead to retrieve the maintenance state. - * - * @param id ID of the tenant (required) - * @return SystemTenant - * @deprecated - */ - @Deprecated - @RequestLine("GET /API/system/tenant/{id}") - @Headers({ - "Accept: application/json", - }) - SystemTenant getSystemTenant(@Param("id") String id); - - /** - * Get the current Tenant - * Similar to getSystemTenant but it also returns the http response headers . - * Pause and resume tenant services in order to do maintenance on a tenant. Warning: since Bonita 9.0.0, /API/system/tenant API resource is deprecated. Use - * /API/system/maintenance instead to retrieve the maintenance state. - * - * @param id ID of the tenant (required) - * @return A ApiResponse that wraps the response boyd and the http headers. - * @deprecated - */ - @Deprecated - @RequestLine("GET /API/system/tenant/{id}") - @Headers({ - "Accept: application/json", - }) - ApiResponse getSystemTenantWithHttpInfo(@Param("id") String id); - - /** - * Update the current Tenant - * Pause or resume the current tenant. Warning: since Bonita 9.0.0, /API/system/tenant API resource is deprecated. Use /API/system/maintenance instead to enable - * the maintenance mode (same behavior as pausing the tenant). - * - * @param id ID of the tenant (required) - * @param tenantPauseRequest Partial SystemTenant description (required) - * @deprecated - */ - @Deprecated - @RequestLine("PUT /API/system/tenant/{id}") - @Headers({ - "Content-Type: application/json", - "Accept: application/json", - }) - void updateSystemTenant(@Param("id") String id, TenantPauseRequest tenantPauseRequest); - - /** - * Update the current Tenant - * Similar to updateSystemTenant but it also returns the http response headers . - * Pause or resume the current tenant. Warning: since Bonita 9.0.0, /API/system/tenant API resource is deprecated. Use /API/system/maintenance instead to enable - * the maintenance mode (same behavior as pausing the tenant). - * - * @param id ID of the tenant (required) - * @param tenantPauseRequest Partial SystemTenant description (required) - * @deprecated - */ - @Deprecated - @RequestLine("PUT /API/system/tenant/{id}") - @Headers({ - "Content-Type: application/json", - "Accept: application/json", - }) - ApiResponse updateSystemTenantWithHttpInfo(@Param("id") String id, TenantPauseRequest tenantPauseRequest); - -} diff --git a/src/main/java/org/bonitasoft/web/client/api/TenantApi.java b/src/main/java/org/bonitasoft/web/client/api/TenantApi.java deleted file mode 100644 index e34bcfc1..00000000 --- a/src/main/java/org/bonitasoft/web/client/api/TenantApi.java +++ /dev/null @@ -1,298 +0,0 @@ -/** - * Copyright (C) 2025 BonitaSoft S.A. - * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2.0 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.bonitasoft.web.client.api; - -import java.util.HashMap; -import java.util.List; - -import org.bonitasoft.web.client.invoker.ApiClient; -import org.bonitasoft.web.client.invoker.EncodingUtils; -import org.bonitasoft.web.client.model.ApiResponse; -import org.bonitasoft.web.client.model.Tenant; -import org.bonitasoft.web.client.model.TenantCreateRequest; -import org.bonitasoft.web.client.model.TenantUpdateRequest; - -import feign.*; - -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -public interface TenantApi extends ApiClient.Api { - - /** - * Create the Tenant - * ![edition](https://img.shields.io/badge/edition-entreprise-blue) Create the Tenant. Warning: Since Bonita 7.12, multi-tenancy is deprecated. Creating new - * tenants is strongly discouraged. - * - * @param body Partial Tenant description (required) - * @return Tenant - * @deprecated - */ - @Deprecated - @RequestLine("POST /API/platform/tenant") - @Headers({ - "Content-Type: application/json", - "Accept: application/json", - }) - Tenant createTenant(TenantCreateRequest body); - - /** - * Create the Tenant - * Similar to createTenant but it also returns the http response headers . - * ![edition](https://img.shields.io/badge/edition-entreprise-blue) Create the Tenant. Warning: Since Bonita 7.12, multi-tenancy is deprecated. Creating new - * tenants is strongly discouraged. - * - * @param body Partial Tenant description (required) - * @return A ApiResponse that wraps the response boyd and the http headers. - * @deprecated - */ - @Deprecated - @RequestLine("POST /API/platform/tenant") - @Headers({ - "Content-Type: application/json", - "Accept: application/json", - }) - ApiResponse createTenantWithHttpInfo(TenantCreateRequest body); - - /** - * Delete the Tenant by ID - * ![edition](https://img.shields.io/badge/edition-entreprise-blue) Delete the single Tenant for the given ID - * - * @param id ID of the Tenant to delete (required) - * @deprecated - */ - @Deprecated - @RequestLine("DELETE /API/platform/tenant/{id}") - @Headers({ - "Accept: application/json", - }) - void deleteTenantById(@Param("id") String id); - - /** - * Delete the Tenant by ID - * Similar to deleteTenantById but it also returns the http response headers . - * ![edition](https://img.shields.io/badge/edition-entreprise-blue) Delete the single Tenant for the given ID - * - * @param id ID of the Tenant to delete (required) - * @deprecated - */ - @Deprecated - @RequestLine("DELETE /API/platform/tenant/{id}") - @Headers({ - "Accept: application/json", - }) - ApiResponse deleteTenantByIdWithHttpInfo(@Param("id") String id); - - /** - * Finds the Tenant by ID - * ![edition](https://img.shields.io/badge/edition-entreprise-blue) Returns the single Tenant for the given ID Warning: Since Bonita 7.12, multi-tenancy is - * deprecated - * - * @param id ID of the Tenant to return (required) - * @return Tenant - * @deprecated - */ - @Deprecated - @RequestLine("GET /API/platform/tenant/{id}") - @Headers({ - "Accept: application/json", - }) - Tenant getTenantById(@Param("id") String id); - - /** - * Finds the Tenant by ID - * Similar to getTenantById but it also returns the http response headers . - * ![edition](https://img.shields.io/badge/edition-entreprise-blue) Returns the single Tenant for the given ID Warning: Since Bonita 7.12, multi-tenancy is - * deprecated - * - * @param id ID of the Tenant to return (required) - * @return A ApiResponse that wraps the response boyd and the http headers. - * @deprecated - */ - @Deprecated - @RequestLine("GET /API/platform/tenant/{id}") - @Headers({ - "Accept: application/json", - }) - ApiResponse getTenantByIdWithHttpInfo(@Param("id") String id); - - /** - * Finds Tenants - * ![edition](https://img.shields.io/badge/edition-entreprise-blue) Finds Tenants with pagination params and filters - can order on `id` - can search - * on `displayName` - can filter on `displayName` Warning: Since Bonita 7.12, multi-tenancy is deprecated - * - * @param p index of the page to display (required) - * @param c maximum number of elements to retrieve (required) - * @param f can filter on attributes with the format f={filter\\_name}={filter\\_value} with the name/value pair as url encoded string. (optional) - * @param o can order on attributes (optional) - * @param s can search on attributes (optional) - * @return List<Tenant> - * @deprecated - */ - @Deprecated - @RequestLine("GET /API/platform/tenant?p={p}&c={c}&f={f}&o={o}&s={s}") - @Headers({ - "Accept: application/json", - }) - List searchTenants(@Param("p") Integer p, @Param("c") Integer c, @Param("f") List f, - @Param("o") String o, @Param("s") String s); - - /** - * Finds Tenants - * Similar to searchTenants but it also returns the http response headers . - * ![edition](https://img.shields.io/badge/edition-entreprise-blue) Finds Tenants with pagination params and filters - can order on `id` - can search - * on `displayName` - can filter on `displayName` Warning: Since Bonita 7.12, multi-tenancy is deprecated - * - * @param p index of the page to display (required) - * @param c maximum number of elements to retrieve (required) - * @param f can filter on attributes with the format f={filter\\_name}={filter\\_value} with the name/value pair as url encoded string. (optional) - * @param o can order on attributes (optional) - * @param s can search on attributes (optional) - * @return A ApiResponse that wraps the response boyd and the http headers. - * @deprecated - */ - @Deprecated - @RequestLine("GET /API/platform/tenant?p={p}&c={c}&f={f}&o={o}&s={s}") - @Headers({ - "Accept: application/json", - }) - ApiResponse> searchTenantsWithHttpInfo(@Param("p") Integer p, @Param("c") Integer c, - @Param("f") List f, @Param("o") String o, @Param("s") String s); - - /** - * Finds Tenants - * ![edition](https://img.shields.io/badge/edition-entreprise-blue) Finds Tenants with pagination params and filters - can order on `id` - can search - * on `displayName` - can filter on `displayName` Warning: Since Bonita 7.12, multi-tenancy is deprecated - * Note, this is equivalent to the other searchTenants method, - * but with the query parameters collected into a single Map parameter. This - * is convenient for services with optional query parameters, especially when - * used with the {@link SearchTenantsQueryParams} class that allows for - * building up this map in a fluent style. - * - * @param queryParams Map of query parameters as name-value pairs - *

The following elements may be specified in the query map:

- *
    - *
  • p - index of the page to display (required)
  • - *
  • c - maximum number of elements to retrieve (required)
  • - *
  • f - can filter on attributes with the format f={filter\\_name}={filter\\_value} with the name/value pair as url encoded string. - * (optional)
  • - *
  • o - can order on attributes (optional)
  • - *
  • s - can search on attributes (optional)
  • - *
- * @return List<Tenant> - * @deprecated - */ - @Deprecated - @RequestLine("GET /API/platform/tenant?p={p}&c={c}&f={f}&o={o}&s={s}") - @Headers({ - "Accept: application/json", - }) - List searchTenants(@QueryMap(encoded = true) SearchTenantsQueryParams queryParams); - - /** - * Finds Tenants - * ![edition](https://img.shields.io/badge/edition-entreprise-blue) Finds Tenants with pagination params and filters - can order on `id` - can search - * on `displayName` - can filter on `displayName` Warning: Since Bonita 7.12, multi-tenancy is deprecated - * Note, this is equivalent to the other searchTenants that receives the query parameters as a map, - * but this one also exposes the Http response headers - * - * @param queryParams Map of query parameters as name-value pairs - *

The following elements may be specified in the query map:

- *
    - *
  • p - index of the page to display (required)
  • - *
  • c - maximum number of elements to retrieve (required)
  • - *
  • f - can filter on attributes with the format f={filter\\_name}={filter\\_value} with the name/value pair as url encoded string. - * (optional)
  • - *
  • o - can order on attributes (optional)
  • - *
  • s - can search on attributes (optional)
  • - *
- * @return List<Tenant> - * @deprecated - */ - @Deprecated - @RequestLine("GET /API/platform/tenant?p={p}&c={c}&f={f}&o={o}&s={s}") - @Headers({ - "Accept: application/json", - }) - ApiResponse> searchTenantsWithHttpInfo(@QueryMap(encoded = true) SearchTenantsQueryParams queryParams); - - /** - * A convenience class for generating query parameters for the - * searchTenants method in a fluent style. - */ - public static class SearchTenantsQueryParams extends HashMap { - - public SearchTenantsQueryParams p(final Integer value) { - put("p", EncodingUtils.encode(value)); - return this; - } - - public SearchTenantsQueryParams c(final Integer value) { - put("c", EncodingUtils.encode(value)); - return this; - } - - public SearchTenantsQueryParams f(final List value) { - put("f", EncodingUtils.encodeCollection(value, "multi")); - return this; - } - - public SearchTenantsQueryParams o(final String value) { - put("o", EncodingUtils.encode(value)); - return this; - } - - public SearchTenantsQueryParams s(final String value) { - put("s", EncodingUtils.encode(value)); - return this; - } - } - - /** - * Update the Tenant by ID - * ![edition](https://img.shields.io/badge/edition-entreprise-blue) ![edition](https://img.shields.io/badge/edition-community-brightgreen) Update a Tenant - * Warning: Since Bonita 7.12, multi-tenancy is deprecated - * - * @param id ID of the Tenant to update. In Subscription edition, it is mandatory; not in Community edition, as there is only one tenant (required) - * @param tenantUpdateRequest Partial Tenant description (required) - * @deprecated - */ - @Deprecated - @RequestLine("PUT /API/platform/tenant/{id}") - @Headers({ - "Content-Type: application/json", - "Accept: application/json", - }) - void updateTenantById(@Param("id") String id, TenantUpdateRequest tenantUpdateRequest); - - /** - * Update the Tenant by ID - * Similar to updateTenantById but it also returns the http response headers . - * ![edition](https://img.shields.io/badge/edition-entreprise-blue) ![edition](https://img.shields.io/badge/edition-community-brightgreen) Update a Tenant - * Warning: Since Bonita 7.12, multi-tenancy is deprecated - * - * @param id ID of the Tenant to update. In Subscription edition, it is mandatory; not in Community edition, as there is only one tenant (required) - * @param tenantUpdateRequest Partial Tenant description (required) - * @deprecated - */ - @Deprecated - @RequestLine("PUT /API/platform/tenant/{id}") - @Headers({ - "Content-Type: application/json", - "Accept: application/json", - }) - ApiResponse updateTenantByIdWithHttpInfo(@Param("id") String id, TenantUpdateRequest tenantUpdateRequest); - -} diff --git a/src/main/java/org/bonitasoft/web/client/api/UploadApi.java b/src/main/java/org/bonitasoft/web/client/api/UploadApi.java index 9bfa9544..36710d44 100644 --- a/src/main/java/org/bonitasoft/web/client/api/UploadApi.java +++ b/src/main/java/org/bonitasoft/web/client/api/UploadApi.java @@ -96,8 +96,8 @@ public interface UploadApi extends ApiClient.Api { /** * Upload a file - * Upload file. **NOTE:** If this file is a BDM zip, to do this, your tenant services need to be paused. In Enterprise editions, if you have an access control - * file installed on your tenant, you need to delete it before installing or updating your BDM. + * Upload file. **NOTE:** If this file is a BDM zip, to do this, Maintenance mode needs to be enabled. In Enterprise editions, if you have an access control + * file installed, you need to delete it before installing or updating your BDM. * * @param file (optional) * @return String @@ -112,8 +112,8 @@ public interface UploadApi extends ApiClient.Api { /** * Upload a file * Similar to uploadFile but it also returns the http response headers . - * Upload file. **NOTE:** If this file is a BDM zip, to do this, your tenant services need to be paused. In Enterprise editions, if you have an access control - * file installed on your tenant, you need to delete it before installing or updating your BDM. + * Upload file. **NOTE:** If this file is a BDM zip, to do this, Maintenance mode needs to be enabled. In Enterprise editions, if you have an access control + * file installed, you need to delete it before installing or updating your BDM. * * @param file (optional) * @return A ApiResponse that wraps the response boyd and the http headers. diff --git a/src/main/java/org/bonitasoft/web/client/feign/BonitaFeignClient.java b/src/main/java/org/bonitasoft/web/client/feign/BonitaFeignClient.java index 4c202961..4af4b3cc 100644 --- a/src/main/java/org/bonitasoft/web/client/feign/BonitaFeignClient.java +++ b/src/main/java/org/bonitasoft/web/client/feign/BonitaFeignClient.java @@ -62,13 +62,8 @@ public String getUrl() { @Override public Session login(String username, String password) { - return login(username, password, DEFAULT_TENANT_ID); - } - - @Override - public Session login(String username, String password, String tenant) { - log.info("Try login user {} on tenant {}", username, tenant); - Session session = loginService.login(username, password, tenant); + log.info("Try login user {}", username); + Session session = loginService.login(username, password); log.debug("User logged in: {}", session); return session; } diff --git a/src/main/java/org/bonitasoft/web/client/invoker/auth/BonitaLoginService.java b/src/main/java/org/bonitasoft/web/client/invoker/auth/BonitaLoginService.java index 711698f0..dd702d0a 100644 --- a/src/main/java/org/bonitasoft/web/client/invoker/auth/BonitaLoginService.java +++ b/src/main/java/org/bonitasoft/web/client/invoker/auth/BonitaLoginService.java @@ -21,7 +21,7 @@ import java.io.IOException; import java.io.InputStream; -import org.bonitasoft.web.client.api.PortalAuthenticationApi; +import org.bonitasoft.web.client.api.AuthenticationApi; import org.bonitasoft.web.client.api.SessionApi; import org.bonitasoft.web.client.exception.ClientException; import org.bonitasoft.web.client.exception.UnauthorizedException; @@ -46,15 +46,15 @@ public class BonitaLoginService implements LoginService { private final BonitaCookieAuth bonitaCookieAuth; @Override - public Session login(String username, String password, String tenant) { - log.debug("Login with user '{}' on tenant '{}'...", username, tenant); + public Session login(String username, String password) { + log.debug("Login with user '{}'...", username); boolean loginSucceeded; int loginStatus; String loginReason = ""; - final PortalAuthenticationApi portalAuthenticationApi = apiProvider.get(PortalAuthenticationApi.class); - try (Response loginResponse = portalAuthenticationApi.login(username, password, tenant, "false", "")) { + final AuthenticationApi portalAuthenticationApi = apiProvider.get(AuthenticationApi.class); + try (Response loginResponse = portalAuthenticationApi.login(username, password, "false", "")) { loginStatus = loginResponse.status(); loginSucceeded = (loginStatus == 200 || loginStatus == 204); if (loginSucceeded) { @@ -91,7 +91,7 @@ public Session getSession() { @Override public void logout() { log.debug("Logout..."); - apiProvider.get(PortalAuthenticationApi.class).logout("false"); + apiProvider.get(AuthenticationApi.class).logout("false"); bonitaCookieAuth.clearSessionCookie(); log.debug("Logout completed."); } diff --git a/src/main/java/org/bonitasoft/web/client/model/ActivityVariable.java b/src/main/java/org/bonitasoft/web/client/model/ActivityVariable.java index c1807d46..15fb2b45 100644 --- a/src/main/java/org/bonitasoft/web/client/model/ActivityVariable.java +++ b/src/main/java/org/bonitasoft/web/client/model/ActivityVariable.java @@ -30,8 +30,6 @@ * concerned by this resource, not transient variables. */ @JsonPropertyOrder({ - ActivityVariable.JSON_PROPERTY_TENANT_ID, - ActivityVariable.JSON_PROPERTY_TENANT_ID_STRING, ActivityVariable.JSON_PROPERTY_ID, ActivityVariable.JSON_PROPERTY_ID_STRING, ActivityVariable.JSON_PROPERTY_NAME, @@ -48,12 +46,6 @@ public class ActivityVariable implements Serializable { private static final long serialVersionUID = 1L; - public static final String JSON_PROPERTY_TENANT_ID = "tenantId"; - private String tenantId; - - public static final String JSON_PROPERTY_TENANT_ID_STRING = "tenantId_string"; - private String tenantIdString; - public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -123,56 +115,6 @@ public static ContainerTypeEnum fromValue(String value) { public ActivityVariable() { } - public ActivityVariable tenantId(String tenantId) { - - this.tenantId = tenantId; - return this; - } - - /** - * The ID of the tenant where the current user is logged in (technical information) - * - * @return tenantId - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TENANT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTenantId() { - return tenantId; - } - - @JsonProperty(JSON_PROPERTY_TENANT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public ActivityVariable tenantIdString(String tenantIdString) { - - this.tenantIdString = tenantIdString; - return this; - } - - /** - * number (since 7.0.1) - * - * @return tenantIdString - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TENANT_ID_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTenantIdString() { - return tenantIdString; - } - - @JsonProperty(JSON_PROPERTY_TENANT_ID_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTenantIdString(String tenantIdString) { - this.tenantIdString = tenantIdString; - } - public ActivityVariable id(String id) { this.id = id; @@ -433,9 +375,7 @@ public boolean equals(Object o) { return false; } ActivityVariable activityVariable = (ActivityVariable) o; - return Objects.equals(this.tenantId, activityVariable.tenantId) && - Objects.equals(this.tenantIdString, activityVariable.tenantIdString) && - Objects.equals(this.id, activityVariable.id) && + return Objects.equals(this.id, activityVariable.id) && Objects.equals(this.idString, activityVariable.idString) && Objects.equals(this.name, activityVariable.name) && Objects.equals(this.description, activityVariable.description) && @@ -449,16 +389,14 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(tenantId, tenantIdString, id, idString, name, description, transientData, className, - containerId, containerIdString, containerType, value); + return Objects.hash(id, idString, name, description, transientData, className, containerId, containerIdString, + containerType, value); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ActivityVariable {\n"); - sb.append(" tenantId: ").append(toIndentedString(tenantId)).append("\n"); - sb.append(" tenantIdString: ").append(toIndentedString(tenantIdString)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" idString: ").append(toIndentedString(idString)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); diff --git a/src/main/java/org/bonitasoft/web/client/model/ArchivedProcessInstanceComment.java b/src/main/java/org/bonitasoft/web/client/model/ArchivedProcessInstanceComment.java index 0e5b0a12..be4ca763 100644 --- a/src/main/java/org/bonitasoft/web/client/model/ArchivedProcessInstanceComment.java +++ b/src/main/java/org/bonitasoft/web/client/model/ArchivedProcessInstanceComment.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ArchivedProcessInstanceComment.JSON_PROPERTY_ID, ArchivedProcessInstanceComment.JSON_PROPERTY_CONTENT, - ArchivedProcessInstanceComment.JSON_PROPERTY_TENANT_ID, ArchivedProcessInstanceComment.JSON_PROPERTY_PROCESS_INSTANCE_ID, ArchivedProcessInstanceComment.JSON_PROPERTY_POST_DATE, ArchivedProcessInstanceComment.JSON_PROPERTY_USER_ID, @@ -46,9 +45,6 @@ public class ArchivedProcessInstanceComment implements Serializable { public static final String JSON_PROPERTY_CONTENT = "content"; private String content; - public static final String JSON_PROPERTY_TENANT_ID = "tenantId"; - private String tenantId; - public static final String JSON_PROPERTY_PROCESS_INSTANCE_ID = "processInstanceId"; private String processInstanceId; @@ -114,31 +110,6 @@ public void setContent(String content) { this.content = content; } - public ArchivedProcessInstanceComment tenantId(String tenantId) { - - this.tenantId = tenantId; - return this; - } - - /** - * the id of the tenant the comment is associated to - * - * @return tenantId - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TENANT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTenantId() { - return tenantId; - } - - @JsonProperty(JSON_PROPERTY_TENANT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - public ArchivedProcessInstanceComment processInstanceId(String processInstanceId) { this.processInstanceId = processInstanceId; @@ -250,7 +221,6 @@ public boolean equals(Object o) { ArchivedProcessInstanceComment archivedProcessInstanceComment = (ArchivedProcessInstanceComment) o; return Objects.equals(this.id, archivedProcessInstanceComment.id) && Objects.equals(this.content, archivedProcessInstanceComment.content) && - Objects.equals(this.tenantId, archivedProcessInstanceComment.tenantId) && Objects.equals(this.processInstanceId, archivedProcessInstanceComment.processInstanceId) && Objects.equals(this.postDate, archivedProcessInstanceComment.postDate) && Objects.equals(this.userId, archivedProcessInstanceComment.userId) && @@ -259,7 +229,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(id, content, tenantId, processInstanceId, postDate, userId, archivedDate); + return Objects.hash(id, content, processInstanceId, postDate, userId, archivedDate); } @Override @@ -268,7 +238,6 @@ public String toString() { sb.append("class ArchivedProcessInstanceComment {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" tenantId: ").append(toIndentedString(tenantId)).append("\n"); sb.append(" processInstanceId: ").append(toIndentedString(processInstanceId)).append("\n"); sb.append(" postDate: ").append(toIndentedString(postDate)).append("\n"); sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); diff --git a/src/main/java/org/bonitasoft/web/client/model/BDMAccessControl.java b/src/main/java/org/bonitasoft/web/client/model/BDMAccessControl.java index 343562fc..8a461a0e 100644 --- a/src/main/java/org/bonitasoft/web/client/model/BDMAccessControl.java +++ b/src/main/java/org/bonitasoft/web/client/model/BDMAccessControl.java @@ -138,7 +138,7 @@ public BDMAccessControl lastUpdatedBy(String lastUpdatedBy) { } /** - * If `lastUpdatedBy: -1` it means that the access control were last installed or updated by tenant_technical_user. + * If `lastUpdatedBy: -1` it means that the access control were last installed or updated by technical admin. * * @return lastUpdatedBy */ diff --git a/src/main/java/org/bonitasoft/web/client/model/Bdm.java b/src/main/java/org/bonitasoft/web/client/model/Bdm.java index 2ce6fdd7..21ff3979 100644 --- a/src/main/java/org/bonitasoft/web/client/model/Bdm.java +++ b/src/main/java/org/bonitasoft/web/client/model/Bdm.java @@ -167,7 +167,7 @@ public Bdm lastUpdatedBy(String lastUpdatedBy) { } /** - * This value is always -1 because only the tenant_technical_user can install BDM. + * This value is always -1 because only the technical admin can install BDM. * * @return lastUpdatedBy */ diff --git a/src/main/java/org/bonitasoft/web/client/model/Group.java b/src/main/java/org/bonitasoft/web/client/model/Group.java index 8f753223..a0c4a2a9 100644 --- a/src/main/java/org/bonitasoft/web/client/model/Group.java +++ b/src/main/java/org/bonitasoft/web/client/model/Group.java @@ -287,7 +287,7 @@ public Group createdByUserId(String createdByUserId) { } /** - * id of the user who created the group (-1 if the group was created by the tenant admin or by an organisation import) + * id of the user who created the group (-1 if the group was created by the technical admin or by an organisation import) * * @return createdByUserId */ diff --git a/src/main/java/org/bonitasoft/web/client/model/Membership.java b/src/main/java/org/bonitasoft/web/client/model/Membership.java index c05c8934..1cea02dd 100644 --- a/src/main/java/org/bonitasoft/web/client/model/Membership.java +++ b/src/main/java/org/bonitasoft/web/client/model/Membership.java @@ -113,7 +113,7 @@ public Membership assignedByUserId(String assignedByUserId) { } /** - * id of the user who created the membership (-1 if the role was created by the tenant admin or by an organisation import) + * id of the user who created the membership (-1 if the role was created by the technical admin or by an organisation import) * * @return assignedByUserId */ diff --git a/src/main/java/org/bonitasoft/web/client/model/ProcessInstanceComment.java b/src/main/java/org/bonitasoft/web/client/model/ProcessInstanceComment.java index 4fda1d3c..a1bbd55f 100644 --- a/src/main/java/org/bonitasoft/web/client/model/ProcessInstanceComment.java +++ b/src/main/java/org/bonitasoft/web/client/model/ProcessInstanceComment.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ProcessInstanceComment.JSON_PROPERTY_ID, ProcessInstanceComment.JSON_PROPERTY_CONTENT, - ProcessInstanceComment.JSON_PROPERTY_TENANT_ID, ProcessInstanceComment.JSON_PROPERTY_PROCESS_INSTANCE_ID, ProcessInstanceComment.JSON_PROPERTY_POST_DATE, ProcessInstanceComment.JSON_PROPERTY_USER_ID @@ -45,9 +44,6 @@ public class ProcessInstanceComment implements Serializable { public static final String JSON_PROPERTY_CONTENT = "content"; private String content; - public static final String JSON_PROPERTY_TENANT_ID = "tenantId"; - private String tenantId; - public static final String JSON_PROPERTY_PROCESS_INSTANCE_ID = "processInstanceId"; private String processInstanceId; @@ -110,31 +106,6 @@ public void setContent(String content) { this.content = content; } - public ProcessInstanceComment tenantId(String tenantId) { - - this.tenantId = tenantId; - return this; - } - - /** - * the id of the tenant the comment is associated to - * - * @return tenantId - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TENANT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTenantId() { - return tenantId; - } - - @JsonProperty(JSON_PROPERTY_TENANT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - public ProcessInstanceComment processInstanceId(String processInstanceId) { this.processInstanceId = processInstanceId; @@ -221,7 +192,6 @@ public boolean equals(Object o) { ProcessInstanceComment processInstanceComment = (ProcessInstanceComment) o; return Objects.equals(this.id, processInstanceComment.id) && Objects.equals(this.content, processInstanceComment.content) && - Objects.equals(this.tenantId, processInstanceComment.tenantId) && Objects.equals(this.processInstanceId, processInstanceComment.processInstanceId) && Objects.equals(this.postDate, processInstanceComment.postDate) && Objects.equals(this.userId, processInstanceComment.userId); @@ -229,7 +199,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(id, content, tenantId, processInstanceId, postDate, userId); + return Objects.hash(id, content, processInstanceId, postDate, userId); } @Override @@ -238,7 +208,6 @@ public String toString() { sb.append("class ProcessInstanceComment {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" tenantId: ").append(toIndentedString(tenantId)).append("\n"); sb.append(" processInstanceId: ").append(toIndentedString(processInstanceId)).append("\n"); sb.append(" postDate: ").append(toIndentedString(postDate)).append("\n"); sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); diff --git a/src/main/java/org/bonitasoft/web/client/model/Role.java b/src/main/java/org/bonitasoft/web/client/model/Role.java index 86f8eece..be991d6c 100644 --- a/src/main/java/org/bonitasoft/web/client/model/Role.java +++ b/src/main/java/org/bonitasoft/web/client/model/Role.java @@ -225,7 +225,7 @@ public Role createdByUserId(String createdByUserId) { } /** - * Id of the user who created the role (-1 if the role was created by the tenant admin or by an organisation import) + * Id of the user who created the role (-1 if the role was created by the technical admin or by an organisation import) * * @return createdByUserId */ diff --git a/src/main/java/org/bonitasoft/web/client/model/SystemTenant.java b/src/main/java/org/bonitasoft/web/client/model/SystemTenant.java deleted file mode 100644 index b977f28c..00000000 --- a/src/main/java/org/bonitasoft/web/client/model/SystemTenant.java +++ /dev/null @@ -1,136 +0,0 @@ -/** - * Copyright (C) 2024-2023 BonitaSoft S.A. - * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2.0 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.bonitasoft.web.client.model; - -import java.io.Serializable; -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * - */ -@JsonPropertyOrder({ - SystemTenant.JSON_PROPERTY_ID, - SystemTenant.JSON_PROPERTY_PAUSED -}) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -public class SystemTenant implements Serializable { - - private static final long serialVersionUID = 1L; - - public static final String JSON_PROPERTY_ID = "id"; - private String id; - - public static final String JSON_PROPERTY_PAUSED = "paused"; - private Boolean paused; - - public SystemTenant() { - } - - public SystemTenant id(String id) { - - this.id = id; - return this; - } - - /** - * system tenant id - * - * @return id - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getId() { - return id; - } - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(String id) { - this.id = id; - } - - public SystemTenant paused(Boolean paused) { - - this.paused = paused; - return this; - } - - /** - * whether the system tenant is paused or not - * - * @return paused - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PAUSED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getPaused() { - return paused; - } - - @JsonProperty(JSON_PROPERTY_PAUSED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPaused(Boolean paused) { - this.paused = paused; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SystemTenant systemTenant = (SystemTenant) o; - return Objects.equals(this.id, systemTenant.id) && - Objects.equals(this.paused, systemTenant.paused); - } - - @Override - public int hashCode() { - return Objects.hash(id, paused); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SystemTenant {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" paused: ").append(toIndentedString(paused)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/src/main/java/org/bonitasoft/web/client/model/Tenant.java b/src/main/java/org/bonitasoft/web/client/model/Tenant.java deleted file mode 100644 index ec4c564e..00000000 --- a/src/main/java/org/bonitasoft/web/client/model/Tenant.java +++ /dev/null @@ -1,363 +0,0 @@ -/** - * Copyright (C) 2024-2023 BonitaSoft S.A. - * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2.0 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.bonitasoft.web.client.model; - -import java.io.Serializable; -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Since Bonita 7.12, tenant management is deprecated - * - * @deprecated - */ -@Deprecated -@JsonPropertyOrder({ - Tenant.JSON_PROPERTY_ID, - Tenant.JSON_PROPERTY_CREATION, - Tenant.JSON_PROPERTY_ICON, - Tenant.JSON_PROPERTY_NAME, - Tenant.JSON_PROPERTY_DESCRIPTION, - Tenant.JSON_PROPERTY_USERNAME, - Tenant.JSON_PROPERTY_PASSWORD, - Tenant.JSON_PROPERTY_STATE -}) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -public class Tenant implements Serializable { - - private static final long serialVersionUID = 1L; - - public static final String JSON_PROPERTY_ID = "id"; - private String id; - - public static final String JSON_PROPERTY_CREATION = "creation"; - private String creation; - - public static final String JSON_PROPERTY_ICON = "icon"; - private String icon; - - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_DESCRIPTION = "description"; - private String description; - - public static final String JSON_PROPERTY_USERNAME = "username"; - private String username; - - public static final String JSON_PROPERTY_PASSWORD = "password"; - private String password; - - /** - * the tenant state - */ - public enum StateEnum { - - ACTIVATED("ACTIVATED"), - - DEACTIVATED("DEACTIVATED"); - - private String value; - - StateEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StateEnum fromValue(String value) { - for (StateEnum b : StateEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_STATE = "state"; - private StateEnum state; - - public Tenant() { - } - - public Tenant id(String id) { - - this.id = id; - return this; - } - - /** - * id of the tenant - * - * @return id - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getId() { - return id; - } - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(String id) { - this.id = id; - } - - public Tenant creation(String creation) { - - this.creation = creation; - return this; - } - - /** - * the creation date - * - * @return creation - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CREATION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getCreation() { - return creation; - } - - @JsonProperty(JSON_PROPERTY_CREATION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCreation(String creation) { - this.creation = creation; - } - - public Tenant icon(String icon) { - - this.icon = icon; - return this; - } - - /** - * the path of the icon - * - * @return icon - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ICON) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getIcon() { - return icon; - } - - @JsonProperty(JSON_PROPERTY_ICON) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIcon(String icon) { - this.icon = icon; - } - - public Tenant name(String name) { - - this.name = name; - return this; - } - - /** - * the name of the tenant - * - * @return name - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - public Tenant description(String description) { - - this.description = description; - return this; - } - - /** - * the description - * - * @return description - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DESCRIPTION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getDescription() { - return description; - } - - @JsonProperty(JSON_PROPERTY_DESCRIPTION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDescription(String description) { - this.description = description; - } - - public Tenant username(String username) { - - this.username = username; - return this; - } - - /** - * the username - * - * @return username - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_USERNAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getUsername() { - return username; - } - - @JsonProperty(JSON_PROPERTY_USERNAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUsername(String username) { - this.username = username; - } - - public Tenant password(String password) { - - this.password = password; - return this; - } - - /** - * the password - * - * @return password - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPassword() { - return password; - } - - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPassword(String password) { - this.password = password; - } - - public Tenant state(StateEnum state) { - - this.state = state; - return this; - } - - /** - * the tenant state - * - * @return state - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_STATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public StateEnum getState() { - return state; - } - - @JsonProperty(JSON_PROPERTY_STATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setState(StateEnum state) { - this.state = state; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tenant tenant = (Tenant) o; - return Objects.equals(this.id, tenant.id) && - Objects.equals(this.creation, tenant.creation) && - Objects.equals(this.icon, tenant.icon) && - Objects.equals(this.name, tenant.name) && - Objects.equals(this.description, tenant.description) && - Objects.equals(this.username, tenant.username) && - Objects.equals(this.password, tenant.password) && - Objects.equals(this.state, tenant.state); - } - - @Override - public int hashCode() { - return Objects.hash(id, creation, icon, name, description, username, password, state); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tenant {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" creation: ").append(toIndentedString(creation)).append("\n"); - sb.append(" icon: ").append(toIndentedString(icon)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" password: ").append("*").append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/src/main/java/org/bonitasoft/web/client/model/TenantCreateRequest.java b/src/main/java/org/bonitasoft/web/client/model/TenantCreateRequest.java deleted file mode 100644 index 2310f714..00000000 --- a/src/main/java/org/bonitasoft/web/client/model/TenantCreateRequest.java +++ /dev/null @@ -1,201 +0,0 @@ -/** - * Copyright (C) 2024-2023 BonitaSoft S.A. - * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2.0 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.bonitasoft.web.client.model; - -import java.io.Serializable; -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * Since Bonita 7.12, tenant creation is deprecated - * - * @deprecated - */ -@Deprecated -@JsonPropertyOrder({ - TenantCreateRequest.JSON_PROPERTY_NAME, - TenantCreateRequest.JSON_PROPERTY_DESCRIPTION, - TenantCreateRequest.JSON_PROPERTY_USERNAME, - TenantCreateRequest.JSON_PROPERTY_PASSWORD -}) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -public class TenantCreateRequest implements Serializable { - - private static final long serialVersionUID = 1L; - - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_DESCRIPTION = "description"; - private String description; - - public static final String JSON_PROPERTY_USERNAME = "username"; - private String username; - - public static final String JSON_PROPERTY_PASSWORD = "password"; - private String password; - - public TenantCreateRequest() { - } - - public TenantCreateRequest name(String name) { - - this.name = name; - return this; - } - - /** - * the name of the tenant - * - * @return name - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - public TenantCreateRequest description(String description) { - - this.description = description; - return this; - } - - /** - * the description - * - * @return description - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DESCRIPTION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getDescription() { - return description; - } - - @JsonProperty(JSON_PROPERTY_DESCRIPTION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDescription(String description) { - this.description = description; - } - - public TenantCreateRequest username(String username) { - - this.username = username; - return this; - } - - /** - * the username - * - * @return username - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_USERNAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getUsername() { - return username; - } - - @JsonProperty(JSON_PROPERTY_USERNAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUsername(String username) { - this.username = username; - } - - public TenantCreateRequest password(String password) { - - this.password = password; - return this; - } - - /** - * the password - * - * @return password - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPassword() { - return password; - } - - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPassword(String password) { - this.password = password; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TenantCreateRequest tenantCreateRequest = (TenantCreateRequest) o; - return Objects.equals(this.name, tenantCreateRequest.name) && - Objects.equals(this.description, tenantCreateRequest.description) && - Objects.equals(this.username, tenantCreateRequest.username) && - Objects.equals(this.password, tenantCreateRequest.password); - } - - @Override - public int hashCode() { - return Objects.hash(name, description, username, password); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TenantCreateRequest {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" password: ").append("*").append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/src/main/java/org/bonitasoft/web/client/model/TenantPauseRequest.java b/src/main/java/org/bonitasoft/web/client/model/TenantPauseRequest.java deleted file mode 100644 index 077b67eb..00000000 --- a/src/main/java/org/bonitasoft/web/client/model/TenantPauseRequest.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Copyright (C) 2024-2023 BonitaSoft S.A. - * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2.0 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.bonitasoft.web.client.model; - -import java.io.Serializable; -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * TenantPauseRequest - */ -@JsonPropertyOrder({ - TenantPauseRequest.JSON_PROPERTY_PAUSED -}) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -public class TenantPauseRequest implements Serializable { - - private static final long serialVersionUID = 1L; - - public static final String JSON_PROPERTY_PAUSED = "paused"; - private String paused; - - public TenantPauseRequest() { - } - - public TenantPauseRequest paused(String paused) { - - this.paused = paused; - return this; - } - - /** - * wether the system tenant should be paused or not - * - * @return paused - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PAUSED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPaused() { - return paused; - } - - @JsonProperty(JSON_PROPERTY_PAUSED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPaused(String paused) { - this.paused = paused; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TenantPauseRequest tenantPauseRequest = (TenantPauseRequest) o; - return Objects.equals(this.paused, tenantPauseRequest.paused); - } - - @Override - public int hashCode() { - return Objects.hash(paused); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TenantPauseRequest {\n"); - sb.append(" paused: ").append(toIndentedString(paused)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/src/main/java/org/bonitasoft/web/client/model/TenantUpdateRequest.java b/src/main/java/org/bonitasoft/web/client/model/TenantUpdateRequest.java deleted file mode 100644 index acecd6ac..00000000 --- a/src/main/java/org/bonitasoft/web/client/model/TenantUpdateRequest.java +++ /dev/null @@ -1,301 +0,0 @@ -/** - * Copyright (C) 2024-2023 BonitaSoft S.A. - * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2.0 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.bonitasoft.web.client.model; - -import java.io.Serializable; -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Since Bonita 7.12, tenant update is deprecated - * - * @deprecated - */ -@Deprecated -@JsonPropertyOrder({ - TenantUpdateRequest.JSON_PROPERTY_NAME, - TenantUpdateRequest.JSON_PROPERTY_DESCRIPTION, - TenantUpdateRequest.JSON_PROPERTY_USERNAME, - TenantUpdateRequest.JSON_PROPERTY_PASSWORD, - TenantUpdateRequest.JSON_PROPERTY_ICON, - TenantUpdateRequest.JSON_PROPERTY_STATE -}) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -public class TenantUpdateRequest implements Serializable { - - private static final long serialVersionUID = 1L; - - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_DESCRIPTION = "description"; - private String description; - - public static final String JSON_PROPERTY_USERNAME = "username"; - private String username; - - public static final String JSON_PROPERTY_PASSWORD = "password"; - private String password; - - public static final String JSON_PROPERTY_ICON = "icon"; - private String icon; - - /** - * the tenant state - */ - public enum StateEnum { - - ACTIVATED("ACTIVATED"), - - DEACTIVATED("DEACTIVATED"); - - private String value; - - StateEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StateEnum fromValue(String value) { - for (StateEnum b : StateEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_STATE = "state"; - private StateEnum state; - - public TenantUpdateRequest() { - } - - public TenantUpdateRequest name(String name) { - - this.name = name; - return this; - } - - /** - * the name of the tenant - * - * @return name - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - public TenantUpdateRequest description(String description) { - - this.description = description; - return this; - } - - /** - * the description - * - * @return description - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DESCRIPTION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getDescription() { - return description; - } - - @JsonProperty(JSON_PROPERTY_DESCRIPTION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDescription(String description) { - this.description = description; - } - - public TenantUpdateRequest username(String username) { - - this.username = username; - return this; - } - - /** - * the username - * - * @return username - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_USERNAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getUsername() { - return username; - } - - @JsonProperty(JSON_PROPERTY_USERNAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUsername(String username) { - this.username = username; - } - - public TenantUpdateRequest password(String password) { - - this.password = password; - return this; - } - - /** - * the password - * - * @return password - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPassword() { - return password; - } - - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPassword(String password) { - this.password = password; - } - - public TenantUpdateRequest icon(String icon) { - - this.icon = icon; - return this; - } - - /** - * the path of the icon - * - * @return icon - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ICON) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getIcon() { - return icon; - } - - @JsonProperty(JSON_PROPERTY_ICON) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIcon(String icon) { - this.icon = icon; - } - - public TenantUpdateRequest state(StateEnum state) { - - this.state = state; - return this; - } - - /** - * the tenant state - * - * @return state - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_STATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public StateEnum getState() { - return state; - } - - @JsonProperty(JSON_PROPERTY_STATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setState(StateEnum state) { - this.state = state; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TenantUpdateRequest tenantUpdateRequest = (TenantUpdateRequest) o; - return Objects.equals(this.name, tenantUpdateRequest.name) && - Objects.equals(this.description, tenantUpdateRequest.description) && - Objects.equals(this.username, tenantUpdateRequest.username) && - Objects.equals(this.password, tenantUpdateRequest.password) && - Objects.equals(this.icon, tenantUpdateRequest.icon) && - Objects.equals(this.state, tenantUpdateRequest.state); - } - - @Override - public int hashCode() { - return Objects.hash(name, description, username, password, icon, state); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TenantUpdateRequest {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" password: ").append("*").append("\n"); - sb.append(" icon: ").append(toIndentedString(icon)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/src/main/java/org/bonitasoft/web/client/services/LoginService.java b/src/main/java/org/bonitasoft/web/client/services/LoginService.java index 1c281265..b263fdff 100644 --- a/src/main/java/org/bonitasoft/web/client/services/LoginService.java +++ b/src/main/java/org/bonitasoft/web/client/services/LoginService.java @@ -20,7 +20,7 @@ public interface LoginService { - Session login(String username, String password, String tenant); + Session login(String username, String password); Session getSession(); diff --git a/src/main/java/org/bonitasoft/web/client/services/SystemService.java b/src/main/java/org/bonitasoft/web/client/services/SystemService.java index 4aff497a..d447a27d 100644 --- a/src/main/java/org/bonitasoft/web/client/services/SystemService.java +++ b/src/main/java/org/bonitasoft/web/client/services/SystemService.java @@ -20,7 +20,7 @@ public interface SystemService { - boolean isTenantPaused(); + boolean isMaintenanceModeEnabled(); License getLicense(); diff --git a/src/main/java/org/bonitasoft/web/client/services/impl/DefaultBdmService.java b/src/main/java/org/bonitasoft/web/client/services/impl/DefaultBdmService.java index 637e0006..de4bd4c5 100644 --- a/src/main/java/org/bonitasoft/web/client/services/impl/DefaultBdmService.java +++ b/src/main/java/org/bonitasoft/web/client/services/impl/DefaultBdmService.java @@ -21,22 +21,12 @@ import java.io.File; import java.util.List; -import org.bonitasoft.web.client.BonitaClient; -import org.bonitasoft.web.client.api.BdmAccessControlApi; -import org.bonitasoft.web.client.api.BdmApi; -import org.bonitasoft.web.client.api.BusinessDataQueryApi; +import org.bonitasoft.web.client.api.*; import org.bonitasoft.web.client.api.BusinessDataQueryApi.SearchBusinessDataQueryParams; -import org.bonitasoft.web.client.api.SystemTenantApi; -import org.bonitasoft.web.client.api.UploadApi; import org.bonitasoft.web.client.exception.ClientException; import org.bonitasoft.web.client.exception.LicenseException; import org.bonitasoft.web.client.feign.ApiProvider; -import org.bonitasoft.web.client.model.BDMAccessControl; -import org.bonitasoft.web.client.model.BDMInstallRequest; -import org.bonitasoft.web.client.model.Bdm; -import org.bonitasoft.web.client.model.BusinessData; -import org.bonitasoft.web.client.model.TenantPauseRequest; -import org.bonitasoft.web.client.model.TenantResourceState; +import org.bonitasoft.web.client.model.*; import org.bonitasoft.web.client.services.BdmService; import org.bonitasoft.web.client.services.impl.base.AbstractService; import org.bonitasoft.web.client.services.impl.base.ClientContext; @@ -60,12 +50,11 @@ public DefaultBdmService( public void importBDM(File bdm) { log.info("Importing Business Data Model file: {}", bdm.getName()); - // Pause tenant - log.debug("Pausing tenant ..."); - SystemTenantApi tenantApi = apiProvider.get(SystemTenantApi.class); - tenantApi.updateSystemTenant( - BonitaClient.DEFAULT_TENANT_ID, new TenantPauseRequest().paused("true")); - log.debug("Tenant paused"); + log.debug("Enabling Maintenance mode ..."); + MaintenanceApi maintenanceApi = apiProvider.get(MaintenanceApi.class); + maintenanceApi.updateMaintenanceDetails( + new MaintenanceDetails().maintenanceState(MaintenanceDetails.MaintenanceStateEnum.ENABLED)); + log.debug("Maintenance mode enabled"); deleteBdmAccessControlIfNeeded(); @@ -77,11 +66,10 @@ public void importBDM(File bdm) { bdmApi.installBDM(new BDMInstallRequest().fileUpload(uploadedFileName)); log.debug("BDM file installed"); - // Restart tenant - log.debug("Resuming tenant ..."); - tenantApi.updateSystemTenant( - BonitaClient.DEFAULT_TENANT_ID, new TenantPauseRequest().paused("false")); - log.debug("Tenant Resumed"); + log.debug("Disabling Maintenance mode ..."); + maintenanceApi.updateMaintenanceDetails( + new MaintenanceDetails().maintenanceState(MaintenanceDetails.MaintenanceStateEnum.DISABLED)); + log.debug("Maintenance mode disabled"); log.info("Business Data Model deployed successfully."); } diff --git a/src/main/java/org/bonitasoft/web/client/services/impl/DefaultSystemService.java b/src/main/java/org/bonitasoft/web/client/services/impl/DefaultSystemService.java index f9863107..4a30fe87 100644 --- a/src/main/java/org/bonitasoft/web/client/services/impl/DefaultSystemService.java +++ b/src/main/java/org/bonitasoft/web/client/services/impl/DefaultSystemService.java @@ -17,11 +17,10 @@ package org.bonitasoft.web.client.services.impl; import static java.util.Optional.ofNullable; -import static org.bonitasoft.web.client.BonitaClient.DEFAULT_TENANT_ID; -import org.bonitasoft.web.client.api.SystemTenantApi; +import org.bonitasoft.web.client.api.MaintenanceApi; import org.bonitasoft.web.client.feign.ApiProvider; -import org.bonitasoft.web.client.model.SystemTenant; +import org.bonitasoft.web.client.model.MaintenanceDetails; import org.bonitasoft.web.client.services.SystemService; import org.bonitasoft.web.client.services.impl.base.AbstractService; import org.bonitasoft.web.client.services.impl.base.ClientContext; @@ -39,12 +38,13 @@ public DefaultSystemService( } @Override - public boolean isTenantPaused() { - log.info("Check if tenant is paused"); - SystemTenantApi tenantApi = apiProvider.get(SystemTenantApi.class); - final SystemTenant systemTenant = tenantApi.getSystemTenant(DEFAULT_TENANT_ID); - boolean paused = ofNullable(systemTenant.getPaused()).orElse(false); - log.debug("Tenant paused: {}", paused); - return paused; + public boolean isMaintenanceModeEnabled() { + log.info("Check if Maintenance mode is enabled"); + MaintenanceApi maintenanceApi = apiProvider.get(MaintenanceApi.class); + final MaintenanceDetails maintenanceDetails = maintenanceApi.getMaintenanceDetails(); + MaintenanceDetails.MaintenanceStateEnum maintenanceState = ofNullable(maintenanceDetails.getMaintenanceState()) + .orElse(MaintenanceDetails.MaintenanceStateEnum.DISABLED); + log.debug("Maintenance State: {}", maintenanceState); + return MaintenanceDetails.MaintenanceStateEnum.ENABLED == maintenanceState; } } diff --git a/src/test/java/org/bonitasoft/web/client/BonitaClientIT.java b/src/test/java/org/bonitasoft/web/client/BonitaClientIT.java index 9acad2b1..9bc99483 100644 --- a/src/test/java/org/bonitasoft/web/client/BonitaClientIT.java +++ b/src/test/java/org/bonitasoft/web/client/BonitaClientIT.java @@ -105,7 +105,7 @@ class BonitaClientIT { private static final BonitaContainer> BONITA_CONTAINER = new BonitaContainer<>( BONITA_DOCKER_IMAGE); - private static final Semver _10_2 = new Semver("10.2", SemverType.LOOSE); + private static final Semver _10_2 = new Semver("10.2.0", SemverType.LOOSE); private BonitaClient bonitaClient; diff --git a/src/test/java/org/bonitasoft/web/client/feign/BonitaClientTest.java b/src/test/java/org/bonitasoft/web/client/feign/BonitaClientTest.java index 55392e92..7d2d0f26 100644 --- a/src/test/java/org/bonitasoft/web/client/feign/BonitaClientTest.java +++ b/src/test/java/org/bonitasoft/web/client/feign/BonitaClientTest.java @@ -21,7 +21,6 @@ import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; -import org.bonitasoft.web.client.BonitaClient; import org.bonitasoft.web.client.services.ApplicationService; import org.bonitasoft.web.client.services.BdmService; import org.bonitasoft.web.client.services.LoginService; @@ -63,7 +62,7 @@ void mocks_are_in_place() { } @Test - void when_no_tenant_provided_should_log_with_default_tenant() { + void should_log_in() { // Given client = spy(client); String username = "test"; @@ -73,8 +72,7 @@ void when_no_tenant_provided_should_log_with_default_tenant() { client.login(username, password); // Then - verify(client).login(username, password, BonitaClient.DEFAULT_TENANT_ID); - verify(loginService).login(username, password, BonitaClient.DEFAULT_TENANT_ID); + verify(loginService).login(username, password); } @Test diff --git a/src/test/java/org/bonitasoft/web/client/invoker/auth/BonitaLoginServiceTest.java b/src/test/java/org/bonitasoft/web/client/invoker/auth/BonitaLoginServiceTest.java index 7ecf5069..9ce54de1 100644 --- a/src/test/java/org/bonitasoft/web/client/invoker/auth/BonitaLoginServiceTest.java +++ b/src/test/java/org/bonitasoft/web/client/invoker/auth/BonitaLoginServiceTest.java @@ -19,13 +19,11 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.bonitasoft.web.client.TestUtils.mockResponseBuilder; import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.lenient; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; import java.nio.charset.StandardCharsets; -import org.bonitasoft.web.client.api.PortalAuthenticationApi; +import org.bonitasoft.web.client.api.AuthenticationApi; import org.bonitasoft.web.client.api.SessionApi; import org.bonitasoft.web.client.feign.ApiProvider; import org.bonitasoft.web.client.model.Session; @@ -50,14 +48,14 @@ class BonitaLoginServiceTest { @Mock private BonitaCookieAuth bonitaCookieAuth; @Mock - private PortalAuthenticationApi authenticationApi; + private AuthenticationApi authenticationApi; @Mock private SessionApi sessionApi; @BeforeEach void setUp() { loginService = new BonitaLoginService(apiProvider, objectMapper, bonitaCookieAuth); - lenient().when(apiProvider.get(PortalAuthenticationApi.class)).thenReturn(authenticationApi); + lenient().when(apiProvider.get(AuthenticationApi.class)).thenReturn(authenticationApi); lenient().when(apiProvider.get(SessionApi.class)).thenReturn(sessionApi); } @@ -76,7 +74,7 @@ void login_should_work_with_204_response() throws Exception { final String username = "someone"; final Response loginResponse = mockResponseBuilder().status(204).build(); - when(authenticationApi.login(anyString(), anyString(), anyString(), anyString(), anyString())) + when(authenticationApi.login(anyString(), anyString(), anyString(), anyString())) .thenReturn(loginResponse); final Response sessionResponse = mockResponseBuilder() @@ -86,30 +84,7 @@ void login_should_work_with_204_response() throws Exception { when(sessionApi.getSession()).thenReturn(sessionResponse); // When - final Session session = loginService.login(username, "myPass", "1"); - - // Then - assertThat(session).isNotNull(); - assertThat(session.getUserName()).isEqualTo(username); - } - - @Test - void login_should_work_with_200_response() throws Exception { - // Given - final String username = "someone"; - - final Response loginResponse = mockResponseBuilder().status(200).build(); - when(authenticationApi.login(anyString(), anyString(), anyString(), anyString(), anyString())) - .thenReturn(loginResponse); - - final Response sessionResponse = mockResponseBuilder() - .status(200) - .body(objectMapper.writeValueAsBytes(new Session().userName(username))) - .build(); - when(sessionApi.getSession()).thenReturn(sessionResponse); - - // When - final Session session = loginService.login(username, "myPass", "1"); + final Session session = loginService.login(username, "myPass"); // Then assertThat(session).isNotNull(); diff --git a/src/test/java/org/bonitasoft/web/client/services/impl/DefaultBdmServiceTest.java b/src/test/java/org/bonitasoft/web/client/services/impl/DefaultBdmServiceTest.java index f61e2d46..18bd3137 100644 --- a/src/test/java/org/bonitasoft/web/client/services/impl/DefaultBdmServiceTest.java +++ b/src/test/java/org/bonitasoft/web/client/services/impl/DefaultBdmServiceTest.java @@ -19,25 +19,15 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.bonitasoft.web.client.TestUtils.getClasspathFile; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.lenient; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.*; import java.io.File; -import org.bonitasoft.web.client.BonitaClient; -import org.bonitasoft.web.client.api.BdmAccessControlApi; -import org.bonitasoft.web.client.api.BdmApi; -import org.bonitasoft.web.client.api.BusinessDataQueryApi; -import org.bonitasoft.web.client.api.LicenseApi; -import org.bonitasoft.web.client.api.SystemTenantApi; -import org.bonitasoft.web.client.api.UploadApi; +import org.bonitasoft.web.client.api.*; import org.bonitasoft.web.client.exception.LicenseException; import org.bonitasoft.web.client.feign.ApiProvider; import org.bonitasoft.web.client.model.BDMAccessControl; -import org.bonitasoft.web.client.model.TenantPauseRequest; +import org.bonitasoft.web.client.model.MaintenanceDetails; import org.bonitasoft.web.client.model.TenantResourceState; import org.bonitasoft.web.client.services.impl.base.CachingClientContext; import org.bonitasoft.web.client.services.impl.base.ClientContext; @@ -72,7 +62,7 @@ class DefaultBdmServiceTest { private UploadApi uploadApi; @Mock - private SystemTenantApi tenantApi; + private MaintenanceApi maintenanceApi; @Mock private LicenseApi licenseApi; @@ -87,7 +77,7 @@ void setUp() { new DefaultBdmService(clientContext, apiProvider, new BdmResponseConverter(objectMapper, apiProvider))); lenient().when(apiProvider.get(LicenseApi.class)).thenReturn(licenseApi); - lenient().when(apiProvider.get(SystemTenantApi.class)).thenReturn(tenantApi); + lenient().when(apiProvider.get(MaintenanceApi.class)).thenReturn(maintenanceApi); lenient().when(apiProvider.get(BdmApi.class)).thenReturn(bdmApi); lenient().when(apiProvider.get(BusinessDataQueryApi.class)).thenReturn(bdmQueryApi); lenient().when(apiProvider.get(UploadApi.class)).thenReturn(uploadApi); @@ -105,18 +95,18 @@ void should_import_bdm() throws Exception { bdmService.importBDM(bdmFile); // Then - // tenant paused - verify(tenantApi) - .updateSystemTenant( - BonitaClient.DEFAULT_TENANT_ID, new TenantPauseRequest().paused("true")); + // maintenance mode + verify(maintenanceApi) + .updateMaintenanceDetails( + new MaintenanceDetails().maintenanceState(MaintenanceDetails.MaintenanceStateEnum.ENABLED)); verify(bdmService).deleteBdmAccessControlIfNeeded(); // bdm installed verify(uploadApi).uploadFile(any()); verify(bdmApi).installBDM(any()); - // tenant restarted - verify(tenantApi) - .updateSystemTenant( - BonitaClient.DEFAULT_TENANT_ID, new TenantPauseRequest().paused("false")); + // maintenance mode disabled + verify(maintenanceApi) + .updateMaintenanceDetails( + new MaintenanceDetails().maintenanceState(MaintenanceDetails.MaintenanceStateEnum.DISABLED)); } @Test diff --git a/src/test/java/org/bonitasoft/web/client/services/impl/DefaultSystemServiceTest.java b/src/test/java/org/bonitasoft/web/client/services/impl/DefaultSystemServiceTest.java index 77af4edd..c64a02eb 100644 --- a/src/test/java/org/bonitasoft/web/client/services/impl/DefaultSystemServiceTest.java +++ b/src/test/java/org/bonitasoft/web/client/services/impl/DefaultSystemServiceTest.java @@ -17,13 +17,12 @@ package org.bonitasoft.web.client.services.impl; import static org.assertj.core.api.Assertions.assertThat; -import static org.bonitasoft.web.client.BonitaClient.DEFAULT_TENANT_ID; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import org.bonitasoft.web.client.api.SystemTenantApi; +import org.bonitasoft.web.client.api.MaintenanceApi; import org.bonitasoft.web.client.feign.ApiProvider; -import org.bonitasoft.web.client.model.SystemTenant; +import org.bonitasoft.web.client.model.MaintenanceDetails; import org.bonitasoft.web.client.services.impl.base.CachingClientContext; import org.bonitasoft.web.client.services.impl.base.ClientContext; import org.junit.jupiter.api.BeforeEach; @@ -52,28 +51,28 @@ void setUp() { } @Test - void should_return_tenant_status() { + void should_return_maintenance_mode() { // Given - final SystemTenantApi systemTenantApi = mock(SystemTenantApi.class); - when(apiProvider.get(SystemTenantApi.class)).thenReturn(systemTenantApi); - when(systemTenantApi.getSystemTenant(DEFAULT_TENANT_ID)) - .thenReturn(new SystemTenant().paused(true)); + final MaintenanceApi maintenanceApi = mock(MaintenanceApi.class); + when(apiProvider.get(MaintenanceApi.class)).thenReturn(maintenanceApi); + when(maintenanceApi.getMaintenanceDetails()) + .thenReturn(new MaintenanceDetails().maintenanceState(MaintenanceDetails.MaintenanceStateEnum.ENABLED)); // When - final boolean tenantPaused = systemService.isTenantPaused(); + final boolean isMaintenanceModeEnabled = systemService.isMaintenanceModeEnabled(); // Then - assertThat(tenantPaused).isTrue(); + assertThat(isMaintenanceModeEnabled).isTrue(); } @Test - void should_return_false_if_tenant_status_not_set() { + void should_return_false_if_maintenance_mode_not_set() { // Given - final SystemTenantApi systemTenantApi = mock(SystemTenantApi.class); - when(apiProvider.get(SystemTenantApi.class)).thenReturn(systemTenantApi); - when(systemTenantApi.getSystemTenant(DEFAULT_TENANT_ID)) - .thenReturn(new SystemTenant().paused(null)); + final MaintenanceApi maintenanceApi = mock(MaintenanceApi.class); + when(apiProvider.get(MaintenanceApi.class)).thenReturn(maintenanceApi); + when(maintenanceApi.getMaintenanceDetails()) + .thenReturn(new MaintenanceDetails().maintenanceState(null)); // When - final boolean tenantPaused = systemService.isTenantPaused(); + final boolean isMaintenanceModeEnabled = systemService.isMaintenanceModeEnabled(); // Then - assertThat(tenantPaused).isFalse(); + assertThat(isMaintenanceModeEnabled).isFalse(); } } diff --git a/src/test/resources/application.xml b/src/test/resources/application.xml index 93bfcdb7..a1ed35a5 100644 --- a/src/test/resources/application.xml +++ b/src/test/resources/application.xml @@ -1,5 +1,5 @@ - + + Date: Fri, 21 Feb 2025 16:19:24 +0100 Subject: [PATCH 2/2] update default container version for tests --- .../java/org/bonitasoft/testcontainers/BonitaContainer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/bonitasoft/testcontainers/BonitaContainer.java b/src/test/java/org/bonitasoft/testcontainers/BonitaContainer.java index f638eaa7..23c0c394 100644 --- a/src/test/java/org/bonitasoft/testcontainers/BonitaContainer.java +++ b/src/test/java/org/bonitasoft/testcontainers/BonitaContainer.java @@ -46,7 +46,7 @@ public class BonitaContainer> extends Generic public static final String BONITA_CONTEXT_PATH = "bonita.context-path"; public static final String BONITA_CONTEXT_PATH_DEFAULT = "/bonita"; public static final String BONITA_VERSION = "bonita.version"; - public static final String BONITA_VERSION_DEFAULT = "7.15"; + public static final String BONITA_VERSION_DEFAULT = "9.0"; public static final String BONITA_IMAGE_NAME = "bonita.image.name"; public static final String BONITA_IMAGE_NAME_DEFAULT = "bonita"; public static final String BONITA_IMAGE_PREFIX = "bonita.image.prefix";