Skip to content

Commit

Permalink
Merge pull request #393 from Backbase/feature/upgrade-SSDK-16-and-202…
Browse files Browse the repository at this point in the history
…3-12

[develop] Upgrade to SSDK 16 and 2023.12
  • Loading branch information
uesleilima authored Dec 28, 2023
2 parents 4cdb6a0 + 39c3bec commit 66b47e1
Show file tree
Hide file tree
Showing 267 changed files with 3,750 additions and 2,023 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog
All notable changes to this project will be documented in this file.

## [4.0.0](https://github.com/Backbase/stream-services/compare/4.0.0...3.70.0)
### Changed
- Bumping Service SDK to **16.0.1**
- Multiple breaking changes were introduced as part of this upgrade, including Spring Boot 3 upgrade, replacing Spring Sleuth by Micrometer and modules structure for the Composition Events.
- Bumping Banking Services clients to **2023.12**

## [3.70.0](https://github.com/Backbase/stream-services/compare/3.69.0...3.70.0)
### Added
- Support to Events via Azure Service Bus for the Stream Composition Services
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ You can find listed here the API specification containing the opinionated model

| Stream [version](https://github.com/Backbase/stream-services/releases) | DBS version | Java version |
|------------------------------------------------------------------------|--------------------|--------------|
| 3.70.0 to latest | 2023.09-LTS | 17 |
| 4.0.0 to latest | 2023.12 | 17 |
| 3.70.0 to 3.x.x | 2023.09-LTS | 17 |
| 3.50.0 to 3.69.0 | 2023.06 | 17 |
| 3.34.0 to 3.49.0 | 2023.02-LTS | 17 |
| 3.16.0 to 3.33.0 | 2022.10 | 17 |
Expand Down
16 changes: 6 additions & 10 deletions api/stream-legal-entity/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ components:
referenceJobRoles:
type: array
items:
$ref: '#/components/schemas/ReferenceJobRole'
$ref: '#/components/schemas/JobRole'
administrators:
type: array
items:
Expand Down Expand Up @@ -1670,7 +1670,7 @@ components:
title: External Identifier
maxLength: 64
minLength: 1
pattern: ^[^\r\n]{1,64}$
# pattern: ^{1,64}$
type: string
description: External legal entity identifier.
UrgentTransfer:
Expand Down Expand Up @@ -2193,7 +2193,7 @@ components:
maxLength: 255
type: string
description: Email-id of the contact
format: email
# format: email
addressLine1:
maxLength: 70
type: string
Expand Down Expand Up @@ -2361,7 +2361,7 @@ components:
type: string
description: "An email account identifier. At least one of the account identifiers\
\ (accountNumber, IBAN, phoneNumber or email) is mandatory."
format: email
# format: email
Additions:
title: Additions
type: object
Expand Down Expand Up @@ -2856,12 +2856,8 @@ components:
required:
- name
- description
ReferenceJobRole:
title: "Reference Job Role"
allOf:
- $ref: '#/components/schemas/JobRole'
UpdatedServiceAgreement:
title: "Updated Service Agreement"
description: "Updated Service Agreement"
allOf:
- $ref: '#/components/schemas/ServiceAgreement'
properties:
Expand All @@ -2879,10 +2875,10 @@ components:
$ref: '#/components/schemas/ServiceAgreementUserAction'
ServiceAgreementUserAction:
title: "Service Agreement user update action"
description: User and job roles to associate under service agreement
properties:
userProfile:
$ref: '#/components/schemas/JobProfileUser'
description: User and job roles to associate under service agreement
action:
type: string
description: add or remove user from service agreement
Expand Down
3 changes: 3 additions & 0 deletions api/stream-portfolio/schemas/v1/instrument-history-price.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ properties:
type: string
description: Date for the instrument price.
format: date
# TODO: upgrade input data
# description: Date time for the instrument price.
# format: date-time
priceType:
type: string
description: Type of the price. Can be opening, closing, minimal or maximal.
Expand Down
6 changes: 3 additions & 3 deletions e2e-tests/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
BB_VERSION=2023.09.17-LTS
STREAM_VERSION=3.69.0
STREAM_REGISTRY=repo.backbase.com/backbase-stream-images
BB_VERSION=2023.12
STREAM_VERSION=4.0.0-SNAPSHOT
STREAM_REGISTRY=harbor.backbase.eu/development
12 changes: 9 additions & 3 deletions e2e-tests/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ x-common-variables: &common-variables
eureka.client.instance-info-replication-interval-seconds: 15
eureka.instance.non-secure-port: 8080
eureka.instance.initialStatus: STARTING
management.endpoints.web.exposure.include: '*'
management.endpoints.enabled-by-default: true
management.security.roles: ANONYMOUS,ACTUATOR
management.endpoint.env.show-values: ALWAYS
management.endpoint.configprops.show-values: ALWAYS
management.tracing.enabled: false
backbase.multi-tenancy.enabled: true
backbase.multi-tenancy.tenants[0].id: t1
backbase.multi-tenancy.tenants[1].id: t2
spring.main.banner-mode: off
spring.zipkin.enabled: false
spring.cloud.config.enabled: false
spring.cloud.kubernetes.enabled: false
backbase.audit.enabled: false
Expand All @@ -30,7 +35,6 @@ x-database-variables: &database-variables
spring.datasource.password: root
spring.datasource.url: jdbc:mysql://mysql:3306?useSSL=false&allowPublicKeyRetrieval=true&cacheServerConfiguration=true
spring.datasource.driver-class-name: com.mysql.cj.jdbc.Driver
spring.jpa.properties.hibernate.dialect: org.hibernate.dialect.MySQL8Dialect
backbase.multi-tenancy.datasource.strategy: SWITCH_CATALOG

x-message-broker-variables: &message-broker-variables
Expand Down Expand Up @@ -246,7 +250,8 @@ services:
bootstrap.enabled: true
backbase.stream.client.additional-headers.x-tid: t1
spring.cloud.discovery.client.simple.instances.legal-entity-integration[0].uri: http://wiremock:8080
backbase.stream.compositions.legal-entity.chains.product-composition.enabled: false
backbase.stream.compositions.legal-entity.chains.product-composition.enabled: true
backbase.stream.compositions.legal-entity.chains.product-composition.async: true
volumes:
- ./utils/HealthCheck.java:/tmp/HealthCheck.java
healthcheck:
Expand Down Expand Up @@ -336,6 +341,7 @@ services:
environment:
<<: [ *common-variables, *message-broker-variables ]
spring.cloud.discovery.client.simple.instances.product-integration[0].uri: http://wiremock:8080
backbase.stream.compositions.product.chains.transaction-manager.enabled: true
backbase.stream.compositions.product.chains.transaction-composition.enabled: false
backbase.stream.compositions.product.chains.payment-order-composition.enabled: false
volumes:
Expand Down
24 changes: 12 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<parent>
<groupId>com.backbase.buildingblocks</groupId>
<artifactId>backbase-parent</artifactId>
<version>15.2.4</version>
<relativePath />
<version>16.0.1</version>
<relativePath/>
</parent>

<groupId>com.backbase.stream</groupId>
Expand All @@ -31,16 +31,16 @@
<module>stream-payment-order</module>
<module>stream-portfolio</module>
<module>stream-contacts</module>
<module>stream-compositions</module>
<module>stream-loans</module>
<module>stream-audiences</module>
<module>stream-compositions</module>
</modules>

<properties>
<java.version>17</java.version>
<ssdk.version>15.2.4</ssdk.version>
<backbase-bom.version>2023.09.17-LTS</backbase-bom.version>
<boat-maven-plugin.version>0.16.6</boat-maven-plugin.version>
<ssdk.version>16.0.1</ssdk.version>
<backbase-bom.version>2023.12</backbase-bom.version>
<boat-maven-plugin.version>0.17.26</boat-maven-plugin.version>
<spring-boot.repackage.skip>true</spring-boot.repackage.skip>
<openapi-generator-maven-plugin.language>spring</openapi-generator-maven-plugin.language>
<openapi-generator-maven-plugin.library>spring-boot</openapi-generator-maven-plugin.library>
Expand All @@ -55,18 +55,18 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>22.0.0</version>
</dependency>
<dependency>
<groupId>com.backbase.buildingblocks</groupId>
<artifactId>backbase-building-blocks-release</artifactId>
<version>${ssdk.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>22.0.0</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand All @@ -92,10 +92,10 @@
<executions>
<execution>
<id>add-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<sources>
<source>${annotations.generated-sources-dir}</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public interface ParticipantMapper {

@AfterMapping
default void afterMapping(ServiceAgreement serviceAgreement,
@MappingTarget PresentationParticipantBatchUpdate participants) {
@MappingTarget PresentationParticipantBatchUpdate participants) {
if (participants.getParticipants() != null) {
participants.getParticipants().forEach(participant ->
participant.setExternalServiceAgreementId(serviceAgreement.getExternalId()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
import com.backbase.stream.legalentity.model.LegalEntityParticipant;
import com.backbase.stream.legalentity.model.Privilege;
import com.backbase.stream.legalentity.model.ProductGroup;
import com.backbase.stream.legalentity.model.ReferenceJobRole;
import com.backbase.stream.legalentity.model.JobRole;
import com.backbase.stream.legalentity.model.ServiceAgreement;
import com.backbase.stream.legalentity.model.ServiceAgreementUserAction;
import com.backbase.stream.legalentity.model.User;
Expand All @@ -69,7 +69,7 @@
import com.backbase.stream.utils.BatchResponseUtils;
import com.backbase.stream.worker.exception.StreamTaskException;
import com.backbase.stream.worker.model.StreamTask;
import java.math.BigDecimal;
import jakarta.validation.constraints.NotNull;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -87,7 +87,6 @@
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.validation.constraints.NotNull;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -184,7 +183,7 @@ public Mono<ServiceAgreement> updateServiceAgreementItem(StreamTask streamTask,
log.info("Updating Service Agreement with external Id: {}", serviceAgreement.getExternalId());
ServiceAgreementPut serviceAgreementPut = accessGroupMapper.toPresentationPut(serviceAgreement);
return serviceAgreementsApi.putServiceAgreementItem(serviceAgreement.getInternalId(), serviceAgreementPut)
.onErrorResume(HttpClientErrorException.class, throwable -> {
.onErrorResume(WebClientResponseException.class, throwable -> {
log.error(SERVICE_AGREEMENT, "update", "failed", serviceAgreement.getExternalId(),
"", throwable, throwable.getResponseBodyAsString(), "Failed to update Service Agreement");
return Mono.error(new StreamTaskException(streamTask, throwable, "Failed to update Service Agreement"));
Expand Down Expand Up @@ -1185,7 +1184,7 @@ private Mono<JobRole> createJobRole(StreamTask streamTask, ServiceAgreement serv
presentationIngestFunctionGroup.setExternalServiceAgreementId(serviceAgreement.getExternalId());
presentationIngestFunctionGroup.setMetadata(jobRole.getMetadata());

if(jobRole instanceof ReferenceJobRole) {
if(jobRole instanceof JobRole) {
log.debug("Creating a Reference Job Role.");
presentationIngestFunctionGroup.setType(PresentationIngestFunctionGroup.TypeEnum.TEMPLATE);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,49 @@
package com.backbase.stream.service;

import static java.util.Objects.requireNonNullElse;
import static java.util.Optional.ofNullable;

import com.backbase.dbs.user.api.service.v2.IdentityManagementApi;
import com.backbase.dbs.user.api.service.v2.UserManagementApi;
import com.backbase.dbs.user.api.service.v2.UserProfileManagementApi;
import com.backbase.dbs.user.api.service.v2.model.*;
import com.backbase.dbs.user.api.service.v2.model.AddRealmRequest;
import com.backbase.dbs.user.api.service.v2.model.AssignRealm;
import com.backbase.dbs.user.api.service.v2.model.BatchResponseItem;
import com.backbase.dbs.user.api.service.v2.model.BatchUser;
import com.backbase.dbs.user.api.service.v2.model.CreateIdentityRequest;
import com.backbase.dbs.user.api.service.v2.model.CreateIdentityResponse;
import com.backbase.dbs.user.api.service.v2.model.GetUser;
import com.backbase.dbs.user.api.service.v2.model.GetUsersByLegalEntityIdsRequest;
import com.backbase.dbs.user.api.service.v2.model.GetUsersList;
import com.backbase.dbs.user.api.service.v2.model.ImportIdentity;
import com.backbase.dbs.user.api.service.v2.model.Realm;
import com.backbase.dbs.user.api.service.v2.model.UpdateIdentityRequest;
import com.backbase.dbs.user.api.service.v2.model.UserCreated;
import com.backbase.dbs.user.api.service.v2.model.UserExternal;
import com.backbase.dbs.user.api.service.v2.model.UserProfile;
import com.backbase.identity.integration.api.service.v1.IdentityIntegrationServiceApi;
import com.backbase.identity.integration.api.service.v1.model.EnhancedUserRepresentation;
import com.backbase.identity.integration.api.service.v1.model.UserRequestBody;
import com.backbase.stream.exceptions.UserUpsertException;
import com.backbase.stream.legalentity.model.EmailAddress;
import com.backbase.stream.legalentity.model.IdentityUserLinkStrategy;
import com.backbase.stream.legalentity.model.LegalEntity;
import com.backbase.stream.legalentity.model.PhoneNumber;
import com.backbase.stream.legalentity.model.User;
import com.backbase.stream.legalentity.model.*;
import com.backbase.stream.mapper.RealmMapper;
import com.backbase.stream.mapper.UserMapper;
import com.backbase.stream.worker.exception.StreamTaskException;
import com.backbase.stream.worker.model.StreamTask;
import jakarta.validation.constraints.NotNull;
import java.text.MessageFormat;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.UUID;
import java.util.stream.Collectors;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.mapstruct.factory.Mappers;
Expand All @@ -26,14 +54,6 @@
import org.springframework.web.reactive.function.client.WebClientResponseException;
import reactor.core.publisher.Mono;

import javax.validation.constraints.NotNull;
import java.text.MessageFormat;
import java.util.*;
import java.util.stream.Collectors;

import static java.util.Objects.requireNonNullElse;
import static java.util.Optional.ofNullable;

/**
* Stream User Management. Still needs to be adapted to use Identity correctly
*/
Expand Down Expand Up @@ -318,7 +338,7 @@ public Mono<User> createOrImportIdentityUser(User user, String legalEntityIntern

private Mono<User> updateIdentityUser(User user, StreamTask streamTask) {
if (IdentityUserLinkStrategy.IMPORT_FROM_IDENTIY.equals(user.getIdentityLinkStrategy())
&& (user.getAttributes() != null || user.getAdditions() != null)) {
&& (!CollectionUtils.isEmpty(user.getAttributes()) || !CollectionUtils.isEmpty(user.getAdditions()))) {
UpdateIdentityRequest replaceIdentity = new UpdateIdentityRequest();
replaceIdentity.attributes(user.getAttributes());
replaceIdentity.additions(user.getAdditions());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.backbase.stream.service;

import static com.backbase.dbs.accesscontrol.api.service.v3.model.BatchResponseItemExtended.StatusEnum.HTTP_STATUS_BAD_REQUEST;
import static com.backbase.dbs.accesscontrol.api.service.v3.model.BatchResponseItemExtended.StatusEnum.HTTP_STATUS_INTERNAL_SERVER_ERROR;
import static com.backbase.dbs.accesscontrol.api.service.v3.model.BatchResponseItemExtended.StatusEnum.HTTP_STATUS_OK;
import static com.backbase.dbs.accesscontrol.api.service.v3.model.PresentationAction.ADD;
Expand Down Expand Up @@ -74,6 +75,8 @@
import org.mockito.Spy;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.HttpStatusCode;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import org.springframework.web.client.HttpClientErrorException;
import reactor.core.publisher.Flux;
Expand Down Expand Up @@ -700,7 +703,7 @@ void testUpdateServiceAgreementItemFailed() {
serviceAgreement.setInternalId("internal-id");

when(serviceAgreementsApi.putServiceAgreementItem(any(), any()))
.thenReturn(Mono.error(new HttpClientErrorException(BAD_REQUEST, "Bad request", null, null, null)));
.thenReturn(Mono.error(new WebClientResponseException(BAD_REQUEST, "Bad request", null, null, null, null)));

Mono<ServiceAgreement> resultMono = subject.updateServiceAgreementItem(streamTask, serviceAgreement);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void setupJobRole() {
.apsId(1L)
.name("jobRoleNew")
.description("jobRoleNew")
.type(PresentationIngestFunctionGroup.TypeEnum.REGULAR)
.type(PresentationIngestFunctionGroup.TypeEnum.TEMPLATE)
.metadata(Map.of("key1","value1"))
.addPermissionsItem(new PresentationPermission()
.functionId("101")
Expand Down
1 change: 1 addition & 0 deletions stream-approvals/approvals-bootstrap-task/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

<properties>
<checkstyle.disable.checks>true</checkstyle.disable.checks>
<archunit.backbase.LoggingRules.skip>true</archunit.backbase.LoggingRules.skip>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.backbase.stream.config;

import com.backbase.stream.approval.model.Approval;
import jakarta.validation.constraints.NotNull;
import java.util.List;
import javax.validation.constraints.NotNull;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
Expand Down
Loading

0 comments on commit 66b47e1

Please sign in to comment.