From 699e16c7663beaffc5e85ef194f61d050b6e83d8 Mon Sep 17 00:00:00 2001 From: Roman Kniazevych Date: Fri, 15 Dec 2023 16:52:39 +0200 Subject: [PATCH] fix stream compile execution --- .../stream/service/AccessGroupService.java | 2 +- .../legal-entity-integration-api/pom.xml | 25 ++++++++++++ .../src/main/resources/service-api-v2.yaml | 14 +++---- .../legal-entity-composition-api/pom.xml | 29 +++++++++++++- .../src/main/resources/service-api-v2.yaml | 16 ++++---- stream-compositions/pom.xml | 6 +++ .../LegalEntityIngestionServiceImplTest.java | 4 +- ...LegalEntityIntegrationServiceImplTest.java | 8 ++-- .../http/LegalEntityControllerIT.java | 2 +- .../http/LegalEntityControllerTest.java | 4 +- .../http/ProductCatalogControllerTest.java | 3 +- .../mapper/ArrangementRestMapperTest.java | 16 ++++---- .../product/core/mapper/ConfigMapperTest.java | 10 ++--- ...ArrangementIntegrationServiceImplTest.java | 6 +-- .../impl/ProductIngestionServiceImplTest.java | 8 ++-- .../ProductIntegrationServiceImplTest.java | 10 ++--- .../TransactionIngestionServiceImplTest.java | 8 ++-- .../product/http/ProductControllerIT.java | 38 +++++++++---------- .../core/mapper/TransactionMapperTest.java | 1 - stream-compositions/test-utils/pom.xml | 6 +-- 20 files changed, 131 insertions(+), 85 deletions(-) diff --git a/stream-access-control/access-control-core/src/main/java/com/backbase/stream/service/AccessGroupService.java b/stream-access-control/access-control-core/src/main/java/com/backbase/stream/service/AccessGroupService.java index 58ae2edcc..9630c4d13 100644 --- a/stream-access-control/access-control-core/src/main/java/com/backbase/stream/service/AccessGroupService.java +++ b/stream-access-control/access-control-core/src/main/java/com/backbase/stream/service/AccessGroupService.java @@ -183,7 +183,7 @@ public Mono 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")); diff --git a/stream-compositions/api/integrations-api/legal-entity-integration-api/pom.xml b/stream-compositions/api/integrations-api/legal-entity-integration-api/pom.xml index 8bb096ca5..f0f4b9949 100644 --- a/stream-compositions/api/integrations-api/legal-entity-integration-api/pom.xml +++ b/stream-compositions/api/integrations-api/legal-entity-integration-api/pom.xml @@ -39,6 +39,31 @@ + + org.apache.maven.plugins + maven-resources-plugin + 3.3.1 + + + copy-realm + validate + + copy-resources + + + + + ../../../../api/stream-legal-entity + + openapi.yaml + + + + ${project.build.directory}/copy + + + + com.backbase.oss boat-maven-plugin diff --git a/stream-compositions/api/integrations-api/legal-entity-integration-api/src/main/resources/service-api-v2.yaml b/stream-compositions/api/integrations-api/legal-entity-integration-api/src/main/resources/service-api-v2.yaml index 9e1e01562..841fd8997 100644 --- a/stream-compositions/api/integrations-api/legal-entity-integration-api/src/main/resources/service-api-v2.yaml +++ b/stream-compositions/api/integrations-api/legal-entity-integration-api/src/main/resources/service-api-v2.yaml @@ -55,23 +55,23 @@ components: type: object properties: legalEntityExternalId: - $ref: '../../../../../../../api/stream-legal-entity/openapi.yaml#/components/schemas/LegalEntity/properties/externalId' + $ref: '../../../target/copy/openapi.yaml#/components/schemas/LegalEntity/properties/externalId' taxId: type: string description: The Tax ID associated with the legal entity userExternalId: - $ref: '../../../../../../../api/stream-legal-entity/openapi.yaml#/components/schemas/User/properties/externalId' + $ref: '../../../target/copy/openapi.yaml#/components/schemas/User/properties/externalId' parentLegalEntityExternalId: - $ref: '../../../../../../../api/stream-legal-entity/openapi.yaml#/components/schemas/LegalEntity/properties/parentExternalId' + $ref: '../../../target/copy/openapi.yaml#/components/schemas/LegalEntity/properties/parentExternalId' realmName: - $ref: '../../../../../../../api/stream-legal-entity/openapi.yaml#/components/schemas/LegalEntity/properties/realmName' + $ref: '../../../target/copy/openapi.yaml#/components/schemas/LegalEntity/properties/realmName' referenceJobRoleNames: - $ref: '../../../../../../../api/stream-legal-entity/openapi.yaml#/components/schemas/JobProfileUser/properties/referenceJobRoleNames' + $ref: '../../../target/copy/openapi.yaml#/components/schemas/JobProfileUser/properties/referenceJobRoleNames' isAdmin: type: boolean description: Indicates if the user is an administrator on the Legal Entity identityUserLinkStrategy: - $ref: '../../../../../../../api/stream-legal-entity/openapi.yaml#/components/schemas/IdentityUserLinkStrategy' + $ref: '../../../target/copy/openapi.yaml#/components/schemas/IdentityUserLinkStrategy' additions: type: object additionalProperties: @@ -81,7 +81,7 @@ components: type: object properties: legalEntity: - $ref: '../../../../../../../api/stream-legal-entity/openapi.yaml#/components/schemas/LegalEntity' + $ref: '../../../target/copy/openapi.yaml#/components/schemas/LegalEntity' membershipAccounts: type: array items: diff --git a/stream-compositions/api/service-api/legal-entity-composition-api/pom.xml b/stream-compositions/api/service-api/legal-entity-composition-api/pom.xml index 84be6d949..bf27c8750 100644 --- a/stream-compositions/api/service-api/legal-entity-composition-api/pom.xml +++ b/stream-compositions/api/service-api/legal-entity-composition-api/pom.xml @@ -38,6 +38,31 @@ + + org.apache.maven.plugins + maven-resources-plugin + 3.3.1 + + + copy-realm + validate + + copy-resources + + + + + ../../../../api/stream-legal-entity + + openapi.yaml + + + + ${project.build.directory}/copy + + + + com.backbase.oss boat-maven-plugin @@ -45,7 +70,7 @@ boat-validation - prepare-package + generate-sources validate @@ -59,7 +84,7 @@ bundle - prepare-package + generate-sources ${project.basedir}/src/main/resources ${project.build.directory} diff --git a/stream-compositions/api/service-api/legal-entity-composition-api/src/main/resources/service-api-v2.yaml b/stream-compositions/api/service-api/legal-entity-composition-api/src/main/resources/service-api-v2.yaml index eefa7c619..6f51c087e 100644 --- a/stream-compositions/api/service-api/legal-entity-composition-api/src/main/resources/service-api-v2.yaml +++ b/stream-compositions/api/service-api/legal-entity-composition-api/src/main/resources/service-api-v2.yaml @@ -88,23 +88,23 @@ components: type: object properties: legalEntityExternalId: - $ref: '../../../../../../../api/stream-legal-entity/openapi.yaml#/components/schemas/LegalEntity/properties/externalId' + $ref: '../../../target/copy/openapi.yaml#/components/schemas/LegalEntity/properties/externalId' taxId: type: string description: The Tax ID associated with the legal entity userExternalId: - $ref: '../../../../../../../api/stream-legal-entity/openapi.yaml#/components/schemas/User/properties/externalId' + $ref: '../../../target/copy/openapi.yaml#/components/schemas/User/properties/externalId' parentLegalEntityExternalId: - $ref: '../../../../../../../api/stream-legal-entity/openapi.yaml#/components/schemas/LegalEntity/properties/parentExternalId' + $ref: '../../../target/copy/openapi.yaml#/components/schemas/LegalEntity/properties/parentExternalId' realmName: - $ref: '../../../../../../../api/stream-legal-entity/openapi.yaml#/components/schemas/LegalEntity/properties/realmName' + $ref: '../../../target/copy/openapi.yaml#/components/schemas/LegalEntity/properties/realmName' referenceJobRoleNames: - $ref: '../../../../../../../api/stream-legal-entity/openapi.yaml#/components/schemas/JobProfileUser/properties/referenceJobRoleNames' + $ref: '../../../target/copy/openapi.yaml#/components/schemas/JobProfileUser/properties/referenceJobRoleNames' isAdmin: type: boolean description: Indicates if the user is an administrator on the Legal Entity identityUserLinkStrategy: - $ref: '../../../../../../../api/stream-legal-entity/openapi.yaml#/components/schemas/IdentityUserLinkStrategy' + $ref: '../../../target/copy/openapi.yaml#/components/schemas/IdentityUserLinkStrategy' productChainEnabled: type: boolean description: Flag to indicate if Product Ingestion should follow Legal Entity Ingestion @@ -117,13 +117,13 @@ components: type: object properties: legalEntity: - $ref: '../../../../../../../api/stream-legal-entity/openapi.yaml#/components/schemas/LegalEntity' + $ref: '../../../target/copy/openapi.yaml#/components/schemas/LegalEntity' LegalEntityIngestionResponse: type: object properties: legalEntity: - $ref: '../../../../../../../api/stream-legal-entity/openapi.yaml#/components/schemas/LegalEntity' + $ref: '../../../target/copy/openapi.yaml#/components/schemas/LegalEntity' membershipAccounts: type: array items: diff --git a/stream-compositions/pom.xml b/stream-compositions/pom.xml index e80404a57..2a3b15aa2 100644 --- a/stream-compositions/pom.xml +++ b/stream-compositions/pom.xml @@ -37,6 +37,12 @@ 16.0.1 3.0.2 /tmp + true + true + true + true + true + true diff --git a/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/core/service/impl/LegalEntityIngestionServiceImplTest.java b/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/core/service/impl/LegalEntityIngestionServiceImplTest.java index e2a4ac13c..05392b372 100644 --- a/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/core/service/impl/LegalEntityIngestionServiceImplTest.java +++ b/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/core/service/impl/LegalEntityIngestionServiceImplTest.java @@ -105,10 +105,10 @@ void ingestionInPullModeSync_Success(TestInfo testInfo) { when(config.getChains().getIncludeSubsidiaries()).thenReturn(Boolean.TRUE); when(productCompositionApi.pullIngestProduct(any())) .thenReturn(Mono.just(new ProductIngestionResponse() - .withProductGroups( + .productGroups( Arrays.asList((com.backbase.stream.compositions.product.client.model.ProductGroup) new com.backbase.stream.compositions.product.client.model.ProductGroup() - .withCurrentAccounts(List.of(new CurrentAccount().withBBAN("test BBAN"))))))); + .currentAccounts(List.of(new CurrentAccount().BBAN("test BBAN"))))))); Mono legalEntityIngestResponseMono = executeIngestionWithPullMode( Boolean.valueOf(tags.get(0)), Boolean.TRUE, Boolean.TRUE); diff --git a/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/core/service/impl/LegalEntityIntegrationServiceImplTest.java b/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/core/service/impl/LegalEntityIntegrationServiceImplTest.java index a022ba900..1c5ca48ee 100644 --- a/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/core/service/impl/LegalEntityIntegrationServiceImplTest.java +++ b/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/core/service/impl/LegalEntityIntegrationServiceImplTest.java @@ -43,14 +43,14 @@ void setUp() { @Test void callLE() throws UnsupportedOperationException { String leName = "Legal Entity 1"; - LegalEntity legalEntity1 = new LegalEntity().withName(leName); + LegalEntity legalEntity1 = new LegalEntity().name(leName); com.backbase.stream.legalentity.model.LegalEntity legalEntity2 = new com.backbase.stream.legalentity.model.LegalEntity().name(leName); List membershipAccounts = Collections.singletonList("012"); LegalEntityResponse res1 = new LegalEntityResponse(Boolean.TRUE, legalEntity2, membershipAccounts, null); Mono res = Mono.just(new PullLegalEntityResponse() - .withLegalEntity(legalEntity1).withMembershipAccounts(Collections.singletonList("012"))); + .legalEntity(legalEntity1).membershipAccounts(Collections.singletonList("012"))); when(legalEntityIntegrationApi.pullLegalEntity(any())).thenReturn(res); when(legalEntityMapper.mapResponseIntegrationToStream(any())).thenReturn(res1); @@ -74,14 +74,14 @@ void callLE_fail() throws UnsupportedOperationException { @Test void callIntegrationService_LegalEntitiesFound() throws UnsupportedOperationException { - LegalEntity legalEntity1 = new LegalEntity().withName("Legal Entity 1"); + LegalEntity legalEntity1 = new LegalEntity().name("Legal Entity 1"); com.backbase.stream.legalentity.model.LegalEntity legalEntity2 = new com.backbase.stream.legalentity.model.LegalEntity().name("Legal Entity 1"); List membershipAccounts = Collections.singletonList("012"); LegalEntityResponse res1 = new LegalEntityResponse(Boolean.TRUE, legalEntity2, membershipAccounts, Map.of("test", "test")); PullLegalEntityResponse getLegalEntityListResponse = new PullLegalEntityResponse() - .withLegalEntity(legalEntity1); + .legalEntity(legalEntity1); when(legalEntityIntegrationApi.pullLegalEntity(any())) .thenReturn(Mono.just(getLegalEntityListResponse)); diff --git a/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/http/LegalEntityControllerIT.java b/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/http/LegalEntityControllerIT.java index 80843435e..e082b911a 100644 --- a/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/http/LegalEntityControllerIT.java +++ b/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/http/LegalEntityControllerIT.java @@ -99,7 +99,7 @@ void pullIngestLegalEntity_Success() throws Exception { URI uri = URI.create("/service-api/v2/ingest/pull"); LegalEntityPullIngestionRequest pullIngestionRequest = - new LegalEntityPullIngestionRequest().withLegalEntityExternalId("externalId"); + new LegalEntityPullIngestionRequest().legalEntityExternalId("externalId"); WebTestClient webTestClient = WebTestClient.bindToController(legalEntityController).build(); webTestClient.post().uri(uri) diff --git a/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/http/LegalEntityControllerTest.java b/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/http/LegalEntityControllerTest.java index baae61d16..216a19ca0 100644 --- a/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/http/LegalEntityControllerTest.java +++ b/stream-compositions/services/legal-entity-composition-service/src/test/java/com/backbase/stream/compositions/legalentity/http/LegalEntityControllerTest.java @@ -41,7 +41,7 @@ void setUp() { @Test void testPullIngestion_Success() { Mono requestMono = Mono.just( - new LegalEntityPullIngestionRequest().withLegalEntityExternalId("externalId")); + new LegalEntityPullIngestionRequest().legalEntityExternalId("externalId")); when(legalEntityIngestionService.ingestPull(any())).thenReturn( Mono.just(LegalEntityResponse.builder() @@ -55,7 +55,7 @@ void testPullIngestion_Success() { @Test void testPushIngestion_Success() { Mono requestMono = Mono.just( - new LegalEntityPushIngestionRequest().withLegalEntity( + new LegalEntityPushIngestionRequest().legalEntity( new com.backbase.stream.compositions.legalentity.api.model.LegalEntity())); when(legalEntityIngestionService.ingestPush(any())).thenReturn( diff --git a/stream-compositions/services/product-catalog-composition-service/src/test/java/com/backbase/stream/compositions/productcatalog/http/ProductCatalogControllerTest.java b/stream-compositions/services/product-catalog-composition-service/src/test/java/com/backbase/stream/compositions/productcatalog/http/ProductCatalogControllerTest.java index b8cf588fe..bcc21988c 100644 --- a/stream-compositions/services/product-catalog-composition-service/src/test/java/com/backbase/stream/compositions/productcatalog/http/ProductCatalogControllerTest.java +++ b/stream-compositions/services/product-catalog-composition-service/src/test/java/com/backbase/stream/compositions/productcatalog/http/ProductCatalogControllerTest.java @@ -2,7 +2,6 @@ import com.backbase.stream.compositions.productcatalog.core.model.ProductCatalogIngestResponse; import com.backbase.stream.compositions.productcatalog.core.service.ProductCatalogIngestionService; -import com.backbase.stream.compositions.productcatalog.http.ProductCatalogController; import com.backbase.stream.compositions.productcatalog.mapper.ProductCatalogMapper; import com.backbase.stream.compositions.productcatalog.model.ProductCatalogIngestionResponse; import com.backbase.stream.compositions.productcatalog.model.ProductCatalog; @@ -59,7 +58,7 @@ void testPullIngestion_Success() { @Test void testPushIngestion_Success() { Mono requestMono = Mono.just( - new ProductCatalogPushIngestionRequest().withProductCatalog(new ProductCatalog())); + new ProductCatalogPushIngestionRequest().productCatalog(new ProductCatalog())); doAnswer(invocation -> { Mono mono = invocation.getArgument(0); diff --git a/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/mapper/ArrangementRestMapperTest.java b/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/mapper/ArrangementRestMapperTest.java index 7da26fe92..45e06ec37 100644 --- a/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/mapper/ArrangementRestMapperTest.java +++ b/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/mapper/ArrangementRestMapperTest.java @@ -46,10 +46,10 @@ void mapPushRequest() { ArrangementPushIngestionRequest request = new ArrangementPushIngestionRequest() - .withInternalArrangementId(ARRANGEMENT_ID) - .withSource(SOURCE) - .withArrangement(arrangementItemPut) - .withConfig(requestConfig); + .internalArrangementId(ARRANGEMENT_ID) + .source(SOURCE) + .arrangement(arrangementItemPut) + .config(requestConfig); ArrangementIngestPushRequest mappedRequest = arrangementRestMapper.mapPushRequest(request); assertEquals(SOURCE, mappedRequest.getSource()); @@ -66,10 +66,10 @@ void mapPullRequest() { ArrangementPullIngestionRequest request = new ArrangementPullIngestionRequest() - .withInternalArrangementId(ARRANGEMENT_ID) - .withExternalArrangementId(EXTERNAL_ARRANGEMENT_ID) - .withSource(SOURCE) - .withConfig(requestConfig); + .internalArrangementId(ARRANGEMENT_ID) + .externalArrangementId(EXTERNAL_ARRANGEMENT_ID) + .source(SOURCE) + .config(requestConfig); ArrangementIngestPullRequest mappedRequest = arrangementRestMapper.mapPullRequest(request); assertEquals(SOURCE, mappedRequest.getSource()); diff --git a/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/mapper/ConfigMapperTest.java b/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/mapper/ConfigMapperTest.java index 97158c1fe..45aab5699 100644 --- a/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/mapper/ConfigMapperTest.java +++ b/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/mapper/ConfigMapperTest.java @@ -13,12 +13,12 @@ class ConfigMapperTest { void map() { ArrangementIngestionConfig config = new ArrangementIngestionConfig() - .withChains( + .chains( new ArrangementsChainsConfig() - .withTransactionComposition( + .transactionComposition( new TransactionCompositionChainConfig() - .withEnabled(true) - .withAsync(true))); + .enabled(true) + .async(true))); ConfigMapper configMapper = new ConfigMapper(); RequestConfig requestConfig = configMapper.map(config); @@ -31,7 +31,7 @@ void map() { void mapNullTransactionComposition() { ArrangementIngestionConfig config = new ArrangementIngestionConfig() - .withChains( + .chains( new ArrangementsChainsConfig()); ConfigMapper configMapper = new ConfigMapper(); diff --git a/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/impl/ArrangementIntegrationServiceImplTest.java b/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/impl/ArrangementIntegrationServiceImplTest.java index ed0d82d5c..5039c9de4 100644 --- a/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/impl/ArrangementIntegrationServiceImplTest.java +++ b/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/impl/ArrangementIntegrationServiceImplTest.java @@ -1,11 +1,11 @@ package com.backbase.stream.compositions.product.core.service.impl; -import com.backbase.stream.compositions.integration.product.api.ArrangementIntegrationApi; -import com.backbase.stream.compositions.integration.product.model.AccountArrangementItemPut; -import com.backbase.stream.compositions.integration.product.model.PullArrangementResponse; import com.backbase.stream.compositions.product.core.mapper.ArrangementMapper; import com.backbase.stream.compositions.product.core.model.ArrangementIngestPullRequest; import com.backbase.stream.compositions.product.core.model.ArrangementIngestResponse; +import com.backbase.stream.compositions.product.integration.client.ArrangementIntegrationApi; +import com.backbase.stream.compositions.product.integration.client.model.AccountArrangementItemPut; +import com.backbase.stream.compositions.product.integration.client.model.PullArrangementResponse; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/impl/ProductIngestionServiceImplTest.java b/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/impl/ProductIngestionServiceImplTest.java index 218615c8b..70e5125c7 100644 --- a/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/impl/ProductIngestionServiceImplTest.java +++ b/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/impl/ProductIngestionServiceImplTest.java @@ -218,12 +218,12 @@ void executeIngestionWithPullMode(Boolean isChainAsync, Boolean chainEnabledPerR if (!isChainAsync) { when(transactionCompositionApi.pullTransactions(any())) .thenReturn(Mono.just(new TransactionIngestionResponse() - .withTransactions(List.of( - new TransactionsPostResponseBody().withId("id").withExternalId("externalId"))))); + .transactions(List.of( + new TransactionsPostResponseBody().id("id").externalId("externalId"))))); } doReturn(Mono.just(new PaymentOrderIngestionResponse() - .withNewPaymentOrder(List.of( - new PaymentOrderPostResponse().withId("id"))))).when(paymentOrderCompositionApi).pullPaymentOrder(any()); + .newPaymentOrder(List.of( + new PaymentOrderPostResponse().id("id"))))).when(paymentOrderCompositionApi).pullPaymentOrder(any()); Mono productIngestResponse = productIngestionService .ingestPull(productIngestPullRequest); StepVerifier.create(productIngestResponse) diff --git a/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/impl/ProductIntegrationServiceImplTest.java b/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/impl/ProductIntegrationServiceImplTest.java index 81ffbd1b2..ce6151079 100644 --- a/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/impl/ProductIntegrationServiceImplTest.java +++ b/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/impl/ProductIntegrationServiceImplTest.java @@ -4,18 +4,14 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; -import com.backbase.stream.compositions.integration.product.api.ProductIntegrationApi; -import com.backbase.stream.compositions.integration.product.model.ProductGroup; -import com.backbase.stream.compositions.integration.product.model.PullProductGroupResponse; import com.backbase.stream.compositions.product.core.mapper.ProductGroupMapper; import com.backbase.stream.compositions.product.core.mapper.ProductGroupMapperImpl; import com.backbase.stream.compositions.product.core.model.ProductIngestPullRequest; import com.backbase.stream.compositions.product.core.model.ProductIngestResponse; - -import java.util.Arrays; -import java.util.Collections; +import com.backbase.stream.compositions.product.integration.client.ProductIntegrationApi; +import com.backbase.stream.compositions.product.integration.client.model.ProductGroup; +import com.backbase.stream.compositions.product.integration.client.model.PullProductGroupResponse; import java.util.Map; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/impl/TransactionIngestionServiceImplTest.java b/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/impl/TransactionIngestionServiceImplTest.java index ad2c88eb3..4d321c600 100644 --- a/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/impl/TransactionIngestionServiceImplTest.java +++ b/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/core/service/impl/TransactionIngestionServiceImplTest.java @@ -46,9 +46,9 @@ void ingestTransactionsViaTransactionManagerTest(boolean splitPerArrangement) { properties.getChains().getTransactionManager().setSplitPerArrangement(splitPerArrangement); var request1 = new TransactionPullIngestionRequest() - .withExternalArrangementId("id1"); + .externalArrangementId("id1"); var request2 = new TransactionPullIngestionRequest() - .withExternalArrangementId("id2"); + .externalArrangementId("id2"); StepVerifier.create(target.ingestTransactions(Flux.fromIterable(List.of(request1, request2)))) .verifyComplete(); @@ -62,9 +62,9 @@ void ingestTransactionsAsyncViaTransactionManagerTest(boolean splitPerArrangemen properties.getChains().getTransactionManager().setSplitPerArrangement(splitPerArrangement); var request1 = new TransactionPullIngestionRequest() - .withExternalArrangementId("id1"); + .externalArrangementId("id1"); var request2 = new TransactionPullIngestionRequest() - .withExternalArrangementId("id2"); + .externalArrangementId("id2"); Step step = StepVerifier.create( target.ingestTransactionsAsync(Flux.fromIterable(List.of(request1, request2)))) diff --git a/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/http/ProductControllerIT.java b/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/http/ProductControllerIT.java index 91e7d4e8b..419106a13 100644 --- a/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/http/ProductControllerIT.java +++ b/stream-compositions/services/product-composition-service/src/test/java/com/backbase/stream/compositions/product/http/ProductControllerIT.java @@ -129,8 +129,8 @@ void initializeTransactionServer() throws JsonProcessingException { .withContentType(MediaType.APPLICATION_JSON) .withBody( objectMapper.writeValueAsString(new TransactionIngestionResponse() - .withTransactions(List.of(new TransactionsPostResponseBody().withId("id") - .withExternalId("externalId")))) + .transactions(List.of(new TransactionsPostResponseBody().id("id") + .externalId("externalId")))) )); } @@ -148,7 +148,7 @@ void initializePaymentOrderServer() throws JsonProcessingException { .withContentType(MediaType.APPLICATION_JSON) .withBody( objectMapper.writeValueAsString(new PaymentOrderIngestionResponse() - .withNewPaymentOrder(List.of(new PaymentOrderPostResponse().withId("id")))) + .newPaymentOrder(List.of(new PaymentOrderPostResponse().id("id")))) )); } @@ -186,13 +186,13 @@ void pullIngestProduct_Success() throws Exception { ProductPullIngestionRequest pullIngestionRequest = new ProductPullIngestionRequest() - .withLegalEntityExternalId("leId") - .withServiceAgreementExternalId("saExId") - .withServiceAgreementInternalId("saId") - .withUserExternalId("userId") - .withReferenceJobRoleNames(List.of("Admin Role")) - .withMembershipAccounts(null) - .withAdditions(Map.of()); + .legalEntityExternalId("leId") + .serviceAgreementExternalId("saExId") + .serviceAgreementInternalId("saId") + .userExternalId("userId") + .referenceJobRoleNames(List.of("Admin Role")) + .membershipAccounts(null) + .additions(Map.of()); URI uri = URI.create("/service-api/v2/ingest/pull"); WebTestClient webTestClient = WebTestClient.bindToController(productController).build(); @@ -206,7 +206,7 @@ void pullIngestProduct_Success() throws Exception { @Test void pushIngestProduct_Success() throws Exception { ProductPushIngestionRequest pushIngestionRequest = new ProductPushIngestionRequest() - .withProductGroup(new com.backbase.stream.compositions.product.api.model.ProductGroup()); + .productGroup(new com.backbase.stream.compositions.product.api.model.ProductGroup()); URI uri = URI.create("/service-api/v2/ingest/push"); WebTestClient webTestClient = WebTestClient.bindToController(productController).build(); @@ -223,9 +223,9 @@ void pullIngestArrangement_Success() throws Exception { ArrangementPullIngestionRequest pullIngestionRequest = new ArrangementPullIngestionRequest() - .withInternalArrangementId("arrangementId") - .withExternalArrangementId("externalArrangementId") - .withAdditions(Map.of()); + .internalArrangementId("arrangementId") + .externalArrangementId("externalArrangementId") + .additions(Map.of()); URI uri = URI.create("/service-api/v2/ingest/arrangement/pull"); WebTestClient webTestClient = WebTestClient.bindToController(productController).build(); @@ -243,9 +243,9 @@ void pullIngestArrangement_Fail() throws Exception { ArrangementPullIngestionRequest pullIngestionRequest = new ArrangementPullIngestionRequest() - .withInternalArrangementId("arrangementId") - .withExternalArrangementId("externalArrangementId") - .withAdditions(Map.of()); + .internalArrangementId("arrangementId") + .externalArrangementId("externalArrangementId") + .additions(Map.of()); URI uri = URI.create("/service-api/v2/ingest/arrangement/pull"); WebTestClient webTestClient = WebTestClient.bindToController(productController).build(); @@ -269,8 +269,8 @@ void pushIngestArrangement_Success() throws IOException { ArrangementPushIngestionRequest pushIngestionRequest = new ArrangementPushIngestionRequest() - .withInternalArrangementId("arrangementId") - .withArrangement(arrangementItemPut); + .internalArrangementId("arrangementId") + .arrangement(arrangementItemPut); URI uri = URI.create("/service-api/v2/ingest/arrangement/push"); WebTestClient webTestClient = WebTestClient.bindToController(productController).build(); diff --git a/stream-compositions/services/transaction-composition-service/src/test/java/com/backbase/stream/compositions/transaction/core/mapper/TransactionMapperTest.java b/stream-compositions/services/transaction-composition-service/src/test/java/com/backbase/stream/compositions/transaction/core/mapper/TransactionMapperTest.java index c44f1ba21..b72c1a0c5 100644 --- a/stream-compositions/services/transaction-composition-service/src/test/java/com/backbase/stream/compositions/transaction/core/mapper/TransactionMapperTest.java +++ b/stream-compositions/services/transaction-composition-service/src/test/java/com/backbase/stream/compositions/transaction/core/mapper/TransactionMapperTest.java @@ -7,7 +7,6 @@ import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; -import org.joda.time.DateTime; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mapstruct.factory.Mappers; diff --git a/stream-compositions/test-utils/pom.xml b/stream-compositions/test-utils/pom.xml index 266b3c0a6..a0d7dce13 100644 --- a/stream-compositions/test-utils/pom.xml +++ b/stream-compositions/test-utils/pom.xml @@ -24,6 +24,7 @@ true true + true @@ -58,11 +59,6 @@ mockserver-netty-no-dependencies ${mock.server.version} - - - - - org.mockito mockito-inline