/** * Checks for the requested URI mapping in Server config : Servlet Specification 2.3 Section 10 "Mapping Requests to * Servlets". * * @param uri the URI of the current request, decoded and without the context path * @return URI string mapping */ public String getURIMapping(String uri) { return getURIMapping(uri, null); }
/** * @return URI mapping as in ServerInfo */ protected String getURIMapping(String currentURI, String queryString) { return Components.getComponent(VirtualURIManager.class).getURIMapping(currentURI, queryString); } }
/** * @return URI mapping as in ServerInfo */ protected String getURIMapping(String currentURI) { return Components.getComponent(VirtualURIManager.class).getURIMapping(currentURI); }
@Test public void testMap() throws RegistrationException { // GIVEN VirtualURIManager manager = new VirtualURIManager(moduleRegistry, new Node2BeanProcessorImpl(new TypeMappingImpl(), new Node2BeanTransformerImpl()), eventBus); // WHEN eventBus.fireEvent(new ModulesStartedEvent()); // THEN assertEquals("/1", manager.getURIMapping("/first")); assertEquals("/2", manager.getURIMapping("/second")); assertEquals(StringUtils.EMPTY, manager.getURIMapping("/unmapped")); }