<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Unit testing BOPF operations in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/unit-testing-bopf-operations/m-p/11532009#M1935322</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear BOPF Colleagues,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would ask do you have any correct, working implementation, or PoC how to write correct unit test for BOPF CRUD operations without calling the determination event?&lt;/P&gt;&lt;P&gt;These CRUD operations are NOT actions under Business objects, we fill up the modification table with the corresponding BO operation code and then&lt;/P&gt;&lt;P&gt;call service manager modify and transaction manager save.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have an normal ABAP class called Planning Profile API, which creates, updates, copies and deletes Planning Profile Object data via BOPF framework.&lt;/P&gt;&lt;P&gt;I tried to write ABAP unit test but either the determination is called on delete and the transaction manager doesnot save the deletion&lt;/P&gt;&lt;P&gt;or if I tried to mock service and transactionm manager it went into infinite loop in retieve of service manager.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any working iimplementation how to unit test a create-update-delete operation? Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you &amp;amp; regards,&lt;/P&gt;&lt;P&gt; Csaba&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Feb 2016 16:39:45 GMT</pubDate>
    <dc:creator>former_member669136</dc:creator>
    <dc:date>2016-02-17T16:39:45Z</dc:date>
    <item>
      <title>Unit testing BOPF operations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unit-testing-bopf-operations/m-p/11532009#M1935322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear BOPF Colleagues,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would ask do you have any correct, working implementation, or PoC how to write correct unit test for BOPF CRUD operations without calling the determination event?&lt;/P&gt;&lt;P&gt;These CRUD operations are NOT actions under Business objects, we fill up the modification table with the corresponding BO operation code and then&lt;/P&gt;&lt;P&gt;call service manager modify and transaction manager save.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have an normal ABAP class called Planning Profile API, which creates, updates, copies and deletes Planning Profile Object data via BOPF framework.&lt;/P&gt;&lt;P&gt;I tried to write ABAP unit test but either the determination is called on delete and the transaction manager doesnot save the deletion&lt;/P&gt;&lt;P&gt;or if I tried to mock service and transactionm manager it went into infinite loop in retieve of service manager.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any working iimplementation how to unit test a create-update-delete operation? Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you &amp;amp; regards,&lt;/P&gt;&lt;P&gt; Csaba&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 16:39:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unit-testing-bopf-operations/m-p/11532009#M1935322</guid>
      <dc:creator>former_member669136</dc:creator>
      <dc:date>2016-02-17T16:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: Unit testing BOPF operations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unit-testing-bopf-operations/m-p/11532010#M1935323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Csaba,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as BOPF automatically takes care of create, update and delete, what is the intention to have a test exactly for this (without any determination)? Do you have an own DAC/buffer?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usually a BOPF "unit" (=smallest unit to be tested) test is focusing a single implementation class like an action, determination, or validation class. Thereto we have a BOPF unit test framework available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Testing a whole core service is usally part of a scenario test and therefor the service manager can be used and the DAC layer can be mocked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Tilmann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Feb 2016 04:24:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unit-testing-bopf-operations/m-p/11532010#M1935323</guid>
      <dc:creator>former_member190794</dc:creator>
      <dc:date>2016-02-18T04:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Unit testing BOPF operations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unit-testing-bopf-operations/m-p/11532011#M1935324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Tilmann,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This unit test is more like a scenario test as this would test the whole process from create to delete.&lt;/P&gt;&lt;P&gt;I planned to create a scenario test which would have several test steps for CRUD operations. I would use real Data Access Layer (not mocked DAC).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The test steps are:&lt;/P&gt;&lt;P&gt;1. Create an Business object with predefined data&lt;/P&gt;&lt;P&gt;2. Update this Business object (change some sttribute value)&lt;/P&gt;&lt;P&gt;3. Copy Business Object creating new one&lt;/P&gt;&lt;P&gt;4. Delete recently created Business Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All these steps would use the real BOPF service and transaction managers and would write data into the database (into ABAP transparent tables).&lt;/P&gt;&lt;P&gt;We should skip the running of determination class/event somehow, because it blocks the step 4: deletion of created test BOPF data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to run unit test which writes into database?&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt; Csaba&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Feb 2016 09:43:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unit-testing-bopf-operations/m-p/11532011#M1935324</guid>
      <dc:creator>former_member669136</dc:creator>
      <dc:date>2016-02-18T09:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: Unit testing BOPF operations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unit-testing-bopf-operations/m-p/11532012#M1935325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Based our discussion we will use an private attribute flag added to the determination class which will control of using determination (either called from real API or from unit test).&lt;/P&gt;&lt;P&gt;The Unit test class will be friend of this determination class so it can set this parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tilmann, thank you for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Feb 2016 10:12:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unit-testing-bopf-operations/m-p/11532012#M1935325</guid>
      <dc:creator>former_member669136</dc:creator>
      <dc:date>2016-02-23T10:12:34Z</dc:date>
    </item>
  </channel>
</rss>

