BAEL3771 Review Comments (#8726)

* BAEL3771: Cache Headers in Spring MVC

* BEAL3771: Cache Headers in Spring MVC

* BEAL3771: Cache Headers in Spring MVC

* BAEL:3771 Few review comments
This commit is contained in:
dev-chirag
2020-02-15 22:12:27 +05:30
committed by GitHub
parent 86ce51a4fd
commit a1c1f05cf1
3 changed files with 15 additions and 15 deletions

View File

@@ -37,7 +37,8 @@ public class CacheControlControllerIntegrationTest {
this.mockMvc.perform(MockMvcRequestBuilders.get("/hello/baeldung"))
.andDo(MockMvcResultHandlers.print())
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.header().string("Cache-Control","max-age=60, must-revalidate, no-transform"));
.andExpect(MockMvcResultMatchers.header()
.string("Cache-Control","max-age=60, must-revalidate, no-transform"));
}
@Test
@@ -59,7 +60,7 @@ public class CacheControlControllerIntegrationTest {
@Test
void whenInterceptor_thenReturnCacheHeader() throws Exception {
this.mockMvc.perform(MockMvcRequestBuilders.get("/cache/baeldung"))
this.mockMvc.perform(MockMvcRequestBuilders.get("/login/baeldung"))
.andDo(MockMvcResultHandlers.print())
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.header().string("Cache-Control","max-age=60, must-revalidate, no-transform"));
@@ -69,7 +70,7 @@ public class CacheControlControllerIntegrationTest {
void whenValidate_thenReturnCacheHeader() throws Exception {
HttpHeaders headers = new HttpHeaders();
headers.add(IF_UNMODIFIED_SINCE, "Tue, 04 Feb 2020 19:57:25 GMT");
this.mockMvc.perform(MockMvcRequestBuilders.get("/validate/baeldung").headers(headers))
this.mockMvc.perform(MockMvcRequestBuilders.get("/productInfo/baeldung").headers(headers))
.andDo(MockMvcResultHandlers.print())
.andExpect(MockMvcResultMatchers.status().is(304));
}