From d9386188b07b649acc00f59e759d75dec8aa0354 Mon Sep 17 00:00:00 2001 From: rschneider <97682836+rainer-exxcellent@users.noreply.github.com> Date: Thu, 25 May 2023 16:34:22 +0200 Subject: [PATCH] feat(api): #172 Unwrap name schema #180 --- .../bpdm/common/dto/LegalEntityDto.kt | 5 ++- .../dto/response/LegalEntityResponse.kt | 5 ++- .../bpdm/common/dto/response/NameResponse.kt | 31 ------------------- .../bpdm/common/service/SaasMappings.kt | 3 +- .../service/LegalEntityPersistenceService.kt | 7 ++--- .../bpdm/gate/service/ResponseMappings.kt | 6 +--- .../tractusx/bpdm/gate/util/RequestValues.kt | 9 +++--- .../tractusx/bpdm/gate/util/ResponseValues.kt | 26 +++------------- .../service/BusinessPartnerBuildService.kt | 18 +++++------ .../bpdm/pool/service/ResponseMappings.kt | 7 ++--- .../controller/OpenSearchControllerIT.kt | 11 ++++--- .../BusinessPartnerLegacyControllerIT.kt | 7 +---- .../pool/controller/SuggestionControllerIT.kt | 6 ++-- .../tractusx/bpdm/pool/util/RequestValues.kt | 15 ++++----- .../tractusx/bpdm/pool/util/ResponseValues.kt | 20 +++++------- 15 files changed, 55 insertions(+), 121 deletions(-) delete mode 100644 bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/NameResponse.kt diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/LegalEntityDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/LegalEntityDto.kt index f0cd3f515..6ba6712e4 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/LegalEntityDto.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/LegalEntityDto.kt @@ -28,7 +28,10 @@ data class LegalEntityDto( val identifiers: Collection = emptyList(), @get:Schema(description = "Legal name the partner goes by") - val legalName: NameDto, + val legalName: String, + + @get:Schema(description = "Abbreviated name or shorthand") + val legalShortName: String?, @get:Schema(description = "Technical key of the legal form") val legalForm: String? = null, diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/LegalEntityResponse.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/LegalEntityResponse.kt index ea204b03d..9ff99f5fc 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/LegalEntityResponse.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/LegalEntityResponse.kt @@ -33,7 +33,10 @@ data class LegalEntityResponse( val identifiers: Collection = emptyList(), @get:Schema(description = "Legal name the partner goes by") - val legalName: NameResponse, + val legalName: String, + + @get:Schema(description = "Abbreviated name or shorthand") + val legalShortName: String? = null, @get:Schema(description = "Legal form of the business partner") val legalForm: LegalFormResponse? = null, diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/NameResponse.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/NameResponse.kt deleted file mode 100644 index a2555b56f..000000000 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/NameResponse.kt +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2021,2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ******************************************************************************/ - -package org.eclipse.tractusx.bpdm.common.dto.response - -import io.swagger.v3.oas.annotations.media.Schema - -@Schema(name = "NameResponse", description = "Name record of a business partner") -data class NameResponse( - @get:Schema(description = "Full name") - val value: String, - - @get:Schema(description = "Abbreviated name or shorthand") - val shortName: String? = null -) \ No newline at end of file diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/service/SaasMappings.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/service/SaasMappings.kt index c368f63fb..40de4d375 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/service/SaasMappings.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/service/SaasMappings.kt @@ -70,7 +70,8 @@ object SaasMappings { ?: throw BpdmMappingException(this::class, LegalEntityDto::class, "No legal name", externalId ?: "Unknown") return LegalEntityDto( identifiers = identifiers.filter { it.type?.technicalKey != BPN_TECHNICAL_KEY }.map { toLegalEntityIdentifierDto(it) }, - legalName = legalName, + legalName = legalName.value, + legalShortName = legalName.shortName, legalForm = toOptionalReference(legalForm), states = toLegalEntityStatesDtos(status), classifications = toDto(profile), diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/LegalEntityPersistenceService.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/LegalEntityPersistenceService.kt index f652c05e3..83394f5f0 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/LegalEntityPersistenceService.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/LegalEntityPersistenceService.kt @@ -23,10 +23,7 @@ package org.eclipse.tractusx.bpdm.gate.service import org.eclipse.tractusx.bpdm.common.exception.BpdmNotFoundException import org.eclipse.tractusx.bpdm.common.util.replace import org.eclipse.tractusx.bpdm.gate.api.model.LegalEntityGateInputRequest -import org.eclipse.tractusx.bpdm.gate.entity.AddressIdentifier -import org.eclipse.tractusx.bpdm.gate.entity.AddressState -import org.eclipse.tractusx.bpdm.gate.entity.LegalEntity -import org.eclipse.tractusx.bpdm.gate.entity.LogisticAddress +import org.eclipse.tractusx.bpdm.gate.entity.* import org.eclipse.tractusx.bpdm.gate.repository.GateAddressRepository import org.eclipse.tractusx.bpdm.gate.repository.LegalEntityRepository import org.springframework.stereotype.Service @@ -73,7 +70,7 @@ class LegalEntityPersistenceService( legalEntity.bpn = legalEntityRequest.bpn legalEntity.externalId = legalEntityRequest.externalId legalEntity.legalForm = legalEntityRequest.legalEntity.legalForm - legalEntity.legalName = legalEntityRequest.legalEntity.legalName.toName() + legalEntity.legalName = Name(value = legalEntityRequest.legalEntity.legalName, shortName = legalEntityRequest.legalEntity.legalShortName) legalEntity.identifiers.replace(legalEntityRequest.legalEntity.identifiers.map { toEntityIdentifier(it, legalEntity) }) legalEntity.states.replace(legalEntityRequest.legalEntity.states.map { toEntityState(it, legalEntity) }) legalEntity.classifications.replace(legalEntityRequest.legalEntity.classifications.map { toEntityClassification(it, legalEntity) }) diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/ResponseMappings.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/ResponseMappings.kt index 4aa792962..9edd859f7 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/ResponseMappings.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/ResponseMappings.kt @@ -156,7 +156,7 @@ fun LegalEntityGateInputRequest.toLegalEntity(): LegalEntity { externalId = externalId, currentness = createCurrentnessTimestamp(), legalForm = legalEntity.legalForm, - legalName = legalEntity.legalName.toName() + legalName = Name(legalEntity.legalName, legalEntity.legalShortName) ) legalEntity.identifiers.addAll(this.legalEntity.identifiers.map { toEntityIdentifier(it, legalEntity) }) @@ -181,10 +181,6 @@ fun toEntityClassification(dto: ClassificationDto, legalEntity: LegalEntity): Cl return Classification(dto.value, dto.code, dto.type, legalEntity) } -fun NameDto.toName(): Name { - return Name(value, shortName) -} - private fun createCurrentnessTimestamp(): Instant { return Instant.now().truncatedTo(ChronoUnit.MICROS) } diff --git a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/RequestValues.kt b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/RequestValues.kt index 11f9f67f5..a6b6639da 100644 --- a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/RequestValues.kt +++ b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/RequestValues.kt @@ -58,9 +58,6 @@ object RequestValues { ) val name1 = NameDto(value = CommonValues.name1, shortName = CommonValues.shortName1) - val name2 = NameDto(value = CommonValues.name2, shortName = CommonValues.shortName2) - val name3 = NameDto(value = CommonValues.name3, shortName = CommonValues.shortName3) - val name4 = NameDto(value = CommonValues.name4, shortName = CommonValues.shortName4) val leBusinessStatus1 = LegalEntityStateDto( officialDenotation = CommonValues.businessStatusOfficialDenotation1, @@ -166,7 +163,8 @@ object RequestValues { val legalEntity1 = LegalEntityDto( identifiers = listOf(identifier1, identifier2), - legalName = name1, + legalName = CommonValues.name1, + legalShortName = CommonValues.shortName1, legalForm = CommonValues.legalFormTechnicalKey1, states = listOf(leBusinessStatus1), classifications = listOf(classification1, classification2), @@ -175,7 +173,8 @@ object RequestValues { val legalEntity2 = LegalEntityDto( identifiers = listOf(identifier3, identifier4), - legalName = name3, + legalName = CommonValues.name3, + legalShortName = CommonValues.shortName3, legalForm = CommonValues.legalFormTechnicalKey2, states = listOf(leBusinessStatus2), classifications = listOf(classification3, classification4), diff --git a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/ResponseValues.kt b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/ResponseValues.kt index cea8fa823..bb11ff53e 100644 --- a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/ResponseValues.kt +++ b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/ResponseValues.kt @@ -75,26 +75,6 @@ object ResponseValues { ) - val name1 = NameResponse( - value = CommonValues.name1, - shortName = CommonValues.shortName1, - ) - - val name2 = NameResponse( - value = CommonValues.name2, - shortName = CommonValues.shortName2, - ) - - val name3 = NameResponse( - value = CommonValues.name3, - shortName = CommonValues.shortName3, - ) - - val name4 = NameResponse( - value = CommonValues.name4, - shortName = CommonValues.shortName4, - ) - val legalForm1 = LegalFormResponse( technicalKey = CommonValues.legalFormTechnicalKey1, name = CommonValues.legalFormName1, @@ -224,7 +204,8 @@ object ResponseValues { val legalEntityResponse1 = LegalEntityResponse( bpnl = CommonValues.bpn1, identifiers = listOf(identifier1, identifier2), - legalName = name1, + legalName = CommonValues.name1, + legalShortName = CommonValues.shortName1, legalForm = legalForm1, states = listOf(leBusinessStatus1), classifications = listOf(classification1, classification2), @@ -236,7 +217,8 @@ object ResponseValues { val legalEntityResponse2 = LegalEntityResponse( bpnl = CommonValues.bpn2, identifiers = listOf(identifier3, identifier4), - legalName = name3, + legalName = CommonValues.name3, + legalShortName = CommonValues.shortName3, legalForm = legalForm2, states = listOf(leBusinessStatus2), classifications = listOf(classification3, classification4), diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerBuildService.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerBuildService.kt index 9e9745ee8..89e82649d 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerBuildService.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerBuildService.kt @@ -309,7 +309,10 @@ class BusinessPartnerBuildService( bpnL: String, metadataMap: LegalEntityMetadataMappingDto ): LegalEntity { - val legalName = toEntity(request.legalName) + val legalName = Name( + value = request.legalName, + shortName = request.legalShortName + ) val legalForm = request.legalForm?.let { metadataMap.legalForms[it]!! } val partner = LegalEntity( @@ -347,7 +350,11 @@ class BusinessPartnerBuildService( partner.currentness = createCurrentnessTimestamp() - partner.legalName = toEntity(request.legalName) + partner.legalName = Name( + value = request.legalName, + shortName = request.legalShortName + ) + partner.legalForm = request.legalForm?.let { metadataMap.legalForms[it]!! } partner.identifiers.clear() @@ -501,13 +508,6 @@ class BusinessPartnerBuildService( ) } - private fun toEntity(dto: NameDto): Name { - return Name( - value = dto.value, - shortName = dto.shortName - ) - } - private fun toEntity(dto: ClassificationDto, partner: LegalEntity): Classification { return Classification( value = dto.value, diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt index 672373a14..7ccbb67cf 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt @@ -52,7 +52,8 @@ fun LegalEntity.toDto(): LegalEntityResponse { return LegalEntityResponse( bpnl = bpn, identifiers = identifiers.map { it.toDto() }, - legalName = legalName.toDto(), + legalName = legalName.value, + legalShortName = legalName.shortName, legalForm = legalForm?.toDto(), states = states.map { it.toDto() }, classifications = classifications.map { it.toDto() }, @@ -89,10 +90,6 @@ fun IdentifierType.toDto(): IdentifierTypeDto { details.map { IdentifierTypeDetailDto(it.countryCode, it.mandatory) }) } -fun Name.toDto(): NameResponse { - return NameResponse(value, shortName) -} - fun LegalForm.toDto(): LegalFormResponse { return LegalFormResponse(technicalKey, name, abbreviation) } diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/component/opensearch/controller/OpenSearchControllerIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/component/opensearch/controller/OpenSearchControllerIT.kt index 488ea0b95..3dfff6066 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/component/opensearch/controller/OpenSearchControllerIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/component/opensearch/controller/OpenSearchControllerIT.kt @@ -194,10 +194,11 @@ class OpenSearchControllerIT @Autowired constructor( private fun searchBusinessPartnerByName(name: String): PageResponse { - return poolClient.legalEntities().getLegalEntities(LegalEntityPropertiesSearchRequest(name,null,null,null) - , AddressPropertiesSearchRequest.EmptySearchRequest - , SitePropertiesSearchRequest.EmptySearchRequest - , PaginationRequest() + return poolClient.legalEntities().getLegalEntities( + LegalEntityPropertiesSearchRequest(name, null, null, null), + AddressPropertiesSearchRequest.EmptySearchRequest, + SitePropertiesSearchRequest.EmptySearchRequest, + PaginationRequest() ) } @@ -206,7 +207,7 @@ class OpenSearchControllerIT @Autowired constructor( val pageResult = searchBusinessPartnerByName(name) assertThat(pageResult.content).isNotEmpty - assertThat(pageResult.content.first()).matches { it.legalEntity.legalName.value == name } + assertThat(pageResult.content.first()).matches { it.legalEntity.legalName == name } } } diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/BusinessPartnerLegacyControllerIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/BusinessPartnerLegacyControllerIT.kt index 49cc46060..319d7372b 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/BusinessPartnerLegacyControllerIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/BusinessPartnerLegacyControllerIT.kt @@ -19,9 +19,7 @@ package org.eclipse.tractusx.bpdm.pool.controller -import org.eclipse.tractusx.bpdm.common.dto.NameDto import org.eclipse.tractusx.bpdm.common.dto.response.PageResponse - import org.eclipse.tractusx.bpdm.pool.Application import org.eclipse.tractusx.bpdm.pool.api.model.response.BusinessPartnerMatchResponse import org.eclipse.tractusx.bpdm.pool.api.model.response.BusinessPartnerResponse @@ -55,10 +53,7 @@ class BusinessPartnerLegacyControllerIT @Autowired constructor( LegalEntityStructureRequest(legalEntity = with(RequestValues.legalEntityCreate1) { copy( legalEntity = legalEntity.copy( - legalName = NameDto( - uniqueName, - null - ) + legalName = uniqueName ) ) }), diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SuggestionControllerIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SuggestionControllerIT.kt index 455290150..ed6808a9d 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SuggestionControllerIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SuggestionControllerIT.kt @@ -69,7 +69,7 @@ class SuggestionControllerIT @Autowired constructor( .build() private val expectedLegalEntity = ResponseValues.legalEntityUpsert1.legalEntity - private val expectedLegalEntityName = expectedLegalEntity.legalName.value + private val expectedLegalEntityName = expectedLegalEntity.legalName private val expectedLegalAddress = ResponseValues.legalEntityUpsert1.legalAddress private val expectedSite = ResponseValues.siteUpsert2 @@ -94,7 +94,7 @@ class SuggestionControllerIT @Autowired constructor( Arguments.of( expectedLegalEntity.legalForm!!.name, EndpointValues.CATENA_SUGGESTION_LE_LEGAL_FORM_PATH, - expectedLegalEntity.legalName.value + expectedLegalEntity.legalName ), Arguments.of( expectedLegalEntity.states.first().officialDenotation, @@ -147,7 +147,7 @@ class SuggestionControllerIT @Autowired constructor( @JvmStatic fun argumentsSuggestPropertyValuesNonLatin(): Stream = Stream.of( - Arguments.of(nonlatinLegalEntity.legalName.value, EndpointValues.CATENA_SUGGESTION_LE_NAME_PATH), + Arguments.of(nonlatinLegalEntity.legalName, EndpointValues.CATENA_SUGGESTION_LE_NAME_PATH), Arguments.of(nonlatinLegalEntity.legalForm!!.name, EndpointValues.CATENA_SUGGESTION_LE_LEGAL_FORM_PATH), Arguments.of(nonlatinSite.site.name, EndpointValues.CATENA_SUGGESTION_SITE_NAME_PATH), Arguments.of( diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/RequestValues.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/RequestValues.kt index 605574f83..68be9d43d 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/RequestValues.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/RequestValues.kt @@ -25,12 +25,6 @@ import org.eclipse.tractusx.bpdm.pool.api.model.request.* object RequestValues { - val name1 = NameDto(value = CommonValues.name1, shortName = null) - val name2 = NameDto(value = CommonValues.name2, shortName = null) - val name3 = NameDto(value = CommonValues.name3, shortName = null) - val name4 = NameDto(value = CommonValues.name4, shortName = null) - val name5 = NameDto(value = CommonValues.name5, shortName = null) - val identifierType1 = TypeKeyNameDto(CommonValues.identifierTypeTechnicalKey1, CommonValues.identifierTypeName1) val identifierType2 = TypeKeyNameDto(CommonValues.identifierTypeTechnicalKey2, CommonValues.identifierTypeName2) val identifierType3 = TypeKeyNameDto(CommonValues.identifierTypeTechnicalKey3, CommonValues.identifierTypeName3) @@ -163,7 +157,8 @@ object RequestValues { val legalEntityCreate1 = LegalEntityPartnerCreateRequest( legalEntity = LegalEntityDto( - legalName = name1, + legalName = CommonValues.name1, + legalShortName = null, identifiers = listOf(identifier1), legalForm = CommonValues.legalFormTechnicalKey1, states = listOf(leStatus1), @@ -175,7 +170,8 @@ object RequestValues { val legalEntityCreate2 = LegalEntityPartnerCreateRequest( legalEntity = LegalEntityDto( - legalName = name3, + legalName = CommonValues.name3, + legalShortName = null, identifiers = listOf(identifier2), legalForm = CommonValues.legalFormTechnicalKey2, states = listOf(leStatus2), @@ -187,7 +183,8 @@ object RequestValues { val legalEntityCreate3 = LegalEntityPartnerCreateRequest( legalEntity = LegalEntityDto( - legalName = name5, + legalName = CommonValues.name5, + legalShortName = null, identifiers = listOf(identifier3), legalForm = CommonValues.legalFormTechnicalKey3, states = listOf(leStatus3), diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/ResponseValues.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/ResponseValues.kt index 9c4d22918..a2e93d588 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/ResponseValues.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/ResponseValues.kt @@ -50,13 +50,7 @@ object ResponseValues { LegalEntityIdentifierResponse(CommonValues.identifierValue2, RequestValues.identifierType2, CommonValues.issuingBody2) private val identifier3 = LegalEntityIdentifierResponse(CommonValues.identifierValue3, RequestValues.identifierType3, CommonValues.issuingBody3) - - private val name1 = NameResponse(value = CommonValues.name1) - private val name2 = NameResponse(value = CommonValues.name2) - private val name3 = NameResponse(value = CommonValues.name3) - private val name4 = NameResponse(value = CommonValues.name4) - private val name5 = NameResponse(value = CommonValues.name5) - + val legalForm1 = LegalFormResponse( technicalKey = CommonValues.legalFormTechnicalKey1, name = CommonValues.legalFormName1, @@ -250,7 +244,7 @@ object ResponseValues { val legalEntity1 = LegalEntityResponse( bpnl = CommonValues.bpnL1, - legalName = name1, + legalName = CommonValues.name1, identifiers = listOf(identifier1), legalForm = legalForm1, states = listOf(leStatus1), @@ -262,7 +256,7 @@ object ResponseValues { val legalEntity2 = LegalEntityResponse( bpnl = CommonValues.bpnL2, - legalName = name3, + legalName = CommonValues.name3, identifiers = listOf(identifier2), legalForm = legalForm2, states = listOf(leStatus2), @@ -274,7 +268,7 @@ object ResponseValues { val legalEntity3 = LegalEntityResponse( bpnl = CommonValues.bpnL3, - legalName = name5, + legalName = CommonValues.name5, identifiers = listOf(identifier3), legalForm = legalForm3, states = listOf(leStatus3), @@ -287,7 +281,7 @@ object ResponseValues { val legalEntityUpsert1 = LegalEntityPartnerCreateResponse( legalEntity = LegalEntityResponse( bpnl = CommonValues.bpnL1, - legalName = name1, + legalName = CommonValues.name1, identifiers = listOf(LegalEntityIdentifierResponse(CommonValues.identifierValue1, RequestValues.identifierType1, CommonValues.issuingBody1)), legalForm = legalForm1, states = listOf(leStatus1), @@ -306,7 +300,7 @@ object ResponseValues { val legalEntityUpsert2 = LegalEntityPartnerCreateResponse( legalEntity = LegalEntityResponse( bpnl = CommonValues.bpnL2, - legalName = name3, + legalName = CommonValues.name3, identifiers = listOf(LegalEntityIdentifierResponse(CommonValues.identifierValue2, RequestValues.identifierType2, CommonValues.issuingBody2)), legalForm = legalForm2, states = listOf(leStatus2), @@ -325,7 +319,7 @@ object ResponseValues { val legalEntityUpsert3 = LegalEntityPartnerCreateResponse( legalEntity = LegalEntityResponse( bpnl = CommonValues.bpnL3, - legalName = name5, + legalName = CommonValues.name5, identifiers = listOf(LegalEntityIdentifierResponse(CommonValues.identifierValue3, RequestValues.identifierType3, CommonValues.issuingBody3)), legalForm = legalForm3, states = listOf(leStatus3),