@Test public void getAdminDeploymentPath_when_vhost_set() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); request.setContextPath(null); VirtualHostHelper.setBasePath(request, ""); assertEquals("", DeploymentPathResolver.getAdminDeploymentPath(request)); VirtualHostHelper.setBasePath(request, "/"); assertEquals("/", DeploymentPathResolver.getAdminDeploymentPath(request)); VirtualHostHelper.setBasePath(request, "/admin"); assertEquals("/admin", DeploymentPathResolver.getAdminDeploymentPath(request)); }
@Test public void getAdminDeploymentPath_when_context_path_not_set_and_vhost_not_set() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); request.setContextPath(null); assertEquals("/admin", DeploymentPathResolver.getAdminDeploymentPath(request)); }
@Test public void testGetAdminDeploymentPath_when_context_path_set() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); request.setContextPath("/cms"); assertEquals("/cms/admin", DeploymentPathResolver.getAdminDeploymentPath(request)); }