How to work with dates in Thymeleaf (#960)
* How to work with dates in Thymeleaf * Fixes in PR for Thymeleaf
This commit is contained in:
+23
-16
@@ -30,29 +30,36 @@ import com.baeldung.thymeleaf.config.WebMVCSecurity;
|
||||
@WebAppConfiguration
|
||||
@ContextConfiguration(classes = { WebApp.class, WebMVCConfig.class, WebMVCSecurity.class, InitSecurity.class })
|
||||
public class ExpressionUtilityObjectsControllerIntegrationTest {
|
||||
|
||||
|
||||
@Autowired
|
||||
WebApplicationContext wac;
|
||||
@Autowired
|
||||
MockHttpSession session;
|
||||
WebApplicationContext wac;
|
||||
@Autowired
|
||||
MockHttpSession session;
|
||||
|
||||
private MockMvc mockMvc;
|
||||
private MockMvc mockMvc;
|
||||
|
||||
@Autowired
|
||||
private Filter springSecurityFilterChain;
|
||||
@Autowired
|
||||
private Filter springSecurityFilterChain;
|
||||
|
||||
protected RequestPostProcessor testUser() {
|
||||
return user("user1").password("user1Pass").roles("USER");
|
||||
}
|
||||
protected RequestPostProcessor testUser() {
|
||||
return user("user1").password("user1Pass").roles("USER");
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
mockMvc = MockMvcBuilders.webAppContextSetup(wac).addFilters(springSecurityFilterChain).build();
|
||||
}
|
||||
@Before
|
||||
public void setup() {
|
||||
mockMvc = MockMvcBuilders.webAppContextSetup(wac).addFilters(springSecurityFilterChain).build();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetDates() throws Exception{
|
||||
mockMvc.perform(get("/objects").with(testUser()).with(csrf())).andExpect(status().isOk()).andExpect(view().name("objects.html"));
|
||||
public void testGetObjects() throws Exception {
|
||||
mockMvc.perform(get("/objects").with(testUser()).with(csrf())).andExpect(status().isOk())
|
||||
.andExpect(view().name("objects.html"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDates() throws Exception {
|
||||
mockMvc.perform(get("/dates").with(testUser()).with(csrf())).andExpect(status().isOk())
|
||||
.andExpect(view().name("dates.html"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user