List of usage examples for org.springframework.ui ExtendedModelMap ExtendedModelMap
ExtendedModelMap
From source file:no.dusken.barweb.admin.InvoiceControllerTest.java
@Test public void testDeleteInvoice() throws Exception { Model m = new ExtendedModelMap(); String view = controller.deleteInvoice(12L, m); assertEquals("Wrong view", "no/dusken/barweb/common/deleted", view); assertTrue("Entity missing", m.containsAttribute("entity")); verify(invoiceTransaksjonService).deleteInvoiceUpdateTransaksjons(any(Invoice.class), any(List.class)); }
From source file:org.duracloud.account.app.controller.AccountUsersControllerTest.java
@Test public void testDeleteUserInvitation() throws Exception { EasyMock.expect(accountManagerService.getAccount(TEST_ACCOUNT_ID)).andReturn(accountService); this.accountService.deleteUserInvitation(1L); EasyMock.expectLastCall();//from w w w . ja v a 2 s .c om replayMocks(); Model model = new ExtendedModelMap(); this.accountUsersController.deleteUserInvitation(TEST_ACCOUNT_ID, 1L, model); }
From source file:com.acc.storefront.controllers.cms.MiniCartComponentControllerTest.java
@Test public void testTotalWithoutDelivery() throws Exception { final ExtendedModelMap model = new ExtendedModelMap(); miniCartComponentModel.setTotalDisplay(CartTotalDisplayType.TOTAL_WITHOUT_DELIVERY); given(cmsComponentService.getSimpleCMSComponent(TEST_COMPONENT_UID)).willReturn(miniCartComponentModel); miniCartComponentController.handleGet(request, response, model); final PriceData priceData = (PriceData) model.get(MiniCartComponentController.TOTAL_NO_DELIVERY); Assert.assertEquals(TOTAL_VALUE.subtract(DELIVERY_VALUE), priceData.getValue()); }
From source file:com.trenako.web.controllers.RollingStocksControllerTests.java
@Test public void shouldRenderRollingStockViews() { String slug = "acme-123456"; RollingStockView value = new RollingStockView(rollingStock(), null, null, null); when(service.findRollingStockView(eq(slug), (Account) isNull())).thenReturn(value); ModelMap model = new ExtendedModelMap(); controller.setUserContext(null);//from w w w.j av a2s . c om String viewName = controller.show(slug, model); assertEquals("rollingstock/show", viewName); assertTrue(model.containsAttribute("result")); assertEquals(value, model.get("result")); CommentForm commentForm = (CommentForm) model.get("commentForm"); assertNull("Comment is not null", commentForm); }
From source file:org.sventon.web.ctrl.ListRepositoriesControllerTest.java
@Test public void logoutNoRepositoryName() throws Exception { final ListRepositoriesController controller = new ListRepositoriesController(application); application.addConfiguration(createTestRepository("test1")); application.addConfiguration(createTestRepository("test2")); application.setConfigured(true);//from w ww. j a va 2s. c om final ExtendedModelMap map = new ExtendedModelMap(); String view = controller.logoutBeforeListRepositories(true, "", userContext, map); assertEquals("listRepositories", view); assertTrue(userContext.getUserRepositoryContext(new RepositoryName("repo1")).hasCredentials()); assertTrue(userContext.getUserRepositoryContext(new RepositoryName("repo2")).hasCredentials()); }
From source file:computech.controller.CatalogControllerIntegrationTests.java
@Test @SuppressWarnings("unchecked") public void softwareControllerIntegrationTest() { Model model = new ExtendedModelMap(); String returnedView = controller.softwareCatalog(model); assertThat(returnedView, is("software")); Iterable<Object> object = (Iterable<Object>) model.asMap().get("catalog"); assertThat(object, is(iterableWithSize(2))); }
From source file:com.github.carlomicieli.nerdmovies.controllers.MovieControllerTests.java
@Test public void newInitializeTheModel() { ExtendedModelMap model = new ExtendedModelMap(); movieController.newMovie(model);/*from ww w. ja v a 2 s . c o m*/ assertTrue("Model doesn't contain the movie", model.containsAttribute("movie")); assertTrue("The model is not a movie", model.get("movie") instanceof Movie); }
From source file:no.dusken.barweb.admin.InvoiceControllerTest.java
@Test public void testGenerateInvoicePdf() throws Exception { Model m = new ExtendedModelMap(); String view = controller.generateInvoicePdf(12L, m); assertEquals("Wrong view", "invoiceview", view); assertTrue("Entity missing", m.containsAttribute("invoice")); assertTrue("Entity missing", m.containsAttribute("persons")); assertTrue("Entity missing", m.containsAttribute("gjeng")); }
From source file:cec.easyshop.storefront.controllers.cms.MiniCartComponentControllerTest.java
@Test public void testRenderComponent() throws Exception { final ExtendedModelMap model = new ExtendedModelMap(); final String viewName = miniCartComponentController.handleComponent(request, response, model, miniCartComponentModel);// w w w . j a v a2 s. co m Assert.assertEquals(ControllerConstants.Views.Cms.ComponentPrefix + StringUtils.lowerCase(miniCartComponentModel.getItemtype()), viewName); }
From source file:de.iew.web.isc.DSResponseAbstract.java
protected ExtendedModelMap getResponseModel() { if (!containsKey("response")) { put("response", new ExtendedModelMap()); }/*from w w w . j a v a 2 s . c o m*/ return (ExtendedModelMap) get("response"); }