This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 4_0_X
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/4_0_X by this push:
     new bd0df1b759 [SYNCOPE-1841] Fix tests
bd0df1b759 is described below

commit bd0df1b7591f5257953df8a195da55729e0814c0
Author: Francesco Chicchiriccò <[email protected]>
AuthorDate: Thu Apr 17 15:08:23 2025 +0200

    [SYNCOPE-1841] Fix tests
---
 .../console/wicket/markup/html/form/MultiPanel.html | 10 +++++++---
 .../provisioning/java/data/UserDataBinderImpl.java  | 21 ++++++++++++++++++---
 .../apache/syncope/fit/console/PoliciesITCase.java  |  3 +--
 .../org/apache/syncope/fit/console/UsersITCase.java |  4 ++--
 4 files changed, 28 insertions(+), 10 deletions(-)

diff --git 
a/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiPanel.html
 
b/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiPanel.html
index d604c60958..2604c8c9f1 100644
--- 
a/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiPanel.html
+++ 
b/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiPanel.html
@@ -49,15 +49,19 @@ under the License.
               <div class="multipanel-box box">
                 <span wicket:id="panel">[form field]</span>
               </div>
-              <div class="multipanel-btn-minus input-group-addon">
-                <a wicket:id="drop" class="btn btn-danger btn-circle 
btn-lg"><i class="fa fa-minus"></i></a>
-              </div>
+              <span wicket:id="panelMinus">[plus]</span>
             </div>
             <span wicket:id="panelPlus">[plus]</span>
           </div>
         </span>
       </wicket:fragment>
 
+      <wicket:fragment wicket:id="fragmentMinus">
+        <div class="multipanel-btn-minus input-group-addon">
+          <a wicket:id="drop" class="btn btn-danger btn-circle btn-lg"><i 
class="fa fa-minus"></i></a>
+        </div>
+      </wicket:fragment>
+
       <wicket:fragment wicket:id="fragmentPlus">
         <div class="multipanel-btn-plus input-group-addon">
           <a wicket:id="add" class="btn btn-success btn-circle btn-lg"><i 
class="fa fa-plus"></i></a>
diff --git 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
index 9d3ca8a22d..578b6094da 100644
--- 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
+++ 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
@@ -181,12 +181,26 @@ public class UserDataBinderImpl extends 
AbstractAnyDataBinder implements UserDat
         return authUserTO;
     }
 
-    protected void setPassword(final User user, final String password, final 
SyncopeClientCompositeException scce) {
+    protected SyncopeClientException addToSyncopeClientException(
+            final SyncopeClientCompositeException scce,
+            final RuntimeException e) {
+
+        SyncopeClientException sce = 
SyncopeClientException.build(ClientExceptionType.NotFound);
+        sce.getElements().add(e.getMessage());
+        scce.addException(sce);
+        return scce;
+    }
+
+    protected void setPassword(
+            final User user,
+            final String password,
+            final SyncopeClientCompositeException scce) {
+
         try {
             setCipherAlgorithm(user);
             user.setPassword(password);
         } catch (IllegalArgumentException e) {
-            throw new NotFoundException(e.getMessage());
+            throw addToSyncopeClientException(scce, e);
         }
     }
 
@@ -194,11 +208,12 @@ public class UserDataBinderImpl extends 
AbstractAnyDataBinder implements UserDat
             final User user,
             final String securityAnswer,
             final SyncopeClientCompositeException scce) {
+
         try {
             setCipherAlgorithm(user);
             user.setSecurityAnswer(securityAnswer);
         } catch (IllegalArgumentException e) {
-            throw new NotFoundException(e.getMessage());
+            throw addToSyncopeClientException(scce, e);
         }
     }
 
diff --git 
a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/PoliciesITCase.java
 
b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/PoliciesITCase.java
index f13de47669..9b03cc1def 100644
--- 
a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/PoliciesITCase.java
+++ 
b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/PoliciesITCase.java
@@ -697,8 +697,7 @@ public class PoliciesITCase extends AbstractConsoleITCase {
                 
"body:content:tabbedPanel:panel:outerObjectsRepeater:1:outer:container:content:"
                 + 
"togglePanelContainer:container:actions:actions:actionRepeater:2:action:action");
 
-        
TESTER.assertComponent("body:content:tabbedPanel:panel:outerObjectsRepeater:5:outer",
-                Modal.class);
+        
TESTER.assertComponent("body:content:tabbedPanel:panel:outerObjectsRepeater:5:outer",
 Modal.class);
 
         Component modal = TESTER.getComponentFromLastRenderedPage(
                 "body:content:tabbedPanel:panel:outerObjectsRepeater:5:outer");
diff --git 
a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/UsersITCase.java
 
b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/UsersITCase.java
index 80857705d9..17e5ee3211 100644
--- 
a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/UsersITCase.java
+++ 
b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/UsersITCase.java
@@ -518,11 +518,11 @@ public class UsersITCase extends AbstractConsoleITCase {
         // ... remove all values from multivalue field
         TESTER.executeAjaxEvent(TAB_PANEL + "outerObjectsRepeater:0:"
                 + 
"outer:form:content:form:view:membershipsPlainSchemas:0:membershipPlainSchemas:tabs:0:body:"
-                + 
"content:schemas:6:panel:multiValueContainer:innerForm:content:view:1:drop",
+                + 
"content:schemas:6:panel:multiValueContainer:innerForm:content:view:1:panelMinus:drop",
                 Constants.ON_CLICK);
         TESTER.executeAjaxEvent(TAB_PANEL + "outerObjectsRepeater:0:"
                 + 
"outer:form:content:form:view:membershipsPlainSchemas:0:membershipPlainSchemas:tabs:0:body:"
-                + 
"content:schemas:6:panel:multiValueContainer:innerForm:content:view:0:drop",
+                + 
"content:schemas:6:panel:multiValueContainer:innerForm:content:view:0:panelMinus:drop",
                 Constants.ON_CLICK);
 
         formTester = TESTER.newFormTester(TAB_PANEL + 
"outerObjectsRepeater:0:outer:form:content:form");

Reply via email to