<?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 Re: ABAP Docs for Testing relations addressing private methods in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-docs-for-testing-relations-addressing-private-methods/m-p/12634670#M2013671</link>
    <description>&lt;P&gt;it also kind of works for private methods in the main class. When I click on the link the right method will be displayed in the ABAP Element info but the warning in eclipse is there.&lt;/P&gt;&lt;P&gt;So I wondered if expect the warning that only public methods can be accessed there is a good way to reference to those methods.&lt;/P&gt;&lt;P&gt;Otherwise I do not understand the usage of  @testing &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jun 2022 11:49:55 GMT</pubDate>
    <dc:creator>schmelto</dc:creator>
    <dc:date>2022-06-02T11:49:55Z</dc:date>
    <item>
      <title>ABAP Docs for Testing relations addressing private methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-docs-for-testing-relations-addressing-private-methods/m-p/12634667#M2013668</link>
      <description>&lt;P&gt;What is the best practice for linking to test relations for private methods.&lt;/P&gt;
  &lt;P&gt;For example I have a ABAP Class with some private methods.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;PRIVATE SECTION.
METHODS set_remittance_vend_reference
[...]&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;And in my test class I want to link the Unit Test method to the method in the main class.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;"! &amp;lt;p class="shorttext synchronized"&amp;gt;Test for set_remittance_vend_reference&amp;lt;/p&amp;gt;
"! @testing zcl_fi_edi_payext_2441.METH:set_remittance_vend_reference
set_remittance_vend_reference FOR TESTING.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;For reference the test class can access private methods of the main class with `LOCAL FRIENDS ` &lt;/P&gt;
  &lt;P&gt;The above seen ABAP Doc will throw following warning message:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2055475-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Is there a way to exclude this warning due the Method is "correctly" linked to the method in the main program.&lt;/P&gt;
  &lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 08:14:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-docs-for-testing-relations-addressing-private-methods/m-p/12634667#M2013668</guid>
      <dc:creator>schmelto</dc:creator>
      <dc:date>2022-06-02T08:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Docs for Testing relations addressing private methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-docs-for-testing-relations-addressing-private-methods/m-p/12634668#M2013669</link>
      <description>&lt;P&gt;Searchable sentence:&lt;/P&gt;&lt;P&gt;ABAP Doc syntax "@testing" can reference main objects outside their own program only.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 11:31:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-docs-for-testing-relations-addressing-private-methods/m-p/12634668#M2013669</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-06-02T11:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Docs for Testing relations addressing private methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-docs-for-testing-relations-addressing-private-methods/m-p/12634669#M2013670</link>
      <description>&lt;P&gt;I guess you mean it works for tested methods which are public, but not for those which are private.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 11:32:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-docs-for-testing-relations-addressing-private-methods/m-p/12634669#M2013670</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-06-02T11:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Docs for Testing relations addressing private methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-docs-for-testing-relations-addressing-private-methods/m-p/12634670#M2013671</link>
      <description>&lt;P&gt;it also kind of works for private methods in the main class. When I click on the link the right method will be displayed in the ABAP Element info but the warning in eclipse is there.&lt;/P&gt;&lt;P&gt;So I wondered if expect the warning that only public methods can be accessed there is a good way to reference to those methods.&lt;/P&gt;&lt;P&gt;Otherwise I do not understand the usage of  @testing &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 11:49:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-docs-for-testing-relations-addressing-private-methods/m-p/12634670#M2013671</guid>
      <dc:creator>schmelto</dc:creator>
      <dc:date>2022-06-02T11:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Docs for Testing relations addressing private methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-docs-for-testing-relations-addressing-private-methods/m-p/12634671#M2013672</link>
      <description>&lt;P&gt;Maybe nobody has manage the case of private method, because you must not test private method. &lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 11:58:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-docs-for-testing-relations-addressing-private-methods/m-p/12634671#M2013672</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2022-06-02T11:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Docs for Testing relations addressing private methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-docs-for-testing-relations-addressing-private-methods/m-p/12634672#M2013673</link>
      <description>&lt;P&gt;Two comments: &lt;/P&gt;&lt;P&gt;The message is correct, `@testing` is intended for external reference. Given that you use LOCAL FRIENDS, I assume your test class is local to the main class. `@testing` doesn't make sense here, because a local test is automatically associated with its global class. The directive is intended for remote references, i.e. if one global class tests another global class. &lt;/P&gt;&lt;P&gt;See this blog for more info: &lt;A href="https://blogs.sap.com/2020/12/07/abap-unit-test-relations/" target="test_blank"&gt;https://blogs.sap.com/2020/12/07/abap-unit-test-relations/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Secondly, as Frederic already suggested, it is best to test a class only via its public interface. Testing private methods makes your tests brittle and the main class difficult to refactor.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jun 2022 15:22:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-docs-for-testing-relations-addressing-private-methods/m-p/12634672#M2013673</guid>
      <dc:creator>pokrakam</dc:creator>
      <dc:date>2022-06-04T15:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Docs for Testing relations addressing private methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-docs-for-testing-relations-addressing-private-methods/m-p/12634673#M2013674</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;just to summarize: What you want to do is not possible. The @testing annotation has been designed to refer from a test class or test method to other repository objects (class, cds view, etc.) that are being tested.&lt;/P&gt;&lt;P&gt;For classes that contain their tests in the test class include,  @testing is not needed.&lt;/P&gt;&lt;P&gt;Furthermore @testing cannot refer to a method, neither public nor private.&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Michael&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 07:46:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-docs-for-testing-relations-addressing-private-methods/m-p/12634673#M2013674</guid>
      <dc:creator>michael_gutfleisch</dc:creator>
      <dc:date>2022-06-07T07:46:01Z</dc:date>
    </item>
  </channel>
</rss>

