@@ -0,0 +1,1386 @@
+package de.terrestris.shogun2.util.application;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport java.net.URI;%0Aimport java.net.URISyntaxException;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.springframework.mock.web.MockHttpServletRequest;%0A%0Apublic class Shogun2ServletContextTest %7B%0A%0A%09/**%0A%09 * The mockup request%0A%09 */%0A%09private MockHttpServletRequest request;%0A%0A%09/**%0A%09 * The class to test.%0A%09 */%0A%09private Shogun2ServletContext shogun2ServletContext = new Shogun2ServletContext();%0A%0A%09/**%0A%09 *%0A%09 */%0A%09@Before%0A%09public void setUp() %7B%0A%09%09request = new MockHttpServletRequest();%0A%09%7D%0A%0A%09/**%0A%09 *%0A%09 */%0A%09@After%0A%09public void clean() %7B%0A%09%09request.close();%0A%09%7D%0A%0A%09@Test%0A%09public void getApplicationURIFromRequest_returnsAppURIonly() throws URISyntaxException %7B%0A%0A%09%09String scheme = %22http%22;%0A%09%09String host = %22localhost%22;%0A%09%09int port = 8080;%0A%09%09String path = %22/webapp%22;%0A%0A%09%09Map%3CString, String%3E params = new HashMap%3CString, String%3E();%0A%09%09params.put(%22key1%22, %22val1%22);%0A%09%09params.put(%22key2%22, %22val2%22);%0A%0A%09%09// mock the request%0A%09%09request.setScheme(scheme);%0A%09%09request.setServerName(host);%0A%09%09request.setServerPort(port);%0A%09%09request.setContextPath(path);%0A%09%09request.setParameters(params);%0A%0A%09%09URI uri = shogun2ServletContext.getApplicationURIFromRequest(request);%0A%0A%09%09assertEquals(scheme + %22://%22 + host + %22:%22 + port + path, uri.toString());%0A%0A%09%7D%0A%7D%0A

Add test fpr ServletContestUtil