This is an automated email from the ASF dual-hosted git repository.
ashishvijaywargiya pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git
The following commit(s) were added to refs/heads/trunk by this push:
new 4c9f7327b Remove per-component test-run REST wrappers, superseded by
the generic testtools endpoint (#374)
4c9f7327b is described below
commit 4c9f7327b8cb49d1677021d555e5c82d41409258
Author: Ashish Vijaywargiya <[email protected]>
AuthorDate: Sat Aug 22 17:18:36 2026 +0530
Remove per-component test-run REST wrappers, superseded by the generic
testtools endpoint (#374)
Deletes the per-component test-run REST wrapper pattern from example,
ecommerce, assetmaint,
lucene, and scrum:
- the groovy wrapper class in each component (e.g.
ExampleTestRunServices.groovy)
- the two duplicated <service> definitions each wrapper needed, in each
component's
servicedef/services.xml
- each component's own test-run *.rest.xml (for example, this is the
TestRunResource block
removed from its shared rest.xml, since that file also carries example's
own business-service
REST resource; for the other four it is the entire file, since they had
nothing else in it)
ecommerce's servicedef/services.xml and its ofbiz-component.xml
service-resource entry are
removed entirely - that file existed solely to declare the two now-deleted
services.
Why
Superseded by a new, generic, framework-owned REST endpoint added in the
companion
ofbiz-framework pull request, which takes componentName as a URL path
parameter and needs no
per-component files at all. All five components' tests remain reachable,
now via
POST /rest/testtools/testruns/{componentName}
GET /rest/testtools/testruns/{runId}
instead of each component's own separately-branded URL.
No changes to any component's actual test suites, Jupiter test classes, or
testdef files - this
is REST/service wiring only.
Testing
- gradlew classes testClasses passes after each component's change.
- Full sweep against a running server: all five old branded URLs
(example-rest, ecommerce-rest,
assetmaint-rest, lucene-rest, scrum-rest) confirmed gone (404); all five
components' real test
suites confirmed passing end-to-end through the new generic endpoint.
- Full testIntegration run across the whole codebase: 658/658 tests
passing, zero regressions.
Dependency on the companion pull request
This should merge together with, or before, the companion ofbiz-framework
pull request (apache/ofbiz-framework#1699). This PR
removes the last callers of
TestRunServices.runScopedTestSuite/getScopedTestRunStatus, which the
framework PR deletes. Merging the framework PR first while these wrapper
scripts are still
present would leave them calling methods that no longer exist.
---
assetmaint/servicedef/services.xml | 1 +
.../assetmaint/test/FixedAssetMaintTests.groovy | 97 +++++----
ecommerce/ofbiz-component.xml | 2 +-
.../order/test/OrderNotificationTests.groovy | 41 ++--
example/api/example.rest.xml | 18 --
example/servicedef/services.xml | 34 ---
.../ofbiz/example/ExampleTestRunServices.groovy | 41 ----
.../apache/ofbiz/content/test/LuceneTests.groovy | 5 +-
scrum/servicedef/services.xml | 1 +
.../scrum/test/DailyMeetingMinuteTests.groovy | 9 +-
.../org/apache/ofbiz/scrum/test/MyWorkTests.groovy | 71 ++++---
.../ofbiz/scrum/test/ProductBacklogTests.groovy | 235 ++++++++++++---------
.../apache/ofbiz/scrum/test/ProductTests.groovy | 55 +++--
.../ofbiz/scrum/test/ScrumProjectTests.groovy | 73 +++----
.../org/apache/ofbiz/scrum/test/ScrumTests.groovy | 3 +-
.../ofbiz/scrum/test/SprintBacklogTests.groovy | 24 ++-
.../org/apache/ofbiz/scrum/test/SprintTests.groovy | 59 ++++--
.../org/apache/ofbiz/scrum/test/TaskTests.groovy | 6 +-
.../apache/ofbiz/scrum/test/TimesheetTests.groovy | 6 +-
19 files changed, 408 insertions(+), 373 deletions(-)
diff --git a/assetmaint/servicedef/services.xml
b/assetmaint/servicedef/services.xml
index 188f5cc1e..0ae15c0d1 100644
--- a/assetmaint/servicedef/services.xml
+++ b/assetmaint/servicedef/services.xml
@@ -56,4 +56,5 @@ under the License.
<description>Create WorkEffort and Associate it with Parent
(identified by workEffortFromId)</description>
<implements service="createWorkEffortAndAssoc"/>
</service>
+
</services>
diff --git
a/assetmaint/src/test/groovy/org/apache/ofbiz/assetmaint/assetmaint/test/FixedAssetMaintTests.groovy
b/assetmaint/src/test/groovy/org/apache/ofbiz/assetmaint/assetmaint/test/FixedAssetMaintTests.groovy
index 9ddf13493..45e27af48 100644
---
a/assetmaint/src/test/groovy/org/apache/ofbiz/assetmaint/assetmaint/test/FixedAssetMaintTests.groovy
+++
b/assetmaint/src/test/groovy/org/apache/ofbiz/assetmaint/assetmaint/test/FixedAssetMaintTests.groovy
@@ -25,23 +25,43 @@ import org.apache.ofbiz.testtools.JupiterTestHelper
import org.junit.jupiter.api.Order
import org.junit.jupiter.api.Test
+import java.sql.Timestamp
+
@JunitJupiterTest
class FixedAssetMaintTests implements JupiterTestHelper {
+ // Shared by testCreateFixedAssetMaintUpdateWorkEffortWithProductMaint and
+ // testUpdateFixedAssetMaintAndWorkEffort - both need a freshly-created
FixedAssetMaint (with
+ // product maintenance) as their starting point, one to assert on
directly, the other as
+ // fixture setup before its own update assertions.
+ private Map createFixedAssetMaintWithProductMaint() {
+ String fixedAssetId = testParams.fixedAssetId ?: 'DEMO_VEHICLE_01'
+ String statusId = testParams.statusId ?: 'FAM_CREATED'
+ String productMaintSeqId = testParams.productMaintSeqId ?: 'seq03'
+ String intervalMeterTypeId = testParams.intervalMeterTypeId ?:
'ODOMETER'
+ Timestamp estimatedStartDate =
UtilDateTime.toTimestamp(testParams.estimatedStartDate ?: '2009-12-18
00:00:00.000')
+ Timestamp estimatedCompletionDate =
UtilDateTime.toTimestamp(testParams.estimatedCompletionDate ?: '2009-12-18
00:00:00.000')
+ Timestamp actualStartDate =
UtilDateTime.toTimestamp(testParams.actualStartDate ?: '2009-12-20
00:00:00.000')
+ Map serviceCtx = [fixedAssetId: fixedAssetId,
+ statusId: statusId,
+ productMaintSeqId: productMaintSeqId, // product
maintenance,
+ intervalMeterTypeId: intervalMeterTypeId,
+ estimatedStartDate: estimatedStartDate,
+ estimatedCompletionDate: estimatedCompletionDate,
+ actualStartDate: actualStartDate,
+ userLogin: userLogin]
+ Map serviceResult =
dispatcher.runSync('createFixedAssetMaintUpdateWorkEffort', serviceCtx)
+ return [fixedAssetId: fixedAssetId, serviceCtx: serviceCtx,
serviceResult: serviceResult]
+ }
+
@Test
@Order(1)
void testCreateFixedAssetMaintUpdateWorkEffortWithProductMaint() {
// Test case for service createFixedAssetMaintUpdateWorkEffort with a
product Maintenance
- String fixedAssetId = 'DEMO_VEHICLE_01'
- Map serviceCtx = [fixedAssetId: fixedAssetId,
- statusId: 'FAM_CREATED',
- productMaintSeqId: 'seq03', // product maintenance,
- intervalMeterTypeId: 'ODOMETER',
- estimatedStartDate:
UtilDateTime.toTimestamp('2009-12-18 00:00:00.000'),
- estimatedCompletionDate:
UtilDateTime.toTimestamp('2009-12-18 00:00:00.000'),
- actualStartDate:
UtilDateTime.toTimestamp('2009-12-20 00:00:00.000'),
- userLogin: userLogin]
- Map serviceResult =
dispatcher.runSync('createFixedAssetMaintUpdateWorkEffort', serviceCtx)
+ Map created = createFixedAssetMaintWithProductMaint()
+ String fixedAssetId = created.fixedAssetId
+ Map serviceCtx = created.serviceCtx
+ Map serviceResult = created.serviceResult
GenericValue fixedAssetMaint = from('FixedAssetMaint')
.where('fixedAssetId', fixedAssetId,
'maintHistSeqId', serviceResult.maintHistSeqId)
@@ -61,14 +81,20 @@ class FixedAssetMaintTests implements JupiterTestHelper {
@Order(2)
void testCreateFixedAssetMaintUpdateWorkEffortWithoutProductMaint() {
// Test case for service createFixedAssetMaintUpdateWorkEffort without
a product maintenance
- String fixedAssetId = 'DEMO_VEHICLE_01'
+ String fixedAssetId = testParams.fixedAssetId ?: 'DEMO_VEHICLE_01'
+ String statusId = testParams.statusId ?: 'FAM_CREATED'
+ String productMaintTypeId = testParams.productMaintTypeId ?:
'OIL_CHANGE'
+ String intervalMeterTypeId = testParams.intervalMeterTypeId ?:
'ODOMETER'
+ Timestamp estimatedStartDate =
UtilDateTime.toTimestamp(testParams.estimatedStartDate ?: '2009-12-18
00:00:00.000')
+ Timestamp estimatedCompletionDate =
UtilDateTime.toTimestamp(testParams.estimatedCompletionDate ?: '2009-12-18
00:00:00.000')
+ Timestamp actualStartDate =
UtilDateTime.toTimestamp(testParams.actualStartDate ?: '2009-12-20
00:00:00.000')
Map serviceCtx = [fixedAssetId: fixedAssetId,
- statusId: 'FAM_CREATED',
- productMaintTypeId: 'OIL_CHANGE',
- intervalMeterTypeId: 'ODOMETER',
- estimatedStartDate:
UtilDateTime.toTimestamp('2009-12-18 00:00:00.000'),
- estimatedCompletionDate:
UtilDateTime.toTimestamp('2009-12-18 00:00:00.000'),
- actualStartDate:
UtilDateTime.toTimestamp('2009-12-20 00:00:00.000'),
+ statusId: statusId,
+ productMaintTypeId: productMaintTypeId,
+ intervalMeterTypeId: intervalMeterTypeId,
+ estimatedStartDate: estimatedStartDate,
+ estimatedCompletionDate: estimatedCompletionDate,
+ actualStartDate: actualStartDate,
userLogin: userLogin]
Map serviceResult =
dispatcher.runSync('createFixedAssetMaintUpdateWorkEffort', serviceCtx)
String maintHistSeqId = serviceResult.maintHistSeqId
@@ -93,27 +119,25 @@ class FixedAssetMaintTests implements JupiterTestHelper {
@Order(3)
void testUpdateFixedAssetMaintAndWorkEffort() {
// Test case for service updateFixedAssetMaintAndWorkEffort
- String fixedAssetId = 'DEMO_VEHICLE_01'
- Map serviceCtx = [fixedAssetId: fixedAssetId,
- statusId: 'FAM_CREATED',
- productMaintSeqId: 'seq03', // product maintenance,
- intervalMeterTypeId: 'ODOMETER',
- estimatedStartDate:
UtilDateTime.toTimestamp('2009-12-18 00:00:00.000'),
- estimatedCompletionDate:
UtilDateTime.toTimestamp('2009-12-18 00:00:00.000'),
- actualStartDate:
UtilDateTime.toTimestamp('2009-12-20 00:00:00.000'),
- userLogin: userLogin]
- Map serviceResult =
dispatcher.runSync('createFixedAssetMaintUpdateWorkEffort', serviceCtx)
- String maintHistSeqId = serviceResult.maintHistSeqId
+ Map created = createFixedAssetMaintWithProductMaint()
+ String fixedAssetId = created.fixedAssetId
+ String statusId = created.serviceCtx.statusId
+ String intervalMeterTypeId = created.serviceCtx.intervalMeterTypeId
+ String maintHistSeqId = created.serviceResult.maintHistSeqId
GenericValue fixedAssetMaint = from('FixedAssetMaint')
.where('fixedAssetId', fixedAssetId,
'maintHistSeqId', maintHistSeqId)
.queryOne()
- serviceCtx = [fixedAssetId: fixedAssetId,
+
+ String productMaintTypeId = testParams.productMaintTypeId ?:
'OIL_CHANGE'
+ Timestamp updatedEstimatedCompletionDate =
+
UtilDateTime.toTimestamp(testParams.updatedEstimatedCompletionDate ?:
'2009-12-22 01:00:00.000')
+ Map serviceCtx = [fixedAssetId: fixedAssetId,
maintHistSeqId: maintHistSeqId,
- statusId: 'FAM_CREATED',
- productMaintTypeId: 'OIL_CHANGE',
- intervalMeterTypeId: 'ODOMETER',
- estimatedCompletionDate:
UtilDateTime.toTimestamp('2009-12-22 01:00:00.000'),
+ statusId: statusId,
+ productMaintTypeId: productMaintTypeId,
+ intervalMeterTypeId: intervalMeterTypeId,
+ estimatedCompletionDate:
updatedEstimatedCompletionDate,
scheduleWorkEffortId:
fixedAssetMaint.scheduleWorkEffortId,
userLogin: userLogin]
@@ -128,19 +152,20 @@ class FixedAssetMaintTests implements JupiterTestHelper {
assert workEffort.estimatedCompletionDate ==
serviceCtx.estimatedCompletionDate
// Test case for service updateFixedAssetMaintAndWorkEffort
+ String completedStatusId = testParams.completedStatusId ?:
'FAM_COMPLETED'
serviceCtx = [fixedAssetId: fixedAssetMaint.fixedAssetId,
maintHistSeqId: fixedAssetMaint.maintHistSeqId,
scheduleWorkEffortId:
fixedAssetMaint.scheduleWorkEffortId,
- statusId: 'FAM_COMPLETED',
+ statusId: completedStatusId,
actualCompletionDate: UtilDateTime.nowTimestamp(),
userLogin: userLogin]
dispatcher.runSync('updateFixedAssetMaintAndWorkEffort', serviceCtx)
GenericValue newFixedAssetMaint = from('FixedAssetMaint')
- .where('fixedAssetId', 'DEMO_VEHICLE_01',
+ .where('fixedAssetId', fixedAssetId,
'maintHistSeqId', maintHistSeqId)
.queryOne()
- assert newFixedAssetMaint.statusId == 'FAM_COMPLETED'
+ assert newFixedAssetMaint.statusId == completedStatusId
workEffort = from('WorkEffort')
.where('workEffortId', fixedAssetMaint.scheduleWorkEffortId)
.queryOne()
diff --git a/ecommerce/ofbiz-component.xml b/ecommerce/ofbiz-component.xml
index 64f6ff742..2a1c06de9 100644
--- a/ecommerce/ofbiz-component.xml
+++ b/ecommerce/ofbiz-component.xml
@@ -49,7 +49,7 @@ under the License.
<entity-resource type="data" reader-name="demo" loader="main"
location="data/DemoProductAdditionalViewData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main"
location="data/DemoPopularCategoriesData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main"
location="data/DemoContentAltUrl.xml"/>
-
+
<test-suite loader="main" location="testdef/EcommerceTest.xml"/>
<webapp name="ecommerce"
diff --git
a/ecommerce/src/test/groovy/org/apache/ofbiz/ecommerce/order/test/OrderNotificationTests.groovy
b/ecommerce/src/test/groovy/org/apache/ofbiz/ecommerce/order/test/OrderNotificationTests.groovy
index 1be9bfa21..123db7103 100644
---
a/ecommerce/src/test/groovy/org/apache/ofbiz/ecommerce/order/test/OrderNotificationTests.groovy
+++
b/ecommerce/src/test/groovy/org/apache/ofbiz/ecommerce/order/test/OrderNotificationTests.groovy
@@ -30,9 +30,12 @@ class OrderNotificationTests implements JupiterTestHelper {
@Test
@Order(1)
void testSendOrderConfirmation() {
+ String orderId = testParams.orderId ?: 'TEST_DEMO10090'
+ String sendTo = testParams.sendTo ?: '[email protected]'
+
Map serviceCtx = [
- orderId: 'TEST_DEMO10090',
- sendTo: '[email protected]',
+ orderId: orderId,
+ sendTo: sendTo,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync('sendOrderConfirmation',
serviceCtx)
@@ -43,11 +46,16 @@ class OrderNotificationTests implements JupiterTestHelper {
@Test
@Order(2)
void testSendOrderChangeNotification() {
+ String orderId = testParams.orderId ?: 'TEST_DEMO10090'
+ String note = testParams.note ?: 'Test Note'
+ String comments = testParams.comments ?: 'Test comments'
+ String sendTo = testParams.sendTo ?: '[email protected]'
+
Map serviceCtx = [
- orderId: 'TEST_DEMO10090',
- note: 'Test Note',
- comments: 'Test comments',
- sendTo: '[email protected]',
+ orderId: orderId,
+ note: note,
+ comments: comments,
+ sendTo: sendTo,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync('sendOrderChangeNotification',
serviceCtx)
@@ -58,9 +66,12 @@ class OrderNotificationTests implements JupiterTestHelper {
@Test
@Order(3)
void testSendOrderBackorderNotification() {
+ String orderId = testParams.orderId ?: 'TEST_DEMO10090'
+ String sendTo = testParams.sendTo ?: '[email protected]'
+
Map serviceCtx = [
- orderId: 'TEST_DEMO10090',
- sendTo: '[email protected]',
+ orderId: orderId,
+ sendTo: sendTo,
userLogin: userLogin
]
Map serviceResult =
dispatcher.runSync('sendOrderBackorderNotification', serviceCtx)
@@ -71,9 +82,12 @@ class OrderNotificationTests implements JupiterTestHelper {
@Test
@Order(4)
void testsendOrderPayRetryNotification() {
+ String orderId = testParams.orderId ?: 'TEST_DEMO10090'
+ String sendTo = testParams.sendTo ?: '[email protected]'
+
Map serviceCtx = [
- orderId: 'TEST_DEMO10090',
- sendTo: '[email protected]',
+ orderId: orderId,
+ sendTo: sendTo,
userLogin: userLogin
]
Map serviceResult =
dispatcher.runSync('sendOrderPayRetryNotification', serviceCtx)
@@ -84,9 +98,12 @@ class OrderNotificationTests implements JupiterTestHelper {
@Test
@Order(5)
void testsendOrderCompleteNotification() {
+ String orderId = testParams.orderId ?: 'TEST_DEMO10090'
+ String sendTo = testParams.sendTo ?: '[email protected]'
+
Map serviceCtx = [
- orderId: 'TEST_DEMO10090',
- sendTo: '[email protected]',
+ orderId: orderId,
+ sendTo: sendTo,
userLogin: userLogin
]
Map serviceResult =
dispatcher.runSync('sendOrderCompleteNotification', serviceCtx)
diff --git a/example/api/example.rest.xml b/example/api/example.rest.xml
index 0a5a72b3b..50f60ae02 100644
--- a/example/api/example.rest.xml
+++ b/example/api/example.rest.xml
@@ -50,22 +50,4 @@ under the License.
<service name="findExampleById"/>
</operation>
</resource>
-
- <resource name="TestRunResource"
- path="testruns"
- displayName="Test Run"
- description="Trigger and poll example component test runs only -
componentName is not accepted, permanently scoped to the example component"
- primaryPermission="TESTEXEC"
- mainAction="ADMIN">
-
- <operation verb="post" description="Trigger a test suite run (scoped
to the example component)"
- consumes="application/json">
- <service name="runExampleTestSuite"/>
- </operation>
-
- <operation verb="get" description="Get a test run's status (scoped to
the example component)"
- path="{runId}">
- <service name="getExampleTestRunStatus"/>
- </operation>
- </resource>
</api>
\ No newline at end of file
diff --git a/example/servicedef/services.xml b/example/servicedef/services.xml
index 41654e5e6..bd0d25c77 100644
--- a/example/servicedef/services.xml
+++ b/example/servicedef/services.xml
@@ -178,38 +178,4 @@ under the License.
<auto-attributes include="pk" mode="IN" optional="false"/>
</service>
- <!-- Test Run Services (component-scoped wrapper around
framework/testtools) -->
- <service name="runExampleTestSuite" engine="groovy" auth="true"
-
location="component://example/src/test/groovy/org/apache/ofbiz/example/ExampleTestRunServices.groovy"
- invoke="runExampleTestSuite">
- <description>Kicks off a testdef test-suite run asynchronously, scoped
to the example
- component only - see TestRunServices.runScopedTestSuite. Gated by
the test.api.enabled
- config flag and the TESTEXEC_ADMIN permission (checked inside the
underlying service).
- Also gated by the per-component test.api.enabled.example override
- same
- SystemProperty-backed mechanism, defaults to enabled, lets this
component's endpoint be
- disabled independently of every other component's. componentName
is deliberately not an
- attribute here - the component is fixed, not caller-suppliable.
testMethodName optionally
- scopes the run to one @Test/@ParameterizedTest method within the
class testCaseName
- resolves to - requires testCaseName, and only applies when it
resolves to a
- jupiter-test-suite.</description>
- <attribute name="suiteName" type="String" mode="IN" optional="false"/>
- <attribute name="testCaseName" type="String" mode="IN"
optional="true"/>
- <attribute name="testMethodName" type="String" mode="IN"
optional="true"/>
- <attribute name="testParams" type="Map" mode="IN" optional="true"/>
- <attribute name="runId" type="String" mode="OUT" optional="true"/>
- </service>
-
- <service name="getExampleTestRunStatus" engine="groovy" auth="true"
-
location="component://example/src/test/groovy/org/apache/ofbiz/example/ExampleTestRunServices.groovy"
- invoke="getExampleTestRunStatus">
- <description>Reads a runExampleTestSuite-triggered run's status,
scoped to the example
- component only - a runId belonging to another component's run is
reported as
- not-found, not a distinguishable "wrong component" error. See
- TestRunServices.getScopedTestRunStatus.</description>
- <attribute name="runId" type="String" mode="IN" optional="false"/>
- <attribute name="status" type="String" mode="OUT" optional="true"/>
- <attribute name="componentName" type="String" mode="OUT"
optional="true"/>
- <attribute name="resultSummary" type="Map" mode="OUT" optional="true"/>
- </service>
-
</services>
diff --git
a/example/src/test/groovy/org/apache/ofbiz/example/ExampleTestRunServices.groovy
b/example/src/test/groovy/org/apache/ofbiz/example/ExampleTestRunServices.groovy
deleted file mode 100644
index 015a31784..000000000
---
a/example/src/test/groovy/org/apache/ofbiz/example/ExampleTestRunServices.groovy
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://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.
- */
-package org.apache.ofbiz.example
-
-import org.apache.ofbiz.testtools.TestRunServices
-
-// Component-scoped wrapper around TestRunServices'
runTestSuite/getTestRunStatus, forced to this
-// component ("example") only - a caller can never trigger or poll another
component's tests
-// through these two services, regardless of what componentName (if any) they
supply.
-//
-// Meant to double as the copy-paste template for any other component adopting
the same pattern:
-// copy this script, rename it and its two methods, and change the 'example'
literal below - no
-// changes to TestRunServices itself are needed.
-
-// Not a script-level variable: top-level locals in a Groovy service script
aren't visible inside
-// the def methods below (they belong to the generated run() method, not the
class), so the fixed
-// component name is a literal in each method instead.
-
-Map runExampleTestSuite() {
- return TestRunServices.runScopedTestSuite(dctx, parameters, 'example')
-}
-
-Map getExampleTestRunStatus() {
- return TestRunServices.getScopedTestRunStatus(dctx, parameters, 'example')
-}
diff --git
a/lucene/src/test/groovy/org/apache/ofbiz/content/test/LuceneTests.groovy
b/lucene/src/test/groovy/org/apache/ofbiz/content/test/LuceneTests.groovy
index be4a56ecf..2d5d28ce6 100644
--- a/lucene/src/test/groovy/org/apache/ofbiz/content/test/LuceneTests.groovy
+++ b/lucene/src/test/groovy/org/apache/ofbiz/content/test/LuceneTests.groovy
@@ -40,8 +40,9 @@ class LuceneTests implements JupiterTestHelper {
@Test
void testSearchTermHand() {
+ String contentId = testParams.contentId ?: 'LuceneCONTENT'
Map ctx = [
- contentId: 'LuceneCONTENT',
+ contentId: contentId,
userLogin: userLogin
]
Map resp = dispatcher.runSync('indexContentTree', ctx)
@@ -64,7 +65,7 @@ class LuceneTests implements JupiterTestHelper {
}
BooleanQuery.Builder combQueryBuilder = new BooleanQuery.Builder()
- String queryLine = 'hand'
+ String queryLine = testParams.queryLine ?: 'hand'
IndexSearcher searcher = new IndexSearcher(reader)
Analyzer analyzer = new StandardAnalyzer()
diff --git a/scrum/servicedef/services.xml b/scrum/servicedef/services.xml
index 3133a5e4a..11f5f0d17 100644
--- a/scrum/servicedef/services.xml
+++ b/scrum/servicedef/services.xml
@@ -287,4 +287,5 @@ under the License.
</description>
<attribute name="communicationEventId" type="String" mode="IN"
optional="false"/>
</service>
+
</services>
diff --git
a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/DailyMeetingMinuteTests.groovy
b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/DailyMeetingMinuteTests.groovy
index c11bffcd9..89e83c264 100644
---
a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/DailyMeetingMinuteTests.groovy
+++
b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/DailyMeetingMinuteTests.groovy
@@ -31,10 +31,13 @@ class DailyMeetingMinuteTests implements JupiterTestHelper {
// Equivalent: call createWorkEffortNote service which does the same.
@Test
void testDailyMinute() {
+ String workEffortId = testParams.workEffortId ?: 'DEMO-SPRINT-1'
+ String noteInfo = testParams.noteInfo ?: 'NoteInfo'
+ String noteName = testParams.noteName ?: 'NOTE-1-Name'
Map serviceCtx = [
- workEffortId: 'DEMO-SPRINT-1',
- noteInfo: 'NoteInfo',
- noteName: 'NOTE-1-Name',
+ workEffortId: workEffortId,
+ noteInfo: noteInfo,
+ noteName: noteName,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync('createWorkEffortNote',
serviceCtx)
diff --git
a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/MyWorkTests.groovy
b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/MyWorkTests.groovy
index 3c7633ad4..e30a94b9f 100644
--- a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/MyWorkTests.groovy
+++ b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/MyWorkTests.groovy
@@ -29,16 +29,20 @@ import org.junit.jupiter.api.Test
@JunitJupiterTest
class MyWorkTests implements JupiterTestHelper {
- // Migrated from
MyWorkTests.xml:testUpdateTimesheetEntryByWorkeffortNotComplete
- @Test
- @Order(1)
- void testUpdateTimesheetEntryByWorkeffortNotComplete() {
+ // Shared by testUpdateTimesheetEntryByWorkeffortNotComplete/Complete
below - identical apart
+ // from the checkComplete flag each test exercises.
+ private void updateTimesheetEntryByWorkeffort(String defaultCheckComplete)
{
+ String timesheetId = testParams.timesheetId ?: 'DEMO-TIMESHEET1'
+ String workEffortId = testParams.workEffortId ?: 'DEMO-TASK-1'
+ Double planHours = (testParams.planHours ?: 2.0d) as Double
+ Double hoursDay0 = (testParams.hoursDay0 ?: 1.0d) as Double
+ String checkComplete = testParams.checkComplete ?: defaultCheckComplete
Map serviceCtx = [
- timesheetId: 'DEMO-TIMESHEET1',
- workEffortId: 'DEMO-TASK-1',
- planHours_o_0: 2.0d,
- hoursDay0_o_0: 1.0d,
- checkComplete: 'N',
+ timesheetId: timesheetId,
+ workEffortId: workEffortId,
+ planHours_o_0: planHours,
+ hoursDay0_o_0: hoursDay0,
+ checkComplete: checkComplete,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync(
@@ -46,21 +50,18 @@ class MyWorkTests implements JupiterTestHelper {
assert ServiceUtil.isSuccess(serviceResult)
}
+ // Migrated from
MyWorkTests.xml:testUpdateTimesheetEntryByWorkeffortNotComplete
+ @Test
+ @Order(1)
+ void testUpdateTimesheetEntryByWorkeffortNotComplete() {
+ updateTimesheetEntryByWorkeffort('N')
+ }
+
// Migrated from
MyWorkTests.xml:testUpdateTimesheetEntryByWorkeffortComplete
@Test
@Order(2)
void testUpdateTimesheetEntryByWorkeffortComplete() {
- Map serviceCtx = [
- timesheetId: 'DEMO-TIMESHEET1',
- workEffortId: 'DEMO-TASK-1',
- planHours_o_0: 2.0d,
- hoursDay0_o_0: 1.0d,
- checkComplete: 'Y',
- userLogin: userLogin
- ]
- Map serviceResult = dispatcher.runSync(
- 'updateTimesheetEntryByWorkeffort', serviceCtx)
- assert ServiceUtil.isSuccess(serviceResult)
+ updateTimesheetEntryByWorkeffort('Y')
}
// Migrated from MyWorkTests.xml:testUpdateTask
@@ -68,9 +69,11 @@ class MyWorkTests implements JupiterTestHelper {
@Test
@Order(3)
void testUpdateTask() {
+ String workEffortId = testParams.workEffortId ?: 'DEMO-TASK-2'
+ Long estimatedMilliSeconds = (testParams.estimatedMilliSeconds ?:
3600000L) as Long
Map serviceCtx = [
- workEffortId: 'DEMO-TASK-2',
- estimatedMilliSeconds: 3600000L,
+ workEffortId: workEffortId,
+ estimatedMilliSeconds: estimatedMilliSeconds,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync('updateWorkEffort', serviceCtx)
@@ -81,16 +84,18 @@ class MyWorkTests implements JupiterTestHelper {
@Test
@Order(4)
void testRemoveTaskAssignToMe() {
+ String workEffortId = testParams.workEffortId ?: 'DEMO-TASK-2'
+ String partyId = testParams.partyId ?: 'SCRUMTEAM-2'
List<GenericValue> listWorkAssignment =
EntityQuery.use(delegator).from('WorkEffortPartyAssignment')
- .where('workEffortId', 'DEMO-TASK-2',
- 'partyId', 'SCRUMTEAM-2')
+ .where('workEffortId', workEffortId,
+ 'partyId', partyId)
.queryList()
assert listWorkAssignment
GenericValue assignment = listWorkAssignment[0]
Map serviceCtx = [
- workEffortId: 'DEMO-TASK-2',
- partyId: 'SCRUMTEAM-2',
+ workEffortId: workEffortId,
+ partyId: partyId,
roleTypeId: assignment.roleTypeId,
fromDate: assignment.fromDate,
userLogin: userLogin
@@ -104,10 +109,12 @@ class MyWorkTests implements JupiterTestHelper {
@Test
@Order(5)
void testAddNewTimesheet() {
+ String partyId = testParams.partyId ?: 'SCRUMTEAM-2'
+ java.sql.Timestamp requiredDate = java.sql.Timestamp.valueOf(
+ testParams.requiredDate ?: '2010-08-23 11:44:08.418')
Map serviceCtx = [
- partyId: 'SCRUMTEAM-2',
- requiredDate: java.sql.Timestamp.valueOf(
- '2010-08-23 11:44:08.418'),
+ partyId: partyId,
+ requiredDate: requiredDate,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync(
@@ -119,9 +126,11 @@ class MyWorkTests implements JupiterTestHelper {
@Test
@Order(6)
void testSetTimeSheetStatusToComplete() {
+ String timesheetId = testParams.timesheetId ?: 'DEMO-TIMESHEET2'
+ String statusId = testParams.statusId ?: 'TIMESHEET_COMPLETED'
Map serviceCtx = [
- timesheetId: 'DEMO-TIMESHEET2',
- statusId: 'TIMESHEET_COMPLETED',
+ timesheetId: timesheetId,
+ statusId: statusId,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync('updateTimesheet', serviceCtx)
diff --git
a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/ProductBacklogTests.groovy
b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/ProductBacklogTests.groovy
index 7d7c8cf4c..4f378a5c3 100644
---
a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/ProductBacklogTests.groovy
+++
b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/ProductBacklogTests.groovy
@@ -34,13 +34,21 @@ class ProductBacklogTests implements JupiterTestHelper {
GenericValue adminUserLogin = from('UserLogin').where('userLoginId',
'admin').queryOne()
assert adminUserLogin
+ String custRequestId = testParams.custRequestId ?: 'TEST5'
+ String custRequestName = testParams.custRequestName ?: 'TEST Product
Backlog'
+ String productId = testParams.productId ?: 'DEMO-PRODUCT-1'
+ String description = testParams.description ?: 'TEST Product Backlog'
+ String custRequestTypeId = testParams.custRequestTypeId ?:
'RF_PROD_BACKLOG'
+ String statusId = testParams.statusId ?: 'CRQ_ACCEPTED'
+ String cancelledStatusId = testParams.cancelledStatusId ?:
'CRQ_CANCELLED'
+
// Create
Map createCtx = [
- custRequestName: 'TEST Product Backlog',
- productId: 'DEMO-PRODUCT-1',
- description: 'TEST Product Backlog',
- custRequestTypeId: 'RF_PROD_BACKLOG',
- statusId: 'CRQ_ACCEPTED',
+ custRequestName: custRequestName,
+ productId: productId,
+ description: description,
+ custRequestTypeId: custRequestTypeId,
+ statusId: statusId,
fromPartyId: adminUserLogin.partyId,
userLogin: adminUserLogin
]
@@ -49,21 +57,21 @@ class ProductBacklogTests implements JupiterTestHelper {
// Update
Map updateCtx = [
- custRequestId: 'TEST5',
- custRequestName: 'TEST Product Backlog',
- description: 'TEST Product Backlog',
- statusId: 'CRQ_ACCEPTED',
+ custRequestId: custRequestId,
+ custRequestName: custRequestName,
+ description: description,
+ statusId: statusId,
userLogin: adminUserLogin
]
Map updateResult = dispatcher.runSync('updateCustRequest', updateCtx)
assert ServiceUtil.isSuccess(updateResult)
// Delete
- GenericValue result = from('CustRequest').where('custRequestId',
'TEST5').queryOne()
- if (result && result.statusId == 'CRQ_ACCEPTED') {
+ GenericValue result = from('CustRequest').where('custRequestId',
custRequestId).queryOne()
+ if (result && result.statusId == statusId) {
Map deleteCtx = [
- custRequestId: 'TEST5',
- statusId: 'CRQ_CANCELLED',
+ custRequestId: custRequestId,
+ statusId: cancelledStatusId,
userLogin: adminUserLogin
]
Map deleteResult = dispatcher.runSync('updateCustRequest',
deleteCtx)
@@ -77,13 +85,21 @@ class ProductBacklogTests implements JupiterTestHelper {
GenericValue poUserLogin = from('UserLogin').where('userLoginId',
'productowner').queryOne()
assert poUserLogin
+ String custRequestId = testParams.custRequestId ?: 'TEST6'
+ String custRequestName = testParams.custRequestName ?: 'TEST Product
Backlog'
+ String productId = testParams.productId ?: 'DEMO-PRODUCT-1'
+ String description = testParams.description ?: 'TEST Product Backlog'
+ String custRequestTypeId = testParams.custRequestTypeId ?:
'RF_PROD_BACKLOG'
+ String statusId = testParams.statusId ?: 'CRQ_ACCEPTED'
+ String cancelledStatusId = testParams.cancelledStatusId ?:
'CRQ_CANCELLED'
+
// Create
Map createCtx = [
- custRequestName: 'TEST Product Backlog',
- productId: 'DEMO-PRODUCT-1',
- description: 'TEST Product Backlog',
- custRequestTypeId: 'RF_PROD_BACKLOG',
- statusId: 'CRQ_ACCEPTED',
+ custRequestName: custRequestName,
+ productId: productId,
+ description: description,
+ custRequestTypeId: custRequestTypeId,
+ statusId: statusId,
fromPartyId: poUserLogin.partyId,
userLogin: poUserLogin
]
@@ -92,21 +108,21 @@ class ProductBacklogTests implements JupiterTestHelper {
// Update
Map updateCtx = [
- custRequestId: 'TEST6',
- custRequestName: 'TEST Product Backlog',
- description: 'TEST Product Backlog',
- statusId: 'CRQ_ACCEPTED',
+ custRequestId: custRequestId,
+ custRequestName: custRequestName,
+ description: description,
+ statusId: statusId,
userLogin: poUserLogin
]
Map updateResult = dispatcher.runSync('updateCustRequest', updateCtx)
assert ServiceUtil.isSuccess(updateResult)
// Delete
- GenericValue result = from('CustRequest').where('custRequestId',
'TEST6').queryOne()
- if (result && result.statusId == 'CRQ_ACCEPTED') {
+ GenericValue result = from('CustRequest').where('custRequestId',
custRequestId).queryOne()
+ if (result && result.statusId == statusId) {
Map deleteCtx = [
- custRequestId: 'TEST6',
- statusId: 'CRQ_CANCELLED',
+ custRequestId: custRequestId,
+ statusId: cancelledStatusId,
userLogin: poUserLogin
]
Map deleteResult = dispatcher.runSync('updateCustRequest',
deleteCtx)
@@ -120,13 +136,21 @@ class ProductBacklogTests implements JupiterTestHelper {
GenericValue smUserLogin = from('UserLogin').where('userLoginId',
'scrummaster').queryOne()
assert smUserLogin
+ String custRequestName = testParams.custRequestName ?: 'TEST Product
Backlog'
+ String productId = testParams.productId ?: 'DEMO-PRODUCT-1'
+ String description = testParams.description ?: 'TEST Product Backlog'
+ String custRequestTypeId = testParams.custRequestTypeId ?:
'RF_PROD_BACKLOG'
+ String statusId = testParams.statusId ?: 'CRQ_ACCEPTED'
+ String custRequestId = testParams.custRequestId ?: 'TEST7'
+ String cancelledStatusId = testParams.cancelledStatusId ?:
'CRQ_CANCELLED'
+
// Create
Map createCtx = [
- custRequestName: 'TEST Product Backlog',
- productId: 'DEMO-PRODUCT-1',
- description: 'TEST Product Backlog',
- custRequestTypeId: 'RF_PROD_BACKLOG',
- statusId: 'CRQ_ACCEPTED',
+ custRequestName: custRequestName,
+ productId: productId,
+ description: description,
+ custRequestTypeId: custRequestTypeId,
+ statusId: statusId,
fromPartyId: smUserLogin.partyId,
userLogin: smUserLogin
]
@@ -135,8 +159,8 @@ class ProductBacklogTests implements JupiterTestHelper {
// Delete
Map deleteCtx = [
- custRequestId: 'TEST7',
- statusId: 'CRQ_CANCELLED',
+ custRequestId: custRequestId,
+ statusId: cancelledStatusId,
userLogin: smUserLogin
]
Map deleteResult = dispatcher.runSync('updateCustRequest', deleteCtx)
@@ -147,12 +171,17 @@ class ProductBacklogTests implements JupiterTestHelper {
@Order(4)
void testCreateBacklogSetStatus() {
GenericValue poUserLogin = from('UserLogin').where('userLoginId',
'productowner').queryOne()
+ String custRequestName = testParams.custRequestName ?: 'TEST Product
Backlog'
+ String productId = testParams.productId ?: 'DEMO-PRODUCT-1'
+ String description = testParams.description ?: 'TEST Product Backlog'
+ String custRequestTypeId = testParams.custRequestTypeId ?:
'RF_PROD_BACKLOG'
+ String statusId = testParams.statusId ?: 'CRQ_ACCEPTED'
Map serviceCtx = [
- custRequestName: 'TEST Product Backlog',
- productId: 'DEMO-PRODUCT-1',
- description: 'TEST Product Backlog',
- custRequestTypeId: 'RF_PROD_BACKLOG',
- statusId: 'CRQ_ACCEPTED',
+ custRequestName: custRequestName,
+ productId: productId,
+ description: description,
+ custRequestTypeId: custRequestTypeId,
+ statusId: statusId,
fromPartyId: poUserLogin.partyId,
userLogin: poUserLogin
]
@@ -164,12 +193,17 @@ class ProductBacklogTests implements JupiterTestHelper {
@Order(5)
void testCreateDefaultBacklogs() {
GenericValue adminUserLogin = from('UserLogin').where('userLoginId',
'admin').queryOne()
+ String workEffortName = testParams.workEffortName ?: 'Test Default
Task'
+ String description = testParams.description ?: 'Test Project'
+ String workEffortTypeId = testParams.workEffortTypeId ?:
'SCRUM_TASK_IMPL'
+ String workEffortPurposeTypeId = testParams.workEffortPurposeTypeId ?:
'SCRUM_DEFAULT_TASK'
+ String currentStatusId = testParams.currentStatusId ?: 'STS_CREATED'
Map serviceCtx = [
- workEffortName: 'Test Default Task',
- description: 'Test Project',
- workEffortTypeId: 'SCRUM_TASK_IMPL',
- workEffortPurposeTypeId: 'SCRUM_DEFAULT_TASK',
- currentStatusId: 'STS_CREATED',
+ workEffortName: workEffortName,
+ description: description,
+ workEffortTypeId: workEffortTypeId,
+ workEffortPurposeTypeId: workEffortPurposeTypeId,
+ currentStatusId: currentStatusId,
userLogin: adminUserLogin
]
Map serviceResult = dispatcher.runSync('createWorkEffort', serviceCtx)
@@ -180,12 +214,17 @@ class ProductBacklogTests implements JupiterTestHelper {
@Order(6)
void testProductBacklogCategoryOperations() {
GenericValue adminUserLogin = from('UserLogin').where('userLoginId',
'admin').queryOne()
+ String custRequestName = testParams.custRequestName ?: 'Backlog'
+ String custRequestTypeId = testParams.custRequestTypeId ?:
'RF_PROD_BACKLOG'
+ String statusId = testParams.statusId ?: 'CRQ_ACCEPTED'
+ String productId = testParams.productId ?: 'DEMO-PRODUCT-1'
+ String updateCustRequestId = testParams.updateCustRequestId ?: 'TEST10'
// Create
Map createCtx = [
- custRequestName: 'Backlog',
- custRequestTypeId: 'RF_PROD_BACKLOG',
- statusId: 'CRQ_ACCEPTED',
+ custRequestName: custRequestName,
+ custRequestTypeId: custRequestTypeId,
+ statusId: statusId,
fromPartyId: adminUserLogin.partyId,
userLogin: adminUserLogin
]
@@ -195,7 +234,7 @@ class ProductBacklogTests implements JupiterTestHelper {
String custRequestId = createResult.custRequestId
Map itemCtx = [
custRequestId: custRequestId,
- productId: 'DEMO-PRODUCT-1',
+ productId: productId,
userLogin: adminUserLogin
]
Map itemResult = dispatcher.runSync('createCustRequestItem', itemCtx)
@@ -203,8 +242,8 @@ class ProductBacklogTests implements JupiterTestHelper {
// Update
Map updateCtx = [
- custRequestId: 'TEST10',
- custRequestName: 'Backlog',
+ custRequestId: updateCustRequestId,
+ custRequestName: custRequestName,
userLogin: adminUserLogin
]
Map updateResult = dispatcher.runSync('updateCustRequest', updateCtx)
@@ -215,15 +254,22 @@ class ProductBacklogTests implements JupiterTestHelper {
@Order(7)
void testProductBacklogEmailOperations() {
GenericValue systemUserLogin = from('UserLogin').where('userLoginId',
'system').queryOne()
+ String productId = testParams.productId ?: 'DEMO-PRODUCT-1'
+ String custRequestId = testParams.custRequestId ?: 'TEST10'
+ String communicationEventTypeId = testParams.communicationEventTypeId
?: 'EMAIL_COMMUNICATION'
+ String partyIdFrom = testParams.partyIdFrom ?: 'DemoCustomer-1'
+ String partyIdTo = testParams.partyIdTo ?: 'SCRUMASTER'
+ String subject = testParams.subject ?: 'Test New Product Backlog Email'
+ String communicationEventId = testParams.communicationEventId ?:
'DEMO-COM-PRODUCT-1'
// Create
Map createCtx = [
- productId: 'DEMO-PRODUCT-1',
- custRequestId: 'TEST10',
- communicationEventTypeId: 'EMAIL_COMMUNICATION',
- partyIdFrom: 'DemoCustomer-1',
- partyIdTo: 'SCRUMASTER',
- subject: 'Test New Product Backlog Email',
+ productId: productId,
+ custRequestId: custRequestId,
+ communicationEventTypeId: communicationEventTypeId,
+ partyIdFrom: partyIdFrom,
+ partyIdTo: partyIdTo,
+ subject: subject,
userLogin: systemUserLogin
]
Map createResult = dispatcher.runSync('createCommunicationEvent',
createCtx)
@@ -231,83 +277,62 @@ class ProductBacklogTests implements JupiterTestHelper {
// Update
Map updateCtx = [
- communicationEventId: 'DEMO-COM-PRODUCT-1',
- productId: 'DEMO-PRODUCT-1',
- custRequestId: 'TEST10',
- communicationEventTypeId: 'EMAIL_COMMUNICATION',
- subject: 'Test New Product Backlog Email',
+ communicationEventId: communicationEventId,
+ productId: productId,
+ custRequestId: custRequestId,
+ communicationEventTypeId: communicationEventTypeId,
+ subject: subject,
userLogin: systemUserLogin
]
Map updateResult = dispatcher.runSync('updateCommunicationEvent',
updateCtx)
assert ServiceUtil.isSuccess(updateResult)
}
- @Test
- @Order(8)
- void testUpdateSprintBacklogseqDown() {
+ // Shared by the 4 testUpdateSprintBacklogseq* tests below - identical
apart from the mode
+ // each test moves the backlog item by.
+ private void updateSprintBacklogseq(String defaultMode) {
GenericValue systemUserLogin = from('UserLogin').where('userLoginId',
'system').queryOne()
+ String mode = testParams.mode ?: defaultMode
+ String custRequestId = testParams.custRequestId ?: 'TEST9'
+ String productId = testParams.productId ?: 'DEMO-PRODUCT-1'
+ String custRequestItemSeqId = testParams.custRequestItemSeqId ?:
'TESTSEQ9'
+ String statusId = testParams.statusId ?: 'CRQ_ACCEPTED'
+ String searchOptionStatusId = testParams.searchOptionStatusId ?:
'CRQ_ACCEPTED'
Map serviceCtx = [
- mode: 'DWN',
- custRequestId: 'TEST9',
- productId: 'DEMO-PRODUCT-1',
- custRequestItemSeqId: 'TESTSEQ9',
- statusId: 'CRQ_ACCEPTED',
- searchOption_statusId: 'CRQ_ACCEPTED',
+ mode: mode,
+ custRequestId: custRequestId,
+ productId: productId,
+ custRequestItemSeqId: custRequestItemSeqId,
+ statusId: statusId,
+ searchOption_statusId: searchOptionStatusId,
userLogin: systemUserLogin
]
Map serviceResult = dispatcher.runSync('updateSprintBacklogseq',
serviceCtx)
assert ServiceUtil.isSuccess(serviceResult)
}
+ @Test
+ @Order(8)
+ void testUpdateSprintBacklogseqDown() {
+ updateSprintBacklogseq('DWN')
+ }
+
@Test
@Order(9)
void testUpdateSprintBacklogseqUP() {
- GenericValue systemUserLogin = from('UserLogin').where('userLoginId',
'system').queryOne()
- Map serviceCtx = [
- mode: 'UP',
- custRequestId: 'TEST9',
- productId: 'DEMO-PRODUCT-1',
- custRequestItemSeqId: 'TESTSEQ9',
- statusId: 'CRQ_ACCEPTED',
- searchOption_statusId: 'CRQ_ACCEPTED',
- userLogin: systemUserLogin
- ]
- Map serviceResult = dispatcher.runSync('updateSprintBacklogseq',
serviceCtx)
- assert ServiceUtil.isSuccess(serviceResult)
+ updateSprintBacklogseq('UP')
}
@Test
@Order(10)
void testUpdateSprintBacklogseqBotton() {
- GenericValue systemUserLogin = from('UserLogin').where('userLoginId',
'system').queryOne()
- Map serviceCtx = [
- mode: 'BOT',
- custRequestId: 'TEST9',
- productId: 'DEMO-PRODUCT-1',
- custRequestItemSeqId: 'TESTSEQ9',
- statusId: 'CRQ_ACCEPTED',
- searchOption_statusId: 'CRQ_ACCEPTED',
- userLogin: systemUserLogin
- ]
- Map serviceResult = dispatcher.runSync('updateSprintBacklogseq',
serviceCtx)
- assert ServiceUtil.isSuccess(serviceResult)
+ updateSprintBacklogseq('BOT')
}
@Test
@Order(11)
void testUpdateSprintBacklogseqTOP() {
- GenericValue systemUserLogin = from('UserLogin').where('userLoginId',
'system').queryOne()
- Map serviceCtx = [
- mode: 'TOP',
- custRequestId: 'TEST9',
- productId: 'DEMO-PRODUCT-1',
- custRequestItemSeqId: 'TESTSEQ9',
- statusId: 'CRQ_ACCEPTED',
- searchOption_statusId: 'CRQ_ACCEPTED',
- userLogin: systemUserLogin
- ]
- Map serviceResult = dispatcher.runSync('updateSprintBacklogseq',
serviceCtx)
- assert ServiceUtil.isSuccess(serviceResult)
+ updateSprintBacklogseq('TOP')
}
}
diff --git
a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/ProductTests.groovy
b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/ProductTests.groovy
index 2a0238454..e864a6724 100644
--- a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/ProductTests.groovy
+++ b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/ProductTests.groovy
@@ -36,10 +36,15 @@ class ProductTests implements JupiterTestHelper {
GenericValue adminUserLogin = from('UserLogin').where('userLoginId',
'admin').queryOne()
assert adminUserLogin
+ String internalName = testParams.internalName ?: 'Demo Product 1'
+ String longDescription = testParams.longDescription ?:
'Demo-Create-Description'
+ String productTypeId = testParams.productTypeId ?: 'SCRUM_ITEM'
+ String partyId = testParams.partyId ?: 'DemoCustomer-1'
+ String roleTypeId = testParams.roleTypeId ?: 'PRODUCT_OWNER'
Map serviceCtx = [
- internalName: 'Demo Product 1',
- longDescription: 'Demo-Create-Description',
- productTypeId: 'SCRUM_ITEM',
+ internalName: internalName,
+ longDescription: longDescription,
+ productTypeId: productTypeId,
introductionDate: UtilDateTime.nowTimestamp(),
userLogin: adminUserLogin
]
@@ -50,8 +55,8 @@ class ProductTests implements JupiterTestHelper {
Map roleCtx = [
productId: productId,
- partyId: 'DemoCustomer-1',
- roleTypeId: 'PRODUCT_OWNER',
+ partyId: partyId,
+ roleTypeId: roleTypeId,
userLogin: adminUserLogin
]
Map roleResult = dispatcher.runSync('addPartyToProduct', roleCtx)
@@ -64,11 +69,17 @@ class ProductTests implements JupiterTestHelper {
GenericValue adminUserLogin = from('UserLogin').where('userLoginId',
'admin').queryOne()
assert adminUserLogin
+ String productId = testParams.productId ?: 'DEMO-PRODUCT-1'
+ String internalName = testParams.internalName ?: 'Demo Product 1
Updated'
+ String longDescription = testParams.longDescription ?:
'Demo-Update-Description'
+ String productTypeId = testParams.productTypeId ?: 'SCRUM_ITEM'
+ String partyId = testParams.partyId ?: 'DemoCustomer-1'
+ String roleTypeId = testParams.roleTypeId ?: 'PRODUCT_OWNER'
Map serviceCtx = [
- productId: 'DEMO-PRODUCT-1',
- internalName: 'Demo Product 1 Updated',
- longDescription: 'Demo-Update-Description',
- productTypeId: 'SCRUM_ITEM',
+ productId: productId,
+ internalName: internalName,
+ longDescription: longDescription,
+ productTypeId: productTypeId,
userLogin: adminUserLogin
]
Map serviceResult = dispatcher.runSync('updateProduct', serviceCtx)
@@ -76,9 +87,9 @@ class ProductTests implements JupiterTestHelper {
// Minilang test also calls createProductRole again (effectively
updating/ensuring it exists)
Map roleCtx = [
- productId: 'DEMO-PRODUCT-1',
- partyId: 'DemoCustomer-1',
- roleTypeId: 'PRODUCT_OWNER',
+ productId: productId,
+ partyId: partyId,
+ roleTypeId: roleTypeId,
userLogin: adminUserLogin
]
dispatcher.runSync('addPartyToProduct', roleCtx)
@@ -92,13 +103,17 @@ class ProductTests implements JupiterTestHelper {
GenericValue adminUserLogin = from('UserLogin').where('userLoginId',
'admin').queryOne()
assert adminUserLogin
- Timestamp fromDate = Timestamp.valueOf('2010-10-01 00:00:00.000')
- Timestamp thruDate = Timestamp.valueOf('2010-11-01 00:00:00.000')
+ Timestamp fromDate = Timestamp.valueOf(testParams.fromDate ?:
'2010-10-01 00:00:00.000')
+ Timestamp thruDate = Timestamp.valueOf(testParams.thruDate ?:
'2010-11-01 00:00:00.000')
+ String productId = testParams.productId ?: 'DEMO-PRODUCT-1'
+ String partyIdFrom = testParams.partyIdFrom ?: 'Company'
+ String partyId = testParams.partyId ?: 'DemoScrumCompany'
+ String invoiceTypeId = testParams.invoiceTypeId ?: 'SALES_INVOICE'
Map serviceCtx = [
- productId: 'DEMO-PRODUCT-1',
- partyIdFrom: 'Company',
- partyId: 'DemoScrumCompany',
+ productId: productId,
+ partyIdFrom: partyIdFrom,
+ partyId: partyId,
fromDate: fromDate,
thruDate: thruDate,
reCreate: 'N',
@@ -111,9 +126,9 @@ class ProductTests implements JupiterTestHelper {
GenericValue invoice = from('Invoice').where('invoiceId',
invoiceId).queryOne()
assert invoice
- assert invoice.invoiceTypeId == 'SALES_INVOICE'
- assert invoice.partyIdFrom == 'Company'
- assert invoice.partyId == 'DemoScrumCompany'
+ assert invoice.invoiceTypeId == invoiceTypeId
+ assert invoice.partyIdFrom == partyIdFrom
+ assert invoice.partyId == partyId
}
}
diff --git
a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/ScrumProjectTests.groovy
b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/ScrumProjectTests.groovy
index bcaf822b6..f37a1321b 100644
--- a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/ScrumProjectTests.groovy
+++ b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/ScrumProjectTests.groovy
@@ -32,72 +32,73 @@ class ScrumProjectTests implements JupiterTestHelper {
@Test
@Order(1)
void testCreateScrumProjectByProductOwner() {
+ String workEffortId = testParams.workEffortId ?: 'TEST_WE_006'
+ String workEffortName = testParams.workEffortName ?: 'TEST_WEN06'
+ String workEffortTypeId = testParams.workEffortTypeId ?:
'SCRUM_PROJECT'
+ String currentStatusId = testParams.currentStatusId ?: 'SPJ_ACTIVE'
Map serviceCtx = [
- workEffortId: 'TEST_WE_006',
- workEffortName: 'TEST_WEN06',
- workEffortTypeId: 'SCRUM_PROJECT',
- currentStatusId: 'SPJ_ACTIVE',
+ workEffortId: workEffortId,
+ workEffortName: workEffortName,
+ workEffortTypeId: workEffortTypeId,
+ currentStatusId: currentStatusId,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync('createWorkEffort', serviceCtx)
assert ServiceUtil.isSuccess(serviceResult)
}
- // Migrated from ScrumProjectTests.xml:testUpdateScrumProjectByProductOwner
- @Test
- @Order(2)
- void testUpdateScrumProjectByProductOwner() {
+ // Shared by testUpdateScrumProjectByProductOwner/ByScrumMaster below -
identical apart from
+ // the fixture IDs/names each test creates and updates.
+ private void updateScrumProject(String defaultWorkEffortId, String
defaultWorkEffortName,
+ String defaultUpdatedWorkEffortName) {
+ String workEffortId = testParams.workEffortId ?: defaultWorkEffortId
+ String workEffortName = testParams.workEffortName ?:
defaultWorkEffortName
+ String workEffortTypeId = testParams.workEffortTypeId ?:
'SCRUM_PROJECT'
+ String currentStatusId = testParams.currentStatusId ?: 'SPJ_ACTIVE'
+ String updatedWorkEffortName = testParams.updatedWorkEffortName ?:
defaultUpdatedWorkEffortName
Map createCtx = [
- workEffortId: 'TEST_WE_007',
- workEffortName: 'TEST_WEN07',
- workEffortTypeId: 'SCRUM_PROJECT',
- currentStatusId: 'SPJ_ACTIVE',
+ workEffortId: workEffortId,
+ workEffortName: workEffortName,
+ workEffortTypeId: workEffortTypeId,
+ currentStatusId: currentStatusId,
userLogin: userLogin
]
dispatcher.runSync('createWorkEffort', createCtx)
Map serviceCtx = [
- workEffortId: 'TEST_WE_007',
- workEffortName: 'TEST_WEN07_UPDATE',
- workEffortTypeId: 'SCRUM_PROJECT',
- currentStatusId: 'SPJ_ACTIVE',
+ workEffortId: workEffortId,
+ workEffortName: updatedWorkEffortName,
+ workEffortTypeId: workEffortTypeId,
+ currentStatusId: currentStatusId,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync('updateWorkEffort', serviceCtx)
assert ServiceUtil.isSuccess(serviceResult)
}
+ // Migrated from ScrumProjectTests.xml:testUpdateScrumProjectByProductOwner
+ @Test
+ @Order(2)
+ void testUpdateScrumProjectByProductOwner() {
+ updateScrumProject('TEST_WE_007', 'TEST_WEN07', 'TEST_WEN07_UPDATE')
+ }
+
// Migrated from ScrumProjectTests.xml:testUpdateScrumProjectByScrumMaster
@Test
@Order(3)
void testUpdateScrumProjectByScrumMaster() {
- Map createCtx = [
- workEffortId: 'TEST_WE_008',
- workEffortName: 'TEST_WEN08',
- workEffortTypeId: 'SCRUM_PROJECT',
- currentStatusId: 'SPJ_ACTIVE',
- userLogin: userLogin
- ]
- dispatcher.runSync('createWorkEffort', createCtx)
-
- Map serviceCtx = [
- workEffortId: 'TEST_WE_008',
- workEffortName: 'TEST_WEN08_UPDATE',
- workEffortTypeId: 'SCRUM_PROJECT',
- currentStatusId: 'SPJ_ACTIVE',
- userLogin: userLogin
- ]
- Map serviceResult = dispatcher.runSync('updateWorkEffort', serviceCtx)
- assert ServiceUtil.isSuccess(serviceResult)
+ updateScrumProject('TEST_WE_008', 'TEST_WEN08', 'TEST_WEN08_UPDATE')
}
// Migrated from ScrumProjectTests.xml:testCloseScrumProject
@Test
@Order(4)
void testCloseScrumProject() {
+ String workEffortId = testParams.workEffortId ?: 'DEMO-PROJECT-1'
+ String currentStatusId = testParams.currentStatusId ?: 'SPJ_CLOSED'
Map serviceCtx = [
- workEffortId: 'DEMO-PROJECT-1',
- currentStatusId: 'SPJ_CLOSED',
+ workEffortId: workEffortId,
+ currentStatusId: currentStatusId,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync('updateWorkEffort', serviceCtx)
diff --git
a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/ScrumTests.groovy
b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/ScrumTests.groovy
index e16d802b2..5c760ca75 100644
--- a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/ScrumTests.groovy
+++ b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/ScrumTests.groovy
@@ -30,8 +30,9 @@ class ScrumTests implements JupiterTestHelper {
// Migrated from ScrumTests.xml:testFindProjectWithSearchParameters
@Test
void testFindProjectWithSearchParameters() {
+ String workEffortTypeId = testParams.workEffortTypeId ?:
'SCRUM_PROJECT'
List<GenericValue> workEffortList =
EntityQuery.use(delegator).from('WorkEffort')
- .where('workEffortTypeId', 'SCRUM_PROJECT')
+ .where('workEffortTypeId', workEffortTypeId)
.queryList()
assert workEffortList != null
}
diff --git
a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/SprintBacklogTests.groovy
b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/SprintBacklogTests.groovy
index 3f363f5dd..f5f3afa50 100644
---
a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/SprintBacklogTests.groovy
+++
b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/SprintBacklogTests.groovy
@@ -32,9 +32,11 @@ class SprintBacklogTests implements JupiterTestHelper {
@Test
@Order(1)
void testCreateSprintBacklogByAdmin() {
+ String custRequestId = testParams.custRequestId ?: 'TEST5'
+ String workEffortId = testParams.workEffortId ?: 'DEMO-SPRINT-1'
Map serviceCtx = [
- custRequestId: 'TEST5',
- workEffortId: 'DEMO-SPRINT-1',
+ custRequestId: custRequestId,
+ workEffortId: workEffortId,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync(
@@ -46,9 +48,11 @@ class SprintBacklogTests implements JupiterTestHelper {
@Test
@Order(2)
void testCreateSprintBacklogByScrummaster() {
+ String custRequestId = testParams.custRequestId ?: 'TEST6'
+ String workEffortId = testParams.workEffortId ?: 'DEMO-SPRINT-1'
Map serviceCtx = [
- custRequestId: 'TEST6',
- workEffortId: 'DEMO-SPRINT-1',
+ custRequestId: custRequestId,
+ workEffortId: workEffortId,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync(
@@ -60,9 +64,11 @@ class SprintBacklogTests implements JupiterTestHelper {
@Test
@Order(3)
void testDeleteSprintBacklogByAdmin() {
+ String custRequestId = testParams.custRequestId ?: 'TEST1'
+ String workEffortId = testParams.workEffortId ?: 'DEMO-SPRINT-1'
Map serviceCtx = [
- custRequestId: 'TEST1',
- workEffortId: 'DEMO-SPRINT-1',
+ custRequestId: custRequestId,
+ workEffortId: workEffortId,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync(
@@ -74,9 +80,11 @@ class SprintBacklogTests implements JupiterTestHelper {
@Test
@Order(4)
void testDeleteSprintBacklogByScrummaster() {
+ String custRequestId = testParams.custRequestId ?: 'TEST2'
+ String workEffortId = testParams.workEffortId ?: 'DEMO-SPRINT-1'
Map serviceCtx = [
- custRequestId: 'TEST2',
- workEffortId: 'DEMO-SPRINT-1',
+ custRequestId: custRequestId,
+ workEffortId: workEffortId,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync(
diff --git
a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/SprintTests.groovy
b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/SprintTests.groovy
index c4775df0e..95fbc5631 100644
--- a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/SprintTests.groovy
+++ b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/SprintTests.groovy
@@ -31,9 +31,11 @@ class SprintTests implements JupiterTestHelper {
@Test
@Order(1)
void testUpdateSprintBacklog() {
+ String custRequestId = testParams.custRequestId ?: 'TEST9'
+ Long estimatedMilliSeconds = (testParams.estimatedMilliSeconds ?:
36000000L) as Long
Map serviceCtx = [
- custRequestId: 'TEST9',
- estimatedMilliSeconds: 36000000L,
+ custRequestId: custRequestId,
+ estimatedMilliSeconds: estimatedMilliSeconds,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync('updateCustRequest', serviceCtx)
@@ -53,10 +55,12 @@ class SprintTests implements JupiterTestHelper {
@Order(3)
void testUpdateSprintByScrummaster() {
String sprintId = createSprint()
+ String workEffortName = testParams.workEffortName ?: 'SprintTest'
+ String currentStatusId = testParams.currentStatusId ?: 'SPRINT_ACTIVE'
Map serviceCtx = [
workEffortId: sprintId,
- workEffortName: 'SprintTest',
- currentStatusId: 'SPRINT_ACTIVE',
+ workEffortName: workEffortName,
+ currentStatusId: currentStatusId,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync('updateWorkEffort', serviceCtx)
@@ -76,10 +80,12 @@ class SprintTests implements JupiterTestHelper {
@Order(5)
void testUpdateSprintByAdmin() {
String sprintId = createSprint()
+ String workEffortName = testParams.workEffortName ?: 'SprintTest'
+ String currentStatusId = testParams.currentStatusId ?: 'SPRINT_ACTIVE'
Map serviceCtx = [
workEffortId: sprintId,
- workEffortName: 'SprintTest',
- currentStatusId: 'SPRINT_ACTIVE',
+ workEffortName: workEffortName,
+ currentStatusId: currentStatusId,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync('updateWorkEffort', serviceCtx)
@@ -97,22 +103,27 @@ class SprintTests implements JupiterTestHelper {
@Test
@Order(6)
void testAddAndRemoveSprintMember() {
+ String workEffortId = testParams.workEffortId ?: 'DEMO-SPRINT-1'
+ String roleTypeId = testParams.roleTypeId ?: 'SCRUM_TEAM'
+ String statusId = testParams.statusId ?: 'PRTYASGN_ASSIGNED'
+ String partyId = testParams.partyId ?: 'DemoCustomer-1'
+ java.sql.Timestamp fromDate =
java.sql.Timestamp.valueOf(testParams.fromDate ?: '2010-07-31 00:00:00.000')
Map assignCtx = [
- workEffortId: 'DEMO-SPRINT-1',
- roleTypeId: 'SCRUM_TEAM',
- statusId: 'PRTYASGN_ASSIGNED',
- partyId: 'DemoCustomer-1',
- fromDate: java.sql.Timestamp.valueOf('2010-07-31
00:00:00.000'),
+ workEffortId: workEffortId,
+ roleTypeId: roleTypeId,
+ statusId: statusId,
+ partyId: partyId,
+ fromDate: fromDate,
userLogin: userLogin
]
Map assignResult = dispatcher.runSync('assignPartyToWorkEffort',
assignCtx)
assert ServiceUtil.isSuccess(assignResult)
Map removeCtx = [
- workEffortId: 'DEMO-SPRINT-1',
- roleTypeId: 'SCRUM_TEAM',
- partyId: 'DemoCustomer-1',
- fromDate: java.sql.Timestamp.valueOf('2010-07-31
00:00:00.000'),
+ workEffortId: workEffortId,
+ roleTypeId: roleTypeId,
+ partyId: partyId,
+ fromDate: fromDate,
userLogin: userLogin
]
Map removeResult = dispatcher.runSync(
@@ -126,13 +137,19 @@ class SprintTests implements JupiterTestHelper {
* which internally creates a WorkEffort of type SCRUM_SPRINT.
*/
protected String createSprint() {
+ String workEffortName = testParams.workEffortName ?: 'SprintTest'
+ String description = testParams.description ?: 'Test Create Sprint'
+ String workEffortTypeId = testParams.workEffortTypeId ?: 'SCRUM_SPRINT'
+ String currentStatusId = testParams.currentStatusId ?: 'SPRINT_ACTIVE'
+ String workEffortParentId = testParams.workEffortParentId ?:
'DEMO-PROJECT-1'
+ Long estimatedMilliSeconds = (testParams.estimatedMilliSeconds ?:
1440000000L) as Long
Map serviceCtx = [
- workEffortName: 'SprintTest',
- description: 'Test Create Sprint',
- workEffortTypeId: 'SCRUM_SPRINT',
- currentStatusId: 'SPRINT_ACTIVE',
- workEffortParentId: 'DEMO-PROJECT-1',
- estimatedMilliSeconds: 1440000000L,
+ workEffortName: workEffortName,
+ description: description,
+ workEffortTypeId: workEffortTypeId,
+ currentStatusId: currentStatusId,
+ workEffortParentId: workEffortParentId,
+ estimatedMilliSeconds: estimatedMilliSeconds,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync('createWorkEffort', serviceCtx)
diff --git a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/TaskTests.groovy
b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/TaskTests.groovy
index 3fadbeff0..43370ec7c 100644
--- a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/TaskTests.groovy
+++ b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/TaskTests.groovy
@@ -30,9 +30,11 @@ class TaskTests implements JupiterTestHelper {
// Tests that viewScrumRevision service handles a bad repository URL
gracefully
@Test
void testViewScrumRevisionBadCall() {
+ String repository = testParams.repository ?:
'--diff+--diff-cmd=/bin/ls'
+ String revision = testParams.revision ?: '7'
Map serviceCtx = [
- repository: '--diff+--diff-cmd=/bin/ls',
- revision: '7',
+ repository: repository,
+ revision: revision,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync('viewScrumRevision', serviceCtx)
diff --git
a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/TimesheetTests.groovy
b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/TimesheetTests.groovy
index 24e18599e..65eba2815 100644
--- a/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/TimesheetTests.groovy
+++ b/scrum/src/test/groovy/org/apache/ofbiz/scrum/test/TimesheetTests.groovy
@@ -29,9 +29,11 @@ class TimesheetTests implements JupiterTestHelper {
// Migrated from TimesheetTests.xml:testTimesheetToComplete
@Test
void testTimesheetToComplete() {
+ String timesheetId = testParams.timesheetId ?: 'DEMO-TIMESHEET1'
+ String statusId = testParams.statusId ?: 'TIMESHEET_COMPLETED'
Map serviceCtx = [
- timesheetId: 'DEMO-TIMESHEET1',
- statusId: 'TIMESHEET_COMPLETED',
+ timesheetId: timesheetId,
+ statusId: statusId,
userLogin: userLogin
]
Map serviceResult = dispatcher.runSync('updateTimesheet', serviceCtx)