diff --git a/src/test/java/org/entando/entando/plugins/jpseo/apsadmin/portal/PageSettingsActionAspectTest.java b/src/test/java/org/entando/entando/plugins/jpseo/apsadmin/portal/PageSettingsActionAspectTest.java index 652eee21..c20ce14e 100644 --- a/src/test/java/org/entando/entando/plugins/jpseo/apsadmin/portal/PageSettingsActionAspectTest.java +++ b/src/test/java/org/entando/entando/plugins/jpseo/apsadmin/portal/PageSettingsActionAspectTest.java @@ -21,6 +21,7 @@ */ package org.entando.entando.plugins.jpseo.apsadmin.portal; +import org.entando.entando.apsadmin.user.UserSettingsAction; import org.entando.entando.ent.exception.EntException; import com.agiletec.aps.system.services.baseconfig.ConfigInterface; import com.agiletec.apsadmin.portal.PageSettingsAction; @@ -84,6 +85,9 @@ class PageSettingsActionAspectTest { @InjectMocks private PageSettingsAction pageSettingsAction; + @InjectMocks + private UserSettingsAction userSettingsAction; + @InjectMocks private PageSettingsActionAspect actionAspect; @@ -207,4 +211,12 @@ public void executeUpdateSystemParams_9() throws EntException { Assertions.assertTrue(pageSettingsAction.hasActionErrors()); } + @Test + public void executeUpdateSystemWithIncorrectObject() throws EntException { + when(joinPoint.getTarget()).thenReturn(userSettingsAction); + actionAspect.executeUpdateSystemParams(joinPoint); + Assertions.assertFalse(pageSettingsAction.hasFieldErrors()); + Assertions.assertFalse(pageSettingsAction.hasActionErrors()); + } + }