| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| 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. |
| --> |
| |
| <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd"> |
| <simple-method method-name="testCreateFinAccount" short-description="Test case for service createFinAccount" login-required="false"> |
| <set field="serviceCtx.finAccountId" value="1000"/> |
| <set field="serviceCtx.finAccountTypeId" value="BANK_ACCOUNT"/> |
| <set field="serviceCtx.finAccountName" value="Bank Account" /> |
| <set field="serviceCtx.finAccountCode" value="1000"/> |
| <set field="serviceCtx.currencyUomId" value="USD"/> |
| <set field="serviceCtx.organizationPartyId" value="DEMO_COMPANY"/> |
| <entity-one entity-name="UserLogin" value-field="userLogin"> |
| <field-map field-name="userLoginId" value="system"/> |
| </entity-one> |
| <set field="serviceCtx.userLogin" from-field="userLogin"/> |
| <call-service service-name="createFinAccount" in-map-name="serviceCtx"/> |
| <entity-one entity-name="FinAccount" value-field="finAccount"> |
| <field-map field-name="finAccountId" value="1000"/> |
| </entity-one> |
| <assert> |
| <not><if-empty field="finAccount"/></not> |
| <if-compare operator="equals" value="BANK_ACCOUNT" field="finAccount.finAccountTypeId"></if-compare> |
| <if-compare operator="equals" value="1000" field="finAccount.finAccountCode"></if-compare> |
| </assert> |
| <check-errors/> |
| </simple-method> |
| <simple-method method-name="testUpdateFinAccount" short-description="Test case for service updateFinAccount" login-required="false"> |
| <set field="serviceCtx.finAccountId" value="1001"/> |
| <set field="serviceCtx.organizationPartyId" value="DEMO_COMPANY2"/> |
| <entity-one entity-name="UserLogin" value-field="userLogin"> |
| <field-map field-name="userLoginId" value="system"/> |
| </entity-one> |
| <set field="serviceCtx.userLogin" from-field="userLogin"/> |
| <call-service service-name="updateFinAccount" in-map-name="serviceCtx"/> |
| <entity-one entity-name="FinAccount" value-field="finAccount"> |
| <field-map field-name="finAccountId" value="1001"/> |
| </entity-one> |
| <assert> |
| <not><if-empty field="finAccount"/></not> |
| <if-compare operator="equals" value="DEMO_COMPANY2" field="finAccount.organizationPartyId"></if-compare> |
| </assert> |
| <check-errors/> |
| </simple-method> |
| <simple-method method-name="testDeleteFinAccount" short-description="Test case for service deleteFinAccount" login-required="false"> |
| <set field="serviceCtx.finAccountId" value="1002"/> |
| <entity-one entity-name="UserLogin" value-field="userLogin"> |
| <field-map field-name="userLoginId" value="system"/> |
| </entity-one> |
| <set field="serviceCtx.userLogin" from-field="userLogin"/> |
| <call-service service-name="deleteFinAccount" in-map-name="serviceCtx"/> |
| <entity-one entity-name="FinAccount" value-field="finAccount"> |
| <field-map field-name="finAccountId" value="1002"/> |
| </entity-one> |
| <assert> |
| <if-empty field="finAccount"/> |
| </assert> |
| <check-errors/> |
| </simple-method> |
| <simple-method method-name="testCreateFinAccountRole" short-description="Test case for service createFinAccountRole" login-required="false"> |
| <now-timestamp field="nowTimestamp"/> |
| <set field="serviceCtx.finAccountId" value="1003"/> |
| <set field="serviceCtx.partyId" value="DEMO_COMPANY"/> |
| <set field="serviceCtx.roleTypeId" value="INTERNAL_ORGANIZATIO"/> |
| <set field="serviceCtx.fromDate" from-field="nowTimestamp"/> |
| <entity-one entity-name="UserLogin" value-field="userLogin"> |
| <field-map field-name="userLoginId" value="system"/> |
| </entity-one> |
| <set field="serviceCtx.userLogin" from-field="userLogin"/> |
| <call-service service-name="createFinAccountRole" in-map-name="serviceCtx"/> |
| <entity-and list="finAccountRoles" entity-name="FinAccountRole"> |
| <field-map field-name="finAccountId" value="1003"/> |
| <field-map field-name="partyId" value="DEMO_COMPANY"/> |
| <field-map field-name="roleTypeId" value="INTERNAL_ORGANIZATIO"/> |
| </entity-and> |
| <first-from-list entry="finAccountRole" list="finAccountRoles"/> |
| <assert> |
| <not><if-empty field="finAccountRole"/></not> |
| </assert> |
| <check-errors/> |
| </simple-method> |
| <simple-method method-name="testUpdateFinAccountRole" short-description="Test case for service updateFinAccountRole" login-required="false"> |
| <now-timestamp field="nowTimestamp"/> |
| <set field="serviceCtx.finAccountId" value="1004"/> |
| <set field="serviceCtx.partyId" value="DEMO_COMPANY"/> |
| <set field="serviceCtx.roleTypeId" value="SUPPLIER"/> |
| <set field="serviceCtx.fromDate" value="2016-11-03 00:00:00" type="Timestamp"/> |
| <set field="serviceCtx.thruDate" from-field="nowTimestamp"/> |
| <entity-one entity-name="UserLogin" value-field="userLogin"> |
| <field-map field-name="userLoginId" value="system"/> |
| </entity-one> |
| <set field="serviceCtx.userLogin" from-field="userLogin"/> |
| <call-service service-name="updateFinAccountRole" in-map-name="serviceCtx"/> |
| <entity-and list="finAccountRoles" entity-name="FinAccountRole"> |
| <field-map field-name="finAccountId" value="1004"/> |
| <field-map field-name="partyId" value="DEMO_COMPANY"/> |
| <field-map field-name="roleTypeId" value="SUPPLIER"/> |
| </entity-and> |
| <first-from-list entry="finAccountRole" list="finAccountRoles"/> |
| <assert> |
| <not><if-empty field="finAccountRole"/></not> |
| <not><if-empty field="finAccountRole.thruDate"/></not> |
| </assert> |
| <check-errors/> |
| </simple-method> |
| <simple-method method-name="testDeleteFinAccountRole" short-description="Test case for service deleteFinAccountRole" login-required="false"> |
| <set field="serviceCtx.finAccountId" value="1004"/> |
| <set field="serviceCtx.partyId" value="DEMO_COMPANY"/> |
| <set field="serviceCtx.roleTypeId" value="SUPPLIER"/> |
| <set field="serviceCtx.fromDate" value="2016-11-03 00:00:00" type="Timestamp"/> |
| <entity-one entity-name="UserLogin" value-field="userLogin"> |
| <field-map field-name="userLoginId" value="system"/> |
| </entity-one> |
| <set field="serviceCtx.userLogin" from-field="userLogin"/> |
| <call-service service-name="deleteFinAccountRole" in-map-name="serviceCtx"/> |
| <entity-and list="finAccountRoles" entity-name="FinAccountRole"> |
| <field-map field-name="finAccountId" value="1004"/> |
| <field-map field-name="partyId" value="DEMO_COMPANY"/> |
| <field-map field-name="roleTypeId" value="SUPPLIER"/> |
| </entity-and> |
| <first-from-list entry="finAccountRole" list="finAccountRoles"/> |
| <assert> |
| <if-empty field="finAccountRole"/> |
| </assert> |
| <check-errors/> |
| </simple-method> |
| <simple-method method-name="testCreateFinAccountTrans" short-description="Test case for service createFinAccountTrans" login-required="false"> |
| <set field="serviceCtx.finAccountId" value="1003"/> |
| <set field="serviceCtx.finAccountTransTypeId" value="ADJUSTMENT"/> |
| <entity-one entity-name="UserLogin" value-field="userLogin"> |
| <field-map field-name="userLoginId" value="system"/> |
| </entity-one> |
| <set field="serviceCtx.userLogin" from-field="userLogin"/> |
| <call-service service-name="createFinAccountTrans" in-map-name="serviceCtx"/> |
| <entity-and list="finAccountTransList" entity-name="FinAccountTrans"> |
| <field-map field-name="finAccountId" value="1003"/> |
| </entity-and> |
| <first-from-list entry="finAccountTrans" list="finAccountTransList"/> |
| <assert> |
| <not><if-empty field="finAccountTrans"/></not> |
| <if-compare operator="equals" value="ADJUSTMENT" field="finAccountTrans.finAccountTransTypeId"></if-compare> |
| </assert> |
| <check-errors/> |
| </simple-method> |
| <simple-method method-name="testCreateFinAccountStatus" short-description="Test case for service createFinAccountStatus" login-required="false"> |
| <now-timestamp field="nowTimestamp"/> |
| <set field="serviceCtx.finAccountId" value="1003"/> |
| <set field="serviceCtx.statusId" value="FNACT_ACTIVE"/> |
| <set field="serviceCtx.statusDate" from-field="nowTimestamp"/> |
| <entity-one entity-name="UserLogin" value-field="userLogin"> |
| <field-map field-name="userLoginId" value="system"/> |
| </entity-one> |
| <set field="serviceCtx.userLogin" from-field="userLogin"/> |
| <call-service service-name="createFinAccountStatus" in-map-name="serviceCtx"/> |
| <entity-and list="finAccountStatuses" entity-name="FinAccountStatus"> |
| <field-map field-name="finAccountId" value="1003"/> |
| </entity-and> |
| <first-from-list entry="finAccountStatus" list="finAccountStatuses"/> |
| <assert> |
| <not><if-empty field="finAccountStatus"/></not> |
| <if-compare operator="equals" value="FNACT_ACTIVE" field="finAccountStatus.statusId"></if-compare> |
| </assert> |
| <check-errors/> |
| </simple-method> |
| <simple-method method-name="testCreateFinAccountAuth" short-description="Test case for service createFinAccountAuth" login-required="false"> |
| <now-timestamp field="nowTimestamp"/> |
| <set field="serviceCtx.finAccountId" value="1004"/> |
| <set field="serviceCtx.amount" value="100.00" type="BigDecimal"/> |
| <set field="serviceCtx.currencyUomId" value="USD" /> |
| <set field="serviceCtx.authorizationDate" from-field="nowTimestamp"/> |
| <set field="serviceCtx.fromDate" from-field="nowTimestamp"/> |
| <entity-one entity-name="UserLogin" value-field="userLogin"> |
| <field-map field-name="userLoginId" value="system"/> |
| </entity-one> |
| <set field="serviceCtx.userLogin" from-field="userLogin"/> |
| <call-service service-name="createFinAccountAuth" in-map-name="serviceCtx"> |
| <results-to-map map-name="finAccountAuthResult"/> |
| </call-service> |
| <assert> |
| <not><if-empty field="finAccountAuthResult"/></not> |
| <not><if-empty field="finAccountAuthResult.finAccountAuthId"/></not> |
| </assert> |
| <check-errors/> |
| </simple-method> |
| <simple-method method-name="setFinAccountTransStatus" short-description="Test case for service setFinAccountTransStatus" login-required="false"> |
| <now-timestamp field="nowTimestamp"/> |
| <set field="serviceCtx.finAccountTransId" value="1010"/> |
| <set field="serviceCtx.statusId" value="FINACT_TRNS_APPROVED"/> |
| <entity-one entity-name="UserLogin" value-field="userLogin"> |
| <field-map field-name="userLoginId" value="system"/> |
| </entity-one> |
| <set field="serviceCtx.userLogin" from-field="userLogin"/> |
| <call-service service-name="setFinAccountTransStatus" in-map-name="serviceCtx"> |
| <results-to-map map-name="serviceResult"/> |
| </call-service> |
| <entity-one entity-name="FinAccountTrans" value-field="finAccountTrans"> |
| <field-map field-name="finAccountTransId" value="1010"/> |
| </entity-one> |
| <assert> |
| <not><if-empty field="finAccountTrans"/></not> |
| <if-compare operator="equals" value="FINACT_TRNS_APPROVED" field="finAccountTrans.statusId"></if-compare> |
| <if-compare operator="equals" value="FINACT_TRNS_CREATED" field="serviceResult.oldStatusId"></if-compare> |
| </assert> |
| <check-errors/> |
| </simple-method> |
| </simple-methods> |