From dcffee09e32d9de1f9d8b612ed4bb41244dc2edb Mon Sep 17 00:00:00 2001 From: carl Date: Mon, 26 Aug 2024 23:39:08 +0400 Subject: [PATCH] ECWID-147482 testing stuffs --- .../com/ecwid/apiclient/v3/entity/CategoriesTest.kt | 9 ++++++--- .../com/ecwid/apiclient/v3/entity/ProductsTest.kt | 13 ++++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CategoriesTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CategoriesTest.kt index 32178d8ca..72068f6cc 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CategoriesTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CategoriesTest.kt @@ -564,7 +564,8 @@ private fun generateTestProduct( ): UpdatedProduct { return UpdatedProduct( name = "Product $nameSuffix: ${randomAlphanumeric(8)}", - enabled = enabled + enabled = enabled, + customSlug = "", ) } @@ -601,7 +602,8 @@ private fun generateTestCategory( seoDescriptionTranslated = LocalizedValueMap( "ru" to "", "en" to "" - ) + ), + customSlug = "" ) } @@ -609,6 +611,7 @@ private fun UpdatedCategory.cleanupForComparison(): UpdatedCategory { return copy( parentId = parentId ?: 0, // orderBy can be changed by internal ecwid rules so reset it - orderBy = 10 + orderBy = 10, + customSlug = "", ) } diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/ProductsTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/ProductsTest.kt index fdb1ed5a8..fe4ce9970 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/ProductsTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/ProductsTest.kt @@ -22,8 +22,7 @@ import com.ecwid.apiclient.v3.dto.product.result.GetProductFiltersResult.OptionF import com.ecwid.apiclient.v3.exception.EcwidApiException import com.ecwid.apiclient.v3.util.* import org.junit.jupiter.api.* -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Assertions.assertTrue +import org.junit.jupiter.api.Assertions.* import java.io.FileInputStream import java.nio.file.Files import java.util.* @@ -227,7 +226,8 @@ class ProductsTest : BaseEntityTest() { val productCreateRequest = ProductCreateRequest( newProduct = UpdatedProduct( name = "Product ${randomAlphanumeric(8)}", - sku = "testSearchUrls" + sku = "testSearchUrls", + customSlug = "" ) ) val productCreateResult = apiClient.createProduct(productCreateRequest) @@ -1339,7 +1339,8 @@ private fun generateTestCategory(parentId: Int? = null): UpdatedCategory { name = "Category " + randomAlphanumeric(8), description = "Description " + randomAlphanumeric(16), parentId = parentId, - enabled = true + enabled = true, + customSlug = "" ) } @@ -1438,6 +1439,7 @@ private fun generateTestProduct(categoryIds: List = listOf(), discountsAllo productCondition = ProductCondition.USED, externalReferenceId = "EXT_ID_123", customsHsTariffCode = randomAlphanumeric(10), + customSlug = "" ) } @@ -1647,7 +1649,8 @@ private fun UpdatedProduct.cleanupForComparison(productCreateRequest: ProductCre subtitleTranslated = LocalizedValueMap( "ru" to "Сабтайтл", "en" to "Subtitle" - ) + ), + customSlug = "" ) }