Skip to content

Commit 41f1b0e

Browse files
authored
Merge pull request #499 from Ecwid/enable_fixed_price_tests
Enable FIXED_PRICE promotions in tests
2 parents a0d3ea9 + c18ce76 commit 41f1b0e

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ nexusPublishing {
206206
useStaging.set(!project.isSnapshotVersion())
207207
packageGroup.set(PublicationSettings.STAGING_PACKAGE_GROUP)
208208
stagingProfileId.set(PublicationSettings.STAGING_PROFILE_ID)
209+
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
210+
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
209211
username.set(settingsProvider.ossrhUsername)
210212
password.set(settingsProvider.ossrhPassword)
211213
}

src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,54 +164,54 @@ fun generateTestOrder(): UpdatedOrder {
164164

165165
private fun generateTestOnTotalDiscountInfo() = UpdatedOrder.DiscountInfo(
166166
value = randomPrice(),
167-
type = randomEnumValue<DiscountType>(exclude = arrayOf(DiscountType.FIXED_PRICE)),
167+
type = randomEnumValue<DiscountType>(),
168168
base = DiscountBase.ON_TOTAL,
169169
orderTotal = randomPrice(),
170170
description = "On total discount " + randomAlphanumeric(8)
171171
)
172172

173173
private fun generateTestOnMembershipDiscountInfo() = UpdatedOrder.DiscountInfo(
174174
value = randomPrice(),
175-
type = randomEnumValue<DiscountType>(exclude = arrayOf(DiscountType.FIXED_PRICE)),
175+
type = randomEnumValue<DiscountType>(),
176176
base = DiscountBase.ON_MEMBERSHIP,
177177
description = "On membership discount " + randomAlphanumeric(8)
178178
)
179179

180180
private fun generateTestOnTotalAndMembershipDiscountInfo() = UpdatedOrder.DiscountInfo(
181181
value = randomPrice(),
182-
type = randomEnumValue<DiscountType>(exclude = arrayOf(DiscountType.FIXED_PRICE)),
182+
type = randomEnumValue<DiscountType>(),
183183
base = DiscountBase.ON_TOTAL_AND_MEMBERSHIP,
184184
orderTotal = randomPrice(),
185185
description = "On total and membership discount " + randomAlphanumeric(8)
186186
)
187187

188188
private fun generateTestCustomDiscountInfo() = UpdatedOrder.DiscountInfo(
189189
value = randomPrice(),
190-
type = randomEnumValue<DiscountType>(exclude = arrayOf(DiscountType.FIXED_PRICE)),
190+
type = randomEnumValue<DiscountType>(),
191191
base = DiscountBase.CUSTOM,
192192
orderTotal = randomPrice(),
193193
description = "Custom discount " + randomAlphanumeric(8)
194194
)
195195

196196
private fun generateTestItemDiscountInfo() = UpdatedOrder.DiscountInfo(
197197
value = randomPrice(),
198-
type = randomEnumValue<DiscountType>(exclude = arrayOf(DiscountType.FIXED_PRICE)),
198+
type = randomEnumValue<DiscountType>(),
199199
base = DiscountBase.ITEM,
200200
orderTotal = randomPrice(),
201201
description = "On item discount " + randomAlphanumeric(8)
202202
)
203203

204204
private fun generateTestShippingDiscountInfo() = UpdatedOrder.DiscountInfo(
205205
value = randomPrice(),
206-
type = randomEnumValue<DiscountType>(exclude = arrayOf(DiscountType.FIXED_PRICE)),
206+
type = randomEnumValue<DiscountType>(),
207207
base = DiscountBase.SHIPPING,
208208
orderTotal = randomPrice(),
209209
description = "On shipping discount " + randomAlphanumeric(8)
210210
)
211211

212212
private fun generateTestSubtotalDiscountInfo() = UpdatedOrder.DiscountInfo(
213213
value = randomPrice(),
214-
type = randomEnumValue<DiscountType>(exclude = arrayOf(DiscountType.FIXED_PRICE)),
214+
type = randomEnumValue<DiscountType>(),
215215
base = DiscountBase.SUBTOTAL,
216216
orderTotal = randomPrice(),
217217
description = "On subtotal discount " + randomAlphanumeric(8)

0 commit comments

Comments
 (0)