<?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 Mockito junit testing for multifield in Adobe Experience Manager Questions</title>
    <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-mockito-junit-testing-for-multifield/m-p/538971#M133871</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have an example here but the implementation may be different for multifield&lt;/P&gt;
&lt;P&gt;Main&lt;BR /&gt;&lt;A href="https://github.com/arunpatidar02/com.aemlab.junitapp/blob/master/core/src/main/java/com/aemlab/junit/core/models/ModelHelper.java" target="_blank"&gt;https://github.com/arunpatidar02/com.aemlab.junitapp/blob/master/core/src/main/java/com/aemlab/junit/core/models/ModelHelper.java&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Test&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/arunpatidar02/com.aemlab.junitapp/blob/master/core/src/test/java/com/aemlab/junit/core/models/ModelHelperTest.java" target="_blank"&gt;https://github.com/arunpatidar02/com.aemlab.junitapp/blob/master/core/src/test/java/com/aemlab/junit/core/models/ModelHelperTest.java&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Json -&amp;nbsp;&lt;A href="https://github.com/arunpatidar02/com.aemlab.junitapp/blob/master/core/src/test/resources/com/aemlab/junit/core/models/ModelHelperTest.json" target="_blank"&gt;https://github.com/arunpatidar02/com.aemlab.junitapp/blob/master/core/src/test/resources/com/aemlab/junit/core/models/ModelHelperTest.json&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Aug 2022 08:20:35 GMT</pubDate>
    <dc:creator>arunpatidar</dc:creator>
    <dc:date>2022-08-03T08:20:35Z</dc:date>
    <item>
      <title>AEM Mockito junit testing for multifield</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-mockito-junit-testing-for-multifield/m-p/538850#M133850</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi All,&lt;BR /&gt;i have&amp;nbsp; written a multifield in if else statement now,&lt;BR /&gt;I need to write JUnits for that Method &lt;STRONG&gt;(getMltifeildlist()) help me with the Testing code for this method&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (201).png" style="width: 999px;"&gt;&lt;img src="https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/45994i862E0D440FC2A7DD/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="Screenshot (201).png" alt="Screenshot (201).png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 17:54:46 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-mockito-junit-testing-for-multifield/m-p/538850#M133850</guid>
      <dc:creator>HariDo</dc:creator>
      <dc:date>2022-08-02T17:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: AEM Mockito junit testing for multifield</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-mockito-junit-testing-for-multifield/m-p/538910#M133859</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;LI-USER uid="17533075"&gt;&lt;/LI-USER&gt;&amp;nbsp;you can write this as below&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;@BeforeEach&lt;BR /&gt;&lt;SPAN&gt;void &lt;/SPAN&gt;setUp() &lt;SPAN&gt;throws &lt;/SPAN&gt;Exception {&lt;BR /&gt;    List&amp;lt;LinkComponentImpl&amp;gt; linkcomponentimpl = &lt;SPAN&gt;new &lt;/SPAN&gt;ArrayList&amp;lt;&amp;gt;()&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    linkComponentimplClass = &lt;SPAN&gt;new &lt;/SPAN&gt;LinkComponentImpl()&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/**&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt; * Test.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt; */&lt;BR /&gt;&lt;/SPAN&gt;@Test&lt;BR /&gt;&lt;SPAN&gt;void &lt;/SPAN&gt;test() {&lt;BR /&gt;    Assert.assertNotNull(linkComponentimplClass.getMultifieldlist())&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;}&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Aug 2022 02:40:22 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-mockito-junit-testing-for-multifield/m-p/538910#M133859</guid>
      <dc:creator>Jagadeesh_Prakash</dc:creator>
      <dc:date>2022-08-03T02:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: AEM Mockito junit testing for multifield</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-mockito-junit-testing-for-multifield/m-p/538918#M133861</link>
      <description>&lt;PRE&gt;Use this code for Example&lt;BR /&gt;Main Class:
@Override
    public List&amp;lt;String&amp;gt; getBooks() {
        if (books != null) {
            return new ArrayList&amp;lt;String&amp;gt;(books);
        } else {
            return Collections.emptyList();
        }
    }

Test Class:
private final AemContext aemContext=new AemContext();

    private Author author;
@Test
    void getBooks() {
        aemContext.currentResource("/component/author");
        author=aemContext.request().adaptTo(Author.class);
        assertEquals(4,author.getBooks().size());
        assertEquals("JAVA",author.getBooks().get(0));
        assertEquals("DS",author.getBooks().get(2));
    }&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Aug 2022 04:26:43 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-mockito-junit-testing-for-multifield/m-p/538918#M133861</guid>
      <dc:creator>Nandheswara</dc:creator>
      <dc:date>2022-08-03T04:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: AEM Mockito junit testing for multifield</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-mockito-junit-testing-for-multifield/m-p/538971#M133871</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have an example here but the implementation may be different for multifield&lt;/P&gt;
&lt;P&gt;Main&lt;BR /&gt;&lt;A href="https://github.com/arunpatidar02/com.aemlab.junitapp/blob/master/core/src/main/java/com/aemlab/junit/core/models/ModelHelper.java" target="_blank"&gt;https://github.com/arunpatidar02/com.aemlab.junitapp/blob/master/core/src/main/java/com/aemlab/junit/core/models/ModelHelper.java&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Test&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/arunpatidar02/com.aemlab.junitapp/blob/master/core/src/test/java/com/aemlab/junit/core/models/ModelHelperTest.java" target="_blank"&gt;https://github.com/arunpatidar02/com.aemlab.junitapp/blob/master/core/src/test/java/com/aemlab/junit/core/models/ModelHelperTest.java&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Json -&amp;nbsp;&lt;A href="https://github.com/arunpatidar02/com.aemlab.junitapp/blob/master/core/src/test/resources/com/aemlab/junit/core/models/ModelHelperTest.json" target="_blank"&gt;https://github.com/arunpatidar02/com.aemlab.junitapp/blob/master/core/src/test/resources/com/aemlab/junit/core/models/ModelHelperTest.json&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 08:20:35 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-mockito-junit-testing-for-multifield/m-p/538971#M133871</guid>
      <dc:creator>arunpatidar</dc:creator>
      <dc:date>2022-08-03T08:20:35Z</dc:date>
    </item>
  </channel>
</rss>

