This is an automated email from the ASF dual-hosted git repository. pgil pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push: new 365f50ca0e Fixed: Partymgr Groovy tests (OFBIZ-12998) 365f50ca0e is described below commit 365f50ca0ee1511533457394d46c7d99f0fef18c Author: Gil Portenseigne <gil.portensei...@nereide.fr> AuthorDate: Fri Apr 5 15:44:31 2024 +0200 Fixed: Partymgr Groovy tests (OFBIZ-12998) Fix auto refactor by eclipse IDE, sorry for that. --- .../party/party/ContactMechWorkerTests.groovy | 16 +++-- .../ofbiz/party/party/PartyContactMechTests.groovy | 83 +++++++++++----------- .../party/party/PartyStatusChangeTests.groovy | 17 ++--- .../org/apache/ofbiz/party/party/PartyTests.groovy | 19 ++--- 4 files changed, 70 insertions(+), 65 deletions(-) diff --git a/applications/party/src/main/groovy/org/apache/ofbiz/party/party/ContactMechWorkerTests.groovy b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/ContactMechWorkerTests.groovy index c25b4259c0..45a1e4575b 100644 --- a/applications/party/src/main/groovy/org/apache/ofbiz/party/party/ContactMechWorkerTests.groovy +++ b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/ContactMechWorkerTests.groovy @@ -34,9 +34,10 @@ class ContactMechWorkerTests extends OFBizTestCase { assert partyContactMechValueMaps assert partyContactMechValueMaps.size() == 7 boolean foundPostalAddress = false, foundTelecom = false, foundEmailAddress = false, foundFtpAddress = false - partyContactMechValueMaps.forEach { Map partyContactMechValueMap -> - switch (partyContactMechValueMap?.contactMech?.contactMechId) { - case '9015': + partyContactMechValueMaps.forEach { + Map partyContactMechValueMap -> + switch (partyContactMechValueMap?.contactMech?.contactMechId) { + case '9015': foundPostalAddress = true assert partyContactMechValueMap.contactMech.contactMechTypeId == 'POSTAL_ADDRESS' assert partyContactMechValueMap.partyContactMech @@ -47,7 +48,7 @@ class ContactMechWorkerTests extends OFBizTestCase { assert partyContactMechValueMap.postalAddress.contactMechId == '9015' assert partyContactMechValueMap.postalAddress.address1 == '2004 Factory Blvd' break - case '9027': + case '9027': foundTelecom = true assert partyContactMechValueMap.contactMech.contactMechTypeId == 'TELECOM_NUMBER' assert partyContactMechValueMap.partyContactMech @@ -58,7 +59,7 @@ class ContactMechWorkerTests extends OFBizTestCase { assert partyContactMechValueMap.telecomNumber.contactMechId == '9027' assert partyContactMechValueMap.telecomNumber.contactNumber == '444-4444' break - case '9126': + case '9126': foundEmailAddress = true assert partyContactMechValueMap.contactMech.contactMechTypeId == 'EMAIL_ADDRESS' assert partyContactMechValueMap.contactMech.infoString == 'ofbizt...@foo.com' @@ -67,7 +68,7 @@ class ContactMechWorkerTests extends OFBizTestCase { assert partyContactMechValueMap.partyContactMechPurposes assert partyContactMechValueMap.partyContactMechPurposes.size() == 2 break - case '9127': + case '9127': foundFtpAddress = true assert partyContactMechValueMap.contactMech.contactMechTypeId == 'FTP_ADDRESS' assert partyContactMechValueMap.partyContactMech @@ -76,7 +77,7 @@ class ContactMechWorkerTests extends OFBizTestCase { assert partyContactMechValueMap.ftpAddress assert partyContactMechValueMap.ftpAddress.hostname == 'ftp://apacheofbiz.foo.com' break - } + } } assert foundPostalAddress && foundTelecom && foundEmailAddress && foundFtpAddress @@ -176,4 +177,5 @@ class ContactMechWorkerTests extends OFBizTestCase { } assert foundPostalAddress && foundEmail && foundPhone } + } diff --git a/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyContactMechTests.groovy b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyContactMechTests.groovy index 28efb2e42e..b373200e0b 100644 --- a/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyContactMechTests.groovy +++ b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyContactMechTests.groovy @@ -36,11 +36,11 @@ class PartyContactMechTests extends OFBizTestCase { // first try with just updating without changing the email address Map serviceCtx = [ - partyId: partyId, - contactMechTypeId: contactMechTypeId, - emailAddress: emailAddress, - contactMechId: '9026', - userLogin: userLogin + partyId: partyId, + contactMechTypeId: contactMechTypeId, + emailAddress: emailAddress, + contactMechId: '9026', + userLogin: userLogin ] Map serviceResult = dispatcher.runSync('updatePartyEmailAddress', serviceCtx) assert ServiceUtil.isSuccess(serviceResult) @@ -76,12 +76,12 @@ class PartyContactMechTests extends OFBizTestCase { // first try with just updating without changing the email address Map serviceCtx = [ - partyId: partyId, - contactMechId: '9025', - countryCode: '1', - areaCode: '801', - contactNumber: '555-5555', - userLogin: userLogin + partyId: partyId, + contactMechId: '9025', + countryCode: '1', + areaCode: '801', + contactNumber: '555-5555', + userLogin: userLogin ] Map serviceResult = dispatcher.runSync('updatePartyTelecomNumber', serviceCtx) assert ServiceUtil.isSuccess(serviceResult) @@ -184,10 +184,10 @@ class PartyContactMechTests extends OFBizTestCase { String contactMechPurposeTypeId = 'PRIMARY_EMAIL' Map serviceCtx = [ - partyId: partyId, - contactMechPurposeTypeId: contactMechPurposeTypeId, - emailAddress: emailAddress, - userLogin: userLogin + partyId: partyId, + contactMechPurposeTypeId: contactMechPurposeTypeId, + emailAddress: emailAddress, + userLogin: userLogin ] Map serviceResult = dispatcher.runSync('createPartyEmailAddress', serviceCtx) assert ServiceUtil.isSuccess(serviceResult) @@ -223,11 +223,11 @@ class PartyContactMechTests extends OFBizTestCase { String contactMechPurposeTypeId = 'PRIMARY_PHONE' Map serviceCtx = [ - partyId: partyId, - contactMechPurposeTypeId: contactMechPurposeTypeId, - areaCode: areaCode, - contactNumber: contactNumber, - userLogin: userLogin + partyId: partyId, + contactMechPurposeTypeId: contactMechPurposeTypeId, + areaCode: areaCode, + contactNumber: contactNumber, + userLogin: userLogin ] Map serviceResult = dispatcher.runSync('createPartyTelecomNumber', serviceCtx) assert ServiceUtil.isSuccess(serviceResult) @@ -267,12 +267,12 @@ class PartyContactMechTests extends OFBizTestCase { String extension = '444' Map serviceCtx = [ - partyId: partyId, - contactMechPurposeTypeId: contactMechPurposeTypeId, - areaCode: areaCode, - contactNumber: contactNumber, - extension: extension, - userLogin: userLogin + partyId: partyId, + contactMechPurposeTypeId: contactMechPurposeTypeId, + areaCode: areaCode, + contactNumber: contactNumber, + extension: extension, + userLogin: userLogin ] Map serviceResult = dispatcher.runSync('createUpdatePartyTelecomNumber', serviceCtx) assert ServiceUtil.isSuccess(serviceResult) @@ -312,12 +312,12 @@ class PartyContactMechTests extends OFBizTestCase { String contactNumber = '555-5555' Map serviceCtx = [ - partyId: partyId, - contactMechId: '9125', - contactMechPurposeTypeId: contactMechPurposeTypeId, - areaCode: areaCode, - contactNumber: contactNumber, - userLogin: userLogin + partyId: partyId, + contactMechId: '9125', + contactMechPurposeTypeId: contactMechPurposeTypeId, + areaCode: areaCode, + contactNumber: contactNumber, + userLogin: userLogin ] Map serviceResult = dispatcher.runSync('createUpdatePartyTelecomNumber', serviceCtx) assert ServiceUtil.isSuccess(serviceResult) @@ -360,10 +360,10 @@ class PartyContactMechTests extends OFBizTestCase { String emailAddress = 'demo.custo...@foo.com' Map serviceCtx = [ - partyId: partyId, - contactMechPurposeTypeId: contactMechPurposeTypeId, - emailAddress: emailAddress, - userLogin: userLogin + partyId: partyId, + contactMechPurposeTypeId: contactMechPurposeTypeId, + emailAddress: emailAddress, + userLogin: userLogin ] Map serviceResult = dispatcher.runSync('createUpdatePartyEmailAddress', serviceCtx) assert ServiceUtil.isSuccess(serviceResult) @@ -394,11 +394,11 @@ class PartyContactMechTests extends OFBizTestCase { String emailAddress = 'demo.custo...@foo.com' Map serviceCtx = [ - partyId: partyId, - contactMechId: '9126', - contactMechPurposeTypeId: contactMechPurposeTypeId, - emailAddress: emailAddress, - userLogin: userLogin + partyId: partyId, + contactMechId: '9126', + contactMechPurposeTypeId: contactMechPurposeTypeId, + emailAddress: emailAddress, + userLogin: userLogin ] Map serviceResult = dispatcher.runSync('createUpdatePartyEmailAddress', serviceCtx) assert ServiceUtil.isSuccess(serviceResult) @@ -430,4 +430,5 @@ class PartyContactMechTests extends OFBizTestCase { .filterByDate().queryFirst() assert partyContactMechPurpose } + } diff --git a/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyStatusChangeTests.groovy b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyStatusChangeTests.groovy index 442f3bad9e..75c6bb39a2 100644 --- a/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyStatusChangeTests.groovy +++ b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyStatusChangeTests.groovy @@ -35,10 +35,10 @@ class PartyStatusChangeTests extends OFBizTestCase { String statusId = 'PARTY_DISABLED' Map serviceCtx = [ - partyId: partyId, - statusId: statusId, - statusDate: UtilDateTime.nowTimestamp(), - userLogin: userLogin + partyId: partyId, + statusId: statusId, + statusDate: UtilDateTime.nowTimestamp(), + userLogin: userLogin ] Map serviceResult = dispatcher.runSync('setPartyStatus', serviceCtx) assert ServiceUtil.isSuccess(serviceResult) @@ -57,10 +57,10 @@ class PartyStatusChangeTests extends OFBizTestCase { String statusId = 'PARTY_ENABLED' Map serviceCtx = [ - partyId: partyId, - statusId: statusId, - statusDate: UtilDateTime.nowTimestamp(), - userLogin: userLogin + partyId: partyId, + statusId: statusId, + statusDate: UtilDateTime.nowTimestamp(), + userLogin: userLogin ] Map serviceResult = dispatcher.runSync('setPartyStatus', serviceCtx) assert ServiceUtil.isSuccess(serviceResult) @@ -72,4 +72,5 @@ class PartyStatusChangeTests extends OFBizTestCase { assert statusId == party.statusId assert serviceResult.oldStatusId == 'PARTY_DISABLED' } + } diff --git a/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyTests.groovy b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyTests.groovy index a2894818b6..4611f7b217 100644 --- a/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyTests.groovy +++ b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyTests.groovy @@ -30,15 +30,15 @@ class PartyTests extends OFBizTestCase { void testCreatePartyPostalAddress() { Map serviceCtx = [ - contactMechId: 'TestPostalAddress', - partyId: 'TestCustomer', - toName: 'Test Address', - address1: '2004 Factory Blvd', - city: 'City of Industry', - countryGeoId: 'USA', - stateProvinceGeoId: 'CA', - postalCode: '90000', - userLogin: userLogin + contactMechId: 'TestPostalAddress', + partyId: 'TestCustomer', + toName: 'Test Address', + address1: '2004 Factory Blvd', + city: 'City of Industry', + countryGeoId: 'USA', + stateProvinceGeoId: 'CA', + postalCode: '90000', + userLogin: userLogin ] Map serviceResult = dispatcher.runSync('createPartyPostalAddress', serviceCtx) assert ServiceUtil.isSuccess(serviceResult) @@ -47,4 +47,5 @@ class PartyTests extends OFBizTestCase { assert postalAddress != null postalAddress.city = 'City of Industry' } + }