[ofbiz-framework] branch trunk updated: Improved: Unit test case for service - getContent (OFBIZ-8547)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch trunk updated: Improved: Unit test case for service - getContent (OFBIZ-8547)

akashjain
This is an automated email from the ASF dual-hosted git repository.

akashjain 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 b9fede6  Improved: Unit test case for service - getContent (OFBIZ-8547)
b9fede6 is described below

commit b9fede6c269f16324779891c93c53aba6931eb39
Author: Akash Jain <[hidden email]>
AuthorDate: Wed Aug 26 15:49:20 2020 +0530

    Improved: Unit test case for service - getContent (OFBIZ-8547)
---
 .../src/main/groovy/org/apache/ofbiz/content/ContentTests.groovy | 9 +++++++++
 applications/content/testdef/data/ContentTestsData.xml           | 2 ++
 2 files changed, 11 insertions(+)

diff --git a/applications/content/src/main/groovy/org/apache/ofbiz/content/ContentTests.groovy b/applications/content/src/main/groovy/org/apache/ofbiz/content/ContentTests.groovy
index 3ef4b5d..f0496fa 100644
--- a/applications/content/src/main/groovy/org/apache/ofbiz/content/ContentTests.groovy
+++ b/applications/content/src/main/groovy/org/apache/ofbiz/content/ContentTests.groovy
@@ -176,4 +176,13 @@ class ContentTests extends OFBizTestCase {
                 .queryFirst()
         assert !dataResourceRole
     }
+
+    void testGetContent() {
+        Map serviceCtx = [:]
+        serviceCtx.contentId = 'TEST_CONTENT4'
+        serviceCtx.userLogin = userLogin
+        Map serviceResult = dispatcher.runSync('getContent', serviceCtx)
+        assert ServiceUtil.isSuccess(serviceResult)
+        assert serviceResult.view
+    }
 }
diff --git a/applications/content/testdef/data/ContentTestsData.xml b/applications/content/testdef/data/ContentTestsData.xml
index cf81a75..7cbb38a 100644
--- a/applications/content/testdef/data/ContentTestsData.xml
+++ b/applications/content/testdef/data/ContentTestsData.xml
@@ -23,6 +23,7 @@ under the License.
     <DataResource dataResourceId="TEST_RESOURCE" dataResourceTypeId="TEST_RESOURCE_TYPE"/>
     <DataResource dataResourceId="TEST_RESOURCE2" dataResourceTypeId="TEST_RESOURCE_TYPE"/>
     <DataResource dataResourceId="TEST_RESOURCE3" dataResourceTypeId="TEST_RESOURCE_TYPE"/>
+    <DataResource dataResourceId="TEST_RESOURCE4" dataResourceTypeId="TEST_RESOURCE_TYPE"/>
     <DataResource dataResourceId="TEST_SUBJECT" dataResourceTypeId="TEST_RESOURCE_TYPE"/>
     <DataResource dataResourceId="TEST_PLAIN_BODY" dataResourceTypeId="TEST_RESOURCE_TYPE"/>
     <DataResource dataResourceId="TEST_HTML_BODY" dataResourceTypeId="TEST_RESOURCE_TYPE"/>
@@ -35,6 +36,7 @@ under the License.
     <Content contentId="TEST_CONTENT1" contentTypeId="TEST_CONTENT_TYPE" dataResourceId="TEST_RESOURCE"/>
     <Content contentId="TEST_CONTENT2" contentTypeId="TEST_CONTENT_TYPE" dataResourceId="TEST_RESOURCE"/>
     <Content contentId="TEST_CONTENT3" contentTypeId="TEST_CONTENT_TYPE" dataResourceId="TEST_RESOURCE3"/>
+    <Content contentId="TEST_CONTENT4" contentTypeId="TEST_CONTENT_TYPE" dataResourceId="TEST_RESOURCE4"/>
     <ContentAssocType contentAssocTypeId="TEST_ASSOC_TYPE"/>
     <ContentAssoc contentId="TEST_CONTENT1" contentIdTo="TEST_CONTENT2" contentAssocTypeId="TEST_ASSOC_TYPE" mapKey="Test_key" fromDate="2013-07-04 00:00:00"/>
 </entity-engine-xml>