### Question:
ShogunCoreContextUtil { public static final URI getApplicationURIFromRequest(HttpServletRequest request) throws URISyntaxException { URI appURI = null; String scheme = request.getScheme(); String host = request.getServerName(); int port = request.getServerPort(); String path = request.getContextPath(); appURI = new URIBuilder() .setScheme(scheme) .setHost(host) .setPort(port) .setPath(path) .build(); return appURI; }  static final URI getApplicationURIFromRequest(HttpServletRequest request);  }### Answer:
@Test public void getApplicationURIFromRequest_returnsAppURIonly() throws URISyntaxException { String scheme = "http"; String host = "localhost"; int port = 8080; String path = "/webapp"; Map<String, String> params = new HashMap<String, String>(); params.put("key1", "val1"); params.put("key2", "val2"); request.setScheme(scheme); request.setServerName(host); request.setServerPort(port); request.setContextPath(path); request.setParameters(params); URI uri = ShogunCoreContextUtil.getApplicationURIFromRequest(request); String expected = scheme + ": String actual = uri.toString(); assertEquals(expected, actual); }