<?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: AEM-junit for text component using textmodel in Adobe Experience Manager Questions</title>
    <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-junit-for-text-component-using-textmodel/m-p/441837#M126210</link>
    <description>&lt;P&gt;what is object here(object.getText()) and what is textmodelobject&lt;/P&gt;</description>
    <pubDate>Wed, 23 Feb 2022 04:02:40 GMT</pubDate>
    <dc:creator>Babita11</dc:creator>
    <dc:date>2022-02-23T04:02:40Z</dc:date>
    <item>
      <title>AEM-junit for text component using textmodel</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-junit-for-text-component-using-textmodel/m-p/441738#M126154</link>
      <description>&lt;P&gt;I am building&amp;nbsp; project with Junit for Text&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WHEN &lt;/STRONG&gt;I return plain text (Lorem ipsum dolor sit amet.) for getText.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;THEN &lt;/STRONG&gt;I should see “Lorem ipsum dolor sit amet.” returned for getText().&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 12:02:49 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-junit-for-text-component-using-textmodel/m-p/441738#M126154</guid>
      <dc:creator>Babita11</dc:creator>
      <dc:date>2022-02-22T12:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: AEM-junit for text component using textmodel</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-junit-for-text-component-using-textmodel/m-p/441759#M126171</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;LI-USER uid="17491668"&gt;&lt;/LI-USER&gt;,&lt;BR /&gt;&lt;BR /&gt;I believe you are looking for Mockito's - when thenReturn function. You will have to use set as below:&lt;/P&gt;&lt;PRE&gt;when(textModelObject.getText()).thenReturn("Lorem ipsum dolor sit amet.");&lt;/PRE&gt;&lt;P&gt;with this you will be able to check using assertEquals as below:&lt;/P&gt;&lt;PRE&gt;assertEquals("Lorem ipsum dolor sit amet.",object.getText());&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Hope this helps!&lt;BR /&gt;Jineet&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 14:40:29 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-junit-for-text-component-using-textmodel/m-p/441759#M126171</guid>
      <dc:creator>Jineet_Vora</dc:creator>
      <dc:date>2022-02-22T14:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: AEM-junit for text component using textmodel</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-junit-for-text-component-using-textmodel/m-p/441772#M126179</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;LI-USER uid="17491668"&gt;&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a quick reference :&amp;nbsp;&lt;A href="https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-wknd-tutorial-develop/project-archetype/unit-testing.html?lang=en" target="_self"&gt;unit-testing-aem&lt;/A&gt;&amp;nbsp;for Junit testing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For your usecase, you need to mock the model under the test and command the Junits as and when required like:&lt;BR /&gt;If someone is calling a getter from mockModel you can use :&lt;/P&gt;&lt;PRE&gt;when(mockModel.getSomeProperty).thenReturn("Lorem Ipsum...");&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a tutorial on how you use asserting : &lt;A href="https://www.guru99.com/junit-assert.html" target="_self"&gt;junit-assert-tutorial&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please feel free to reach out if that doesnt help. Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 15:15:05 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-junit-for-text-component-using-textmodel/m-p/441772#M126179</guid>
      <dc:creator>milind_bachani</dc:creator>
      <dc:date>2022-02-22T15:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: AEM-junit for text component using textmodel</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-junit-for-text-component-using-textmodel/m-p/441799#M126189</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check sample test cases with example at&amp;nbsp;&lt;A href="https://github.com/arunpatidar02/com.aemlab.junitapp/tree/master/core/src/test" target="_blank"&gt;https://github.com/arunpatidar02/com.aemlab.junitapp/tree/master/core/src/test&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 17:07:10 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-junit-for-text-component-using-textmodel/m-p/441799#M126189</guid>
      <dc:creator>arunpatidar</dc:creator>
      <dc:date>2022-02-22T17:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: AEM-junit for text component using textmodel</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-junit-for-text-component-using-textmodel/m-p/441837#M126210</link>
      <description>&lt;P&gt;what is object here(object.getText()) and what is textmodelobject&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 04:02:40 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-junit-for-text-component-using-textmodel/m-p/441837#M126210</guid>
      <dc:creator>Babita11</dc:creator>
      <dc:date>2022-02-23T04:02:40Z</dc:date>
    </item>
  </channel>
</rss>

