@Test public void testCreateSingleVariable() throws Exception { final String expectedContextPath = "myExpectedContextPathValue"; final StringJavaScriptVariable expectedVariable = new StringJavaScriptVariable("contextPath", expectedContextPath); when(context.getContextPath()).thenReturn(expectedContextPath); final JavaScriptVariable actualVariable = source.createSingleVariable(); assertEquals(expectedVariable, actualVariable); }
@Override protected JavaScriptVariable createSingleVariable() { return new StringJavaScriptVariable("contextPath", servletContext.getContextPath()); }
ContextPathSource extends AbstractSingleVariableSource implements JavaScriptVariableSource { @Override protected JavaScriptVariable createSingleVariable() { return new StringJavaScriptVariable("contextPath", servletContext.getContextPath()); } }
ContextPathSource extends AbstractSingleVariableSource implements JavaScriptVariableSource { @Override protected JavaScriptVariable createSingleVariable() { return new StringJavaScriptVariable("contextPath", servletContext.getContextPath()); } ContextPathSource(final ServletContext theServletContext); }
ContextPathSource extends AbstractSingleVariableSource implements JavaScriptVariableSource { @Override protected JavaScriptVariable createSingleVariable() { return new StringJavaScriptVariable("contextPath", servletContext.getContextPath()); } ContextPathSource(final ServletContext theServletContext);  }
ContextPathSource extends AbstractSingleVariableSource implements JavaScriptVariableSource { @Override protected JavaScriptVariable createSingleVariable() { return new StringJavaScriptVariable("contextPath", servletContext.getContextPath()); } ContextPathSource(final ServletContext theServletContext);   }