This is an automated email from the ASF dual-hosted git repository.
jacopoc pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new 5a3a95f33b Improved: Enhance ModelFormTest to successfully validate
test tokens using the internal mechanism even when the system is configured
with an external authorization server (security.token.issuer).
5a3a95f33b is described below
commit 5a3a95f33b8e10ce8b21abb5b1ca4f51df190caf
Author: Jacopo Cappellato <[email protected]>
AuthorDate: Thu Nov 20 10:33:30 2025 +0100
Improved: Enhance ModelFormTest to successfully validate test tokens using
the internal mechanism even when the system is configured with an external
authorization server (security.token.issuer).
This prevents test failures when security.token.issuer is set.
---
.../test/java/org/apache/ofbiz/widget/model/ModelFormTest.java | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git
a/framework/widget/src/test/java/org/apache/ofbiz/widget/model/ModelFormTest.java
b/framework/widget/src/test/java/org/apache/ofbiz/widget/model/ModelFormTest.java
index 5bea330676..80b6af32af 100644
---
a/framework/widget/src/test/java/org/apache/ofbiz/widget/model/ModelFormTest.java
+++
b/framework/widget/src/test/java/org/apache/ofbiz/widget/model/ModelFormTest.java
@@ -18,6 +18,7 @@
*/
package org.apache.ofbiz.widget.model;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -27,11 +28,14 @@ import org.apache.ofbiz.base.conversion.JSONConverters;
import org.apache.ofbiz.base.util.UtilMisc;
import org.apache.ofbiz.entity.Delegator;
import org.apache.ofbiz.entity.GenericEntityException;
+import org.apache.ofbiz.entity.GenericValue;
import org.apache.ofbiz.webapp.control.JWTManager;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.when;
public class ModelFormTest {
private HashMap<String, Object> context;
@@ -40,6 +44,11 @@ public class ModelFormTest {
@Before
public void setUp() throws GenericEntityException {
delegator = Mockito.mock(Delegator.class);
+ GenericValue genericValue = Mockito.mock(GenericValue.class);
+ List<GenericValue> list = new ArrayList<>();
+ list.add(genericValue);
+ when(delegator.findList(any(), any(), any(), any(), any(), any(),
Mockito.anyBoolean()))
+ .thenReturn(list);
context = new HashMap<>();
context.put("delegator", delegator);
}