if (isStatusOnly()) { return null;
if (isStatusOnly()) { return null;
@Test public void addViewControllerWithDefaultViewName() { this.registry.addViewController("/path"); ParameterizableViewController controller = getController("/path"); assertNull(controller.getViewName()); assertNull(controller.getStatusCode()); assertFalse(controller.isStatusOnly()); assertNotNull(controller.getApplicationContext()); }
@Test public void addStatusController() { this.registry.addStatusController("/path", HttpStatus.NOT_FOUND); ParameterizableViewController controller = getController("/path"); assertNull(controller.getViewName()); assertEquals(HttpStatus.NOT_FOUND, controller.getStatusCode()); assertTrue(controller.isStatusOnly()); assertNotNull(controller.getApplicationContext()); }
@Test public void addViewController() { this.registry.addViewController("/path").setViewName("viewName"); ParameterizableViewController controller = getController("/path"); assertEquals("viewName", controller.getViewName()); assertNull(controller.getStatusCode()); assertFalse(controller.isStatusOnly()); assertNotNull(controller.getApplicationContext()); }
if (isStatusOnly() || (getStatusCode().equals(HttpStatus.NO_CONTENT) && getViewName() == null)) { return null; return (isStatusOnly() ? null : modelAndView);