/*
* Test method for 'org.grails.web.servlet.DefaultGrailsApplicationAttributes.getViewUri(String, ServletRequest)'
*/
public void testGetViewUri() throws Exception {
GrailsApplicationAttributes attrs = new DefaultGrailsApplicationAttributes(new MockServletContext());
GroovyClassLoader gcl = new GroovyClassLoader();
Class<?> controllerClass = gcl.parseClass("class TestController {\n" +
"def "+ControllerDynamicMethods.CONTROLLER_URI_PROPERTY+" = '/test'\n" +
"def "+ControllerDynamicMethods.CONTROLLER_NAME_PROPERTY+" = 'test'\n" +
"}");
MockHttpServletRequest request = new MockHttpServletRequest();
request.setAttribute(GrailsApplicationAttributes.CONTROLLER, controllerClass.newInstance());
assertEquals("/WEB-INF/grails-app/views/test/aView.gsp",attrs.getViewUri("aView", request));
assertEquals("/WEB-INF/grails-app/views/shared.gsp",attrs.getViewUri("/shared", request));
}