From 2082373f0bd6ef43c39892ff0a0c62af88c3b9ac Mon Sep 17 00:00:00 2001 From: Arpit Varshney Date: Wed, 29 Jan 2020 15:25:50 +0530 Subject: [PATCH 1/8] Added Junits for RedirectNotification test --- .../design/aem/models/v2/common/RedirectNotificationTest.java | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 aemdesign-aem-services/src/test/java/design/aem/models/v2/common/RedirectNotificationTest.java diff --git a/aemdesign-aem-services/src/test/java/design/aem/models/v2/common/RedirectNotificationTest.java b/aemdesign-aem-services/src/test/java/design/aem/models/v2/common/RedirectNotificationTest.java new file mode 100644 index 000000000..339664e61 --- /dev/null +++ b/aemdesign-aem-services/src/test/java/design/aem/models/v2/common/RedirectNotificationTest.java @@ -0,0 +1,4 @@ +package design.aem.models.v2.common; + +public class RedirectNotificationTest { +} From b5c480b0623bfc760bbc4a0e06a34e170a1d3522 Mon Sep 17 00:00:00 2001 From: Arpit Varshney Date: Wed, 29 Jan 2020 15:28:19 +0530 Subject: [PATCH 2/8] Added Junits For Utils Classes. Signed-off-by: Arpit Varshney --- .../v2/common/RedirectNotificationTest.java | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/aemdesign-aem-services/src/test/java/design/aem/models/v2/common/RedirectNotificationTest.java b/aemdesign-aem-services/src/test/java/design/aem/models/v2/common/RedirectNotificationTest.java index 339664e61..f94a29fe9 100644 --- a/aemdesign-aem-services/src/test/java/design/aem/models/v2/common/RedirectNotificationTest.java +++ b/aemdesign-aem-services/src/test/java/design/aem/models/v2/common/RedirectNotificationTest.java @@ -1,4 +1,99 @@ package design.aem.models.v2.common; +import com.day.cq.i18n.I18n; +import com.day.cq.wcm.api.Page; +import com.day.cq.wcm.api.PageManager; +import design.aem.components.ComponentProperties; +import design.aem.utils.components.ComponentsUtil; +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.api.resource.ValueMap; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; + +import javax.script.Bindings; + +import static design.aem.utils.components.CommonUtil.PN_REDIRECT_TARGET; +import static design.aem.utils.components.ComponentsUtil.DEFAULT_FIELDS_ACCESSIBILITY; +import static design.aem.utils.components.ComponentsUtil.DEFAULT_FIELDS_STYLE; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.when; +import static org.mockito.MockitoAnnotations.initMocks; + +@RunWith(PowerMockRunner.class) +@PrepareForTest({ComponentsUtil.class}) public class RedirectNotificationTest { + + @Mock + I18n i18n; + + @Mock + private Bindings bindings; + + @Mock + private ValueMap properties; + + @Mock + private SlingHttpServletRequest request; + + @Mock + PageManager pageManager; + + @Mock + Page page; + + @InjectMocks + RedirectNotification redirectNotification = new RedirectNotification(); + + @Before + public void before() { + initMocks(this); + PowerMockito.mockStatic(ComponentsUtil.class); + when(bindings.get("request")).thenReturn(request); + when(bindings.get("pageProperties")).thenReturn(properties); + when(bindings.get("pageManager")).thenReturn(pageManager); + } + + @Test + public void testReady_Success_ExternalUrl() { + when(properties.get(PN_REDIRECT_TARGET, "")).thenReturn("https://www.linkedin.com/"); + ComponentProperties componentProperties = new ComponentProperties(); + componentProperties.put("redirectUrl", "https://www.linkedin.com/"); + componentProperties.put("redirectTitle", "redirectTitle"); + when(ComponentsUtil.getComponentProperties(eq(redirectNotification), + any(Object[][].class), + eq(DEFAULT_FIELDS_STYLE), + eq(DEFAULT_FIELDS_ACCESSIBILITY))).thenReturn(componentProperties); + redirectNotification.ready(); + Assert.assertEquals("redirectTitle", redirectNotification.getComponentProperties().get("redirectTitle")); + Assert.assertEquals("https://www.linkedin.com/", redirectNotification.getComponentProperties().get("redirectUrl")); + Assert.assertEquals("redirectIsSet", redirectNotification.getComponentProperties().get("redirectIsSet")); + Assert.assertEquals("redirectIsNotSet", redirectNotification.getComponentProperties().get("redirectIsNotSet")); + } + + @Test + public void testReady_Success_InternalUrl() { + when(properties.get(PN_REDIRECT_TARGET, "")).thenReturn("/content/aem.design/home/about-us"); + when(pageManager.getPage("/content/aem.design/home/about")).thenReturn(page); + ComponentProperties componentProperties = new ComponentProperties(); + componentProperties.put("redirectUrl", "/content/aem.design/home/about"); + componentProperties.put("redirectTitle", "redirectTitle"); + when(ComponentsUtil.getComponentProperties(eq(redirectNotification), + any(Object[][].class), + eq(DEFAULT_FIELDS_STYLE), + eq(DEFAULT_FIELDS_ACCESSIBILITY))).thenReturn(componentProperties); + redirectNotification.ready(); + Assert.assertEquals("redirectTitle", redirectNotification.getComponentProperties().get("redirectTitle")); + Assert.assertEquals("/content/aem.design/home/about.html", redirectNotification.getComponentProperties().get("redirectUrl")); + Assert.assertEquals("redirectIsSet", redirectNotification.getComponentProperties().get("redirectIsSet")); + Assert.assertEquals("redirectIsNotSet", redirectNotification.getComponentProperties().get("redirectIsNotSet")); + } + } From 074d994ce6f80ad0f18cc6c5a7b77f65ddf07596 Mon Sep 17 00:00:00 2001 From: Arpit Varshney Date: Wed, 29 Jan 2020 16:03:16 +0530 Subject: [PATCH 3/8] Added Junits For StaticInclude Class and removed unused variable from RedirectNotificationTest. --- .../v2/common/RedirectNotificationTest.java | 4 - .../models/v2/common/StaticIncludeTest.java | 92 +++++++++++++++++++ 2 files changed, 92 insertions(+), 4 deletions(-) create mode 100644 aemdesign-aem-services/src/test/java/design/aem/models/v2/common/StaticIncludeTest.java diff --git a/aemdesign-aem-services/src/test/java/design/aem/models/v2/common/RedirectNotificationTest.java b/aemdesign-aem-services/src/test/java/design/aem/models/v2/common/RedirectNotificationTest.java index f94a29fe9..cee8b23bb 100644 --- a/aemdesign-aem-services/src/test/java/design/aem/models/v2/common/RedirectNotificationTest.java +++ b/aemdesign-aem-services/src/test/java/design/aem/models/v2/common/RedirectNotificationTest.java @@ -1,6 +1,5 @@ package design.aem.models.v2.common; -import com.day.cq.i18n.I18n; import com.day.cq.wcm.api.Page; import com.day.cq.wcm.api.PageManager; import design.aem.components.ComponentProperties; @@ -31,9 +30,6 @@ @PrepareForTest({ComponentsUtil.class}) public class RedirectNotificationTest { - @Mock - I18n i18n; - @Mock private Bindings bindings; diff --git a/aemdesign-aem-services/src/test/java/design/aem/models/v2/common/StaticIncludeTest.java b/aemdesign-aem-services/src/test/java/design/aem/models/v2/common/StaticIncludeTest.java new file mode 100644 index 000000000..0c96b661d --- /dev/null +++ b/aemdesign-aem-services/src/test/java/design/aem/models/v2/common/StaticIncludeTest.java @@ -0,0 +1,92 @@ +package design.aem.models.v2.common; + +import com.adobe.cq.sightly.SightlyWCMMode; +import com.day.cq.wcm.api.components.Component; +import design.aem.components.ComponentProperties; +import design.aem.utils.components.ComponentsUtil; +import org.apache.jackrabbit.vault.util.JcrConstants; +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.api.resource.ResourceResolver; +import org.apache.sling.api.resource.ValueMap; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; + +import javax.script.Bindings; + +import static design.aem.utils.components.ComponentsUtil.DEFAULT_FIELDS_ACCESSIBILITY; +import static design.aem.utils.components.ComponentsUtil.DEFAULT_FIELDS_STYLE; +import static design.aem.utils.components.ConstantsUtil.SITE_INCLUDE_PATHS; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.when; +import static org.mockito.MockitoAnnotations.initMocks; + +@RunWith(PowerMockRunner.class) +@PrepareForTest({ComponentsUtil.class}) +public class StaticIncludeTest { + + @Mock + private SlingHttpServletRequest request; + + @Mock + private Bindings bindings; + + @Mock + Component component; + + @Mock + ValueMap valueMap; + + @Mock + SightlyWCMMode wcmMode; + + @Mock + ResourceResolver resourceResolver; + + @InjectMocks + StaticInclude staticInclude = new StaticInclude(); + + @Before + public void before() { + initMocks(this); + PowerMockito.mockStatic(ComponentsUtil.class); + when(bindings.get("request")).thenReturn(request); + when(bindings.get("component")).thenReturn(component); + when(bindings.get("properties")).thenReturn(valueMap); + when(bindings.get("wcmmode")).thenReturn(wcmMode); + when(component.getProperties()).thenReturn(valueMap); + when(request.getResourceResolver()).thenReturn(resourceResolver); + } + + @Test + public void testReady_Success() { + final String[] paths = new String[]{"/path1"}; + ComponentProperties componentProperties = new ComponentProperties(); + when(ComponentsUtil.getComponentProperties(eq(staticInclude), + any(Object[][].class), + eq(DEFAULT_FIELDS_STYLE), + eq(DEFAULT_FIELDS_ACCESSIBILITY))).thenReturn(componentProperties); + when(valueMap.get(JcrConstants.JCR_TITLE, "")).thenReturn("title"); + when(valueMap.get(SITE_INCLUDE_PATHS, new String[0])).thenReturn(paths); + when(valueMap.get("showContentPreview", "false")).thenReturn("true"); + when(valueMap.get("showContent", "false")).thenReturn("true"); + when(ComponentsUtil.getResourceContent(resourceResolver, paths, "")).thenReturn("resource-content"); + when(wcmMode.isEdit()).thenReturn(true); + staticInclude.ready(); + Assert.assertTrue((Boolean) staticInclude.getComponentProperties().get("hasContent")); + Assert.assertTrue((Boolean) staticInclude.getComponentProperties().get("showContentPreview")); + Assert.assertTrue((Boolean) staticInclude.getComponentProperties().get("showContentSet")); + Assert.assertTrue((Boolean) staticInclude.getComponentProperties().get("showContent")); + Assert.assertEquals("resource-content", staticInclude.getComponentProperties().get("includeContents")); + Assert.assertEquals("parentnotfound", staticInclude.getComponentProperties().get("parentnotfound")); + Assert.assertEquals("title", staticInclude.getComponentProperties().get("componentName")); + Assert.assertEquals("/path1", staticInclude.getComponentProperties().get("includePaths")); + } +} From e02f593fa717efe400b55f224e8db64a688be8a0 Mon Sep 17 00:00:00 2001 From: Arpit varshney Date: Tue, 4 Feb 2020 20:27:10 +0530 Subject: [PATCH 4/8] Added Unit Test case for DataLayer --- .../java/design/aem/models/v2/analytics/DataLayerTest.java | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 aemdesign-aem-services/src/test/java/design/aem/models/v2/analytics/DataLayerTest.java diff --git a/aemdesign-aem-services/src/test/java/design/aem/models/v2/analytics/DataLayerTest.java b/aemdesign-aem-services/src/test/java/design/aem/models/v2/analytics/DataLayerTest.java new file mode 100644 index 000000000..f09b8cc93 --- /dev/null +++ b/aemdesign-aem-services/src/test/java/design/aem/models/v2/analytics/DataLayerTest.java @@ -0,0 +1,4 @@ +package design.aem.models.v2.analytics; + +public class DataLayerTest { +} From 64dafb981d84608ce8f860ecd213906f76a2a11b Mon Sep 17 00:00:00 2001 From: Arpit varshney Date: Tue, 4 Feb 2020 20:31:35 +0530 Subject: [PATCH 5/8] Added Unit Test case for DataLayer --- .../models/v2/analytics/DataLayerTest.java | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/aemdesign-aem-services/src/test/java/design/aem/models/v2/analytics/DataLayerTest.java b/aemdesign-aem-services/src/test/java/design/aem/models/v2/analytics/DataLayerTest.java index f09b8cc93..254c768f6 100644 --- a/aemdesign-aem-services/src/test/java/design/aem/models/v2/analytics/DataLayerTest.java +++ b/aemdesign-aem-services/src/test/java/design/aem/models/v2/analytics/DataLayerTest.java @@ -1,4 +1,106 @@ package design.aem.models.v2.analytics; +import com.day.cq.replication.ReplicationStatus; +import com.day.cq.wcm.api.Page; +import com.day.cq.wcm.api.components.Component; +import design.aem.components.ComponentProperties; +import design.aem.utils.components.CommonUtil; +import design.aem.utils.components.ComponentsUtil; +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.api.resource.ResourceResolver; +import org.apache.sling.api.resource.ValueMap; +import org.apache.sling.api.scripting.SlingScriptHelper; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; + +import javax.script.Bindings; +import java.util.Locale; + +import static design.aem.utils.components.CommonUtil.DEFAULT_LIST_DETAILS_SUFFIX; +import static design.aem.utils.components.ComponentsUtil.*; +import static java.text.MessageFormat.format; +import static org.mockito.Mockito.when; +import static org.mockito.MockitoAnnotations.initMocks; + +@RunWith(PowerMockRunner.class) +@PrepareForTest({ComponentsUtil.class, CommonUtil.class}) public class DataLayerTest { + + @InjectMocks + DataLayer dataLayer = new DataLayer(); + + @Mock + Page page; + + @Mock + SlingHttpServletRequest request; + + @Mock + ValueMap properties; + + @Mock + Bindings bindings; + + @Mock + ResourceResolver resourceResolver; + + @Mock + Component component; + + @Mock + SlingScriptHelper helper; + + @Mock + Resource resource; + + @Before + public void before() { + initMocks(this); + PowerMockito.mockStatic(ComponentsUtil.class); + PowerMockito.mockStatic(CommonUtil.class); + when(bindings.get("resourcePage")).thenReturn(page); + when(bindings.get("properties")).thenReturn(properties); + when(bindings.get("request")).thenReturn(request); + when(bindings.get("components")).thenReturn(component); + when(bindings.get("sling")).thenReturn(helper); + when(request.getResourceResolver()).thenReturn(resourceResolver); + } + + @Test + public void testActivate_Success() throws Exception { + Locale locale = new Locale("en", "australia"); + ComponentProperties componentProperties = new ComponentProperties(); + when(page.getPath()).thenReturn("path"); + when(properties.get(ReplicationStatus.NODE_PROPERTY_LAST_REPLICATED, "")).thenReturn(""); + when(ComponentsUtil.getNewComponentProperties(dataLayer)).thenReturn(componentProperties); + when(page.getLanguage(false)).thenReturn(locale); + when(CommonUtil.findComponentInPage(page, DEFAULT_LIST_DETAILS_SUFFIX)).thenReturn("path"); + when(resourceResolver.getResource("path")).thenReturn(resource); + when(resource.getResourceType()).thenReturn("aemdesign/components/lists/list/v2"); + when(resource.adaptTo(ValueMap.class)).thenReturn(properties); + when(properties.get(DETAILS_ANALYTICS_PAGENAME, "")).thenReturn("name"); + when(properties.get(DETAILS_ANALYTICS_PAGETYPE, "")).thenReturn("full-width"); + when(properties.get(DETAILS_ANALYTICS_PLATFORM, "aem")).thenReturn("mobile"); + when(properties.get(DETAILS_ANALYTICS_ABORT, "false")).thenReturn("true"); + when(properties.get(DETAILS_ANALYTICS_VARIANT, DEFAULT_VARIANT)).thenReturn("variant"); + when(ComponentsUtil.getComponentVariantTemplate(component, format(COMPONENT_VARIANT_TEMPLATE_FORMAT, "variant"), helper)).thenReturn("template"); + dataLayer.activate(); + Assert.assertEquals("template", dataLayer.getComponentProperties().get("variantTemplate")); + Assert.assertEquals("full-width", dataLayer.getComponentProperties().get("pageType")); + Assert.assertEquals("true", dataLayer.getComponentProperties().get("abort")); + Assert.assertEquals("AUSTRALIA", dataLayer.getComponentProperties().get("contentCountry")); + Assert.assertEquals("english", dataLayer.getComponentProperties().get("contentLanguage")); + Assert.assertEquals("path", dataLayer.getComponentProperties().get("pagePath")); + Assert.assertEquals("name", dataLayer.getComponentProperties().get("pageName")); + Assert.assertEquals("", dataLayer.getComponentProperties().get("effectiveDate")); + Assert.assertEquals("mobile", dataLayer.getComponentProperties().get("platform")); + } } From 518ba9062623889a01bc642f05f4c74226d74fc4 Mon Sep 17 00:00:00 2001 From: Arpit varshney Date: Tue, 4 Feb 2020 21:30:04 +0530 Subject: [PATCH 6/8] Added Unit Test case for Link --- .../src/test/java/design/aem/models/v2/content/LinkTest.java | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 aemdesign-aem-services/src/test/java/design/aem/models/v2/content/LinkTest.java diff --git a/aemdesign-aem-services/src/test/java/design/aem/models/v2/content/LinkTest.java b/aemdesign-aem-services/src/test/java/design/aem/models/v2/content/LinkTest.java new file mode 100644 index 000000000..221ee6e43 --- /dev/null +++ b/aemdesign-aem-services/src/test/java/design/aem/models/v2/content/LinkTest.java @@ -0,0 +1,4 @@ +package design.aem.models.v2.content; + +public class LinkTest { +} From 9631e51187fac4c5ac6948363b63f8fc7fa9ca74 Mon Sep 17 00:00:00 2001 From: Arpit varshney Date: Tue, 4 Feb 2020 21:31:23 +0530 Subject: [PATCH 7/8] Added Unit Test case for Link --- .../aem/models/v2/content/LinkTest.java | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/aemdesign-aem-services/src/test/java/design/aem/models/v2/content/LinkTest.java b/aemdesign-aem-services/src/test/java/design/aem/models/v2/content/LinkTest.java index 221ee6e43..ad813755a 100644 --- a/aemdesign-aem-services/src/test/java/design/aem/models/v2/content/LinkTest.java +++ b/aemdesign-aem-services/src/test/java/design/aem/models/v2/content/LinkTest.java @@ -1,4 +1,62 @@ package design.aem.models.v2.content; +import design.aem.components.ComponentProperties; +import design.aem.utils.components.ComponentsUtil; +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.api.resource.Resource; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; + +import javax.script.Bindings; + +import static design.aem.utils.components.ComponentsUtil.*; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.when; +import static org.mockito.MockitoAnnotations.initMocks; + +@RunWith(PowerMockRunner.class) +@PrepareForTest({ComponentsUtil.class}) public class LinkTest { + + @InjectMocks + Link link = new Link(); + + @Mock + SlingHttpServletRequest request; + + @Mock + Resource resource; + + @Mock + Bindings bindings; + + @Before + public void before() { + initMocks(this); + PowerMockito.mockStatic(ComponentsUtil.class); + when(bindings.get("request")).thenReturn(request); + when(bindings.get("resource")).thenReturn(resource); + } + + @Test + public void testReady() { + ComponentProperties componentProperties = new ComponentProperties(); + when(ComponentsUtil.getComponentProperties(eq(link), + any(Object[][].class), + eq(DEFAULT_FIELDS_STYLE), + eq(DEFAULT_FIELDS_ACCESSIBILITY), + eq(DEFAULT_FIELDS_ANALYTICS), + eq(DEFAULT_FIELDS_ATTRIBUTES))).thenReturn(componentProperties); + when(resource.getPath()).thenReturn("PATH"); + link.ready(); + Assert.assertTrue(link.getComponentProperties().isEmpty()); + } } From 03985a8ea12b083422b3bc63461ea693741d5119 Mon Sep 17 00:00:00 2001 From: Arpit Varshney Date: Tue, 11 Feb 2020 11:23:02 +0530 Subject: [PATCH 8/8] Reverting Junit for Link Class. --- .../aem/models/v2/content/LinkTest.java | 62 ------------------- 1 file changed, 62 deletions(-) delete mode 100644 aemdesign-aem-services/src/test/java/design/aem/models/v2/content/LinkTest.java diff --git a/aemdesign-aem-services/src/test/java/design/aem/models/v2/content/LinkTest.java b/aemdesign-aem-services/src/test/java/design/aem/models/v2/content/LinkTest.java deleted file mode 100644 index ad813755a..000000000 --- a/aemdesign-aem-services/src/test/java/design/aem/models/v2/content/LinkTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package design.aem.models.v2.content; - -import design.aem.components.ComponentProperties; -import design.aem.utils.components.ComponentsUtil; -import org.apache.sling.api.SlingHttpServletRequest; -import org.apache.sling.api.resource.Resource; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; - -import javax.script.Bindings; - -import static design.aem.utils.components.ComponentsUtil.*; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.when; -import static org.mockito.MockitoAnnotations.initMocks; - -@RunWith(PowerMockRunner.class) -@PrepareForTest({ComponentsUtil.class}) -public class LinkTest { - - @InjectMocks - Link link = new Link(); - - @Mock - SlingHttpServletRequest request; - - @Mock - Resource resource; - - @Mock - Bindings bindings; - - @Before - public void before() { - initMocks(this); - PowerMockito.mockStatic(ComponentsUtil.class); - when(bindings.get("request")).thenReturn(request); - when(bindings.get("resource")).thenReturn(resource); - } - - @Test - public void testReady() { - ComponentProperties componentProperties = new ComponentProperties(); - when(ComponentsUtil.getComponentProperties(eq(link), - any(Object[][].class), - eq(DEFAULT_FIELDS_STYLE), - eq(DEFAULT_FIELDS_ACCESSIBILITY), - eq(DEFAULT_FIELDS_ANALYTICS), - eq(DEFAULT_FIELDS_ATTRIBUTES))).thenReturn(componentProperties); - when(resource.getPath()).thenReturn("PATH"); - link.ready(); - Assert.assertTrue(link.getComponentProperties().isEmpty()); - } -}