[ofbiz-framework] branch trunk updated: Fixed: "entity/list" request is not handled well

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch trunk updated: Fixed: "entity/list" request is not handled well

jleroux@apache.org
This is an automated email from the ASF dual-hosted git repository.

jleroux 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 03780e4  Fixed: "entity/list" request is not handled well
03780e4 is described below

commit 03780e466525c73f8bb2af59378a28020ea010ae
Author: Jacques Le Roux <[hidden email]>
AuthorDate: Sun Apr 12 13:59:25 2020 +0200

    Fixed: "entity/list" request is not handled well
   
    (OFBIZ-11593)
   
    Fixes the resolveURIBasicOverrideView test
---
 framework/security/data/SSOJWTDemoData.xml         | 24 ++++++++++++++++++++++
 .../ofbiz/webapp/control/RequestHandlerTests.java  | 14 ++++++-------
 2 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/framework/security/data/SSOJWTDemoData.xml b/framework/security/data/SSOJWTDemoData.xml
new file mode 100644
index 0000000..e073747
--- /dev/null
+++ b/framework/security/data/SSOJWTDemoData.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<entity-engine-xml>
+    <SystemProperty systemResourceId="security" systemPropertyId="security.internal.sso.enabled" systemPropertyValue="false"/>
+    <SystemProperty systemResourceId="security" systemPropertyId="security.token.key" systemPropertyValue="security.token.key"/>
+</entity-engine-xml>
diff --git a/framework/webapp/src/test/java/org/apache/ofbiz/webapp/control/RequestHandlerTests.java b/framework/webapp/src/test/java/org/apache/ofbiz/webapp/control/RequestHandlerTests.java
index 53d760d..183f0b0 100644
--- a/framework/webapp/src/test/java/org/apache/ofbiz/webapp/control/RequestHandlerTests.java
+++ b/framework/webapp/src/test/java/org/apache/ofbiz/webapp/control/RequestHandlerTests.java
@@ -27,9 +27,9 @@ import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
 
 import java.security.cert.X509Certificate;
 import java.util.ArrayList;
@@ -185,16 +185,14 @@ public class RequestHandlerTests {
 
         @Test
         public void resolveURIBasicOverrideView() throws Exception {
-            RequestMap foo = new RequestMap(dummyElement);
-            RequestMap bar = new RequestMap(dummyElement);
-            reqMaps.putSingle("foo", foo);
-            reqMaps.putSingle("bar", bar);
+            RequestMap foobar = new RequestMap(dummyElement);
+            reqMaps.putSingle("foo/bar", foobar);
 
             viewMaps.put("baz", new ViewMap(dummyElement));
 
             when(req.getPathInfo()).thenReturn("/foo/baz");
-            when(ccfg.getDefaultRequest()).thenReturn("bar");
-            assertThat(RequestHandler.resolveURI(ccfg, req), hasItem(foo));
+            when(ccfg.getDefaultRequest()).thenReturn("foo/bar");
+            assertThat(RequestHandler.resolveURI(ccfg, req), hasItem(foobar));
         }
 
         @Test