我正试图与陪审团一道测试我的申请。
因此,我设立了以下类别:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "/META-INF/spring/applicationContext-test.xml" )
@TransactionConfiguration
@Transactional
public class DispatcherServletTest extends AbstractJUnit4SpringContextTests {
private MockHttpServletRequest request;
private MockHttpServletResponse response;
private DispatcherServlet dispatcher;
@Before
public void setUp() throws Exception {
request = new MockHttpServletRequest();
response = new MockHttpServletResponse();
MockServletConfig config = new MockServletConfig("myapp");
config.addInitParameter("contextConfigLocation","classpath*:webmvc-config.xml");
dispatcher = new DispatcherServlet();
dispatcher.init(config);
}
//test cases
}
So the problem is, that it seems that my dispatcher servlet cannot send any request to any of my controllers.
I think that there is something with the configuration - contextConfigurationLocation. It looks like he can find the file (otherwise it would throw an exception) , but doesn t load any configuration
The logger says:
org.childrenframework.web.servlet.Page Not Found - Nomap found for HTTP request with URI [http:// localhost:80/myapp/abc]
但我绝对不认为什么是错的。
我感谢任何帮助!
预 收