Author: lukaszlenart
Date: Wed Jan 16 10:39:01 2013
New Revision: 1433889

URL: http://svn.apache.org/viewvc?rev=1433889&view=rev
Log:
Solves problem with missing action name when mapping returned with empty action 
name

Modified:
    
struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/FilterDispatcherTest.java

Modified: 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/FilterDispatcherTest.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/FilterDispatcherTest.java?rev=1433889&r1=1433888&r2=1433889&view=diff
==============================================================================
--- 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/FilterDispatcherTest.java
 (original)
+++ 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/FilterDispatcherTest.java
 Wed Jan 16 10:39:01 2013
@@ -40,6 +40,7 @@ import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.util.Collections;
 import java.util.HashMap;
 
 /**
@@ -92,8 +93,9 @@ public class FilterDispatcherTest extend
                 return _dispatcher;
             }
         };
-        filter.setActionMapper(new InnerActionMapper());
         filter.init(filterConfig);
+        // set ActionMapper after init() as all dependencies will be injected 
in init()
+        filter.setActionMapper(new InnerActionMapper());
         _dispatcher.setDefaultEncoding("UTF-16_DUMMY");
         filter.doFilter(req, res, chain);
 
@@ -157,7 +159,7 @@ public class FilterDispatcherTest extend
     public static class InnerActionMapper implements ActionMapper {
 
         public ActionMapping getMapping(HttpServletRequest request, 
ConfigurationManager config) {
-            return new ActionMapping();
+            return new ActionMapping("action", "/", null, Collections.<String, 
Object>emptyMap());
         }
 
         public ActionMapping getMappingFromActionName(String actionName) {


Reply via email to