Replace space indentation with tabs

Issue: SPR-10127
This commit is contained in:
Phillip Webb
2012-12-19 14:55:41 -08:00
committed by Chris Beams
parent 1762157ad1
commit 2cf45bad86
154 changed files with 1481 additions and 1476 deletions

View File

@@ -228,9 +228,9 @@ public class MockHttpServletRequestBuilderTests {
assertEquals("bar=baz", request.getParameter("foo"));
}
@Test
public void acceptHeader() throws Exception {
this.builder.accept(MediaType.TEXT_HTML, MediaType.APPLICATION_XML);
@Test
public void acceptHeader() throws Exception {
this.builder.accept(MediaType.TEXT_HTML, MediaType.APPLICATION_XML);
MockHttpServletRequest request = this.builder.buildRequest(this.servletContext);
List<String> accept = Collections.list(request.getHeaders("Accept"));

View File

@@ -40,7 +40,7 @@ public class ExceptionHandlerTests {
standaloneSetup(new PersonController()).build()
.perform(get("/person/Clyde"))
.andExpect(status().isOk())
.andExpect(forwardedUrl("errorView"));
.andExpect(forwardedUrl("errorView"));
}

View File

@@ -52,32 +52,32 @@ public class RedirectTests {
public void save() throws Exception {
this.mockMvc.perform(post("/persons").param("name", "Andy"))
.andExpect(status().isMovedTemporarily())
.andExpect(redirectedUrl("/persons/Joe"))
.andExpect(model().size(1))
.andExpect(model().attributeExists("name"))
.andExpect(flash().attributeCount(1))
.andExpect(flash().attribute("message", "success!"));
.andExpect(redirectedUrl("/persons/Joe"))
.andExpect(model().size(1))
.andExpect(model().attributeExists("name"))
.andExpect(flash().attributeCount(1))
.andExpect(flash().attribute("message", "success!"));
}
@Test
public void saveWithErrors() throws Exception {
this.mockMvc.perform(post("/persons"))
.andExpect(status().isOk())
.andExpect(forwardedUrl("persons/add"))
.andExpect(model().size(1))
.andExpect(model().attributeExists("person"))
.andExpect(flash().attributeCount(0));
.andExpect(forwardedUrl("persons/add"))
.andExpect(model().size(1))
.andExpect(model().attributeExists("person"))
.andExpect(flash().attributeCount(0));
}
@Test
public void getPerson() throws Exception {
this.mockMvc.perform(get("/persons/Joe").flashAttr("message", "success!"))
.andExpect(status().isOk())
.andExpect(forwardedUrl("persons/index"))
.andExpect(model().size(2))
.andExpect(model().attribute("person", new Person("Joe")))
.andExpect(model().attribute("message", "success!"))
.andExpect(flash().attributeCount(0));
.andExpect(forwardedUrl("persons/index"))
.andExpect(model().size(2))
.andExpect(model().attribute("person", new Person("Joe")))
.andExpect(model().attribute("message", "success!"))
.andExpect(flash().attributeCount(0));
}

View File

@@ -56,26 +56,26 @@ public class FlashAttributeAssertionTests {
@Test
public void testExists() throws Exception {
this.mockMvc.perform(post("/persons"))
.andExpect(flash().attributeExists("one", "two", "three"));
.andExpect(flash().attributeExists("one", "two", "three"));
}
@Test
public void testEqualTo() throws Exception {
this.mockMvc.perform(post("/persons"))
.andExpect(flash().attribute("one", "1"))
.andExpect(flash().attribute("two", 2.222))
.andExpect(flash().attribute("three", new URL("http://example.com")))
.andExpect(flash().attribute("one", equalTo("1"))) // Hamcrest...
.andExpect(flash().attribute("two", equalTo(2.222)))
.andExpect(flash().attribute("three", equalTo(new URL("http://example.com"))));
.andExpect(flash().attribute("one", "1"))
.andExpect(flash().attribute("two", 2.222))
.andExpect(flash().attribute("three", new URL("http://example.com")))
.andExpect(flash().attribute("one", equalTo("1"))) // Hamcrest...
.andExpect(flash().attribute("two", equalTo(2.222)))
.andExpect(flash().attribute("three", equalTo(new URL("http://example.com"))));
}
@Test
public void testMatchers() throws Exception {
this.mockMvc.perform(post("/persons"))
.andExpect(flash().attribute("one", containsString("1")))
.andExpect(flash().attribute("two", closeTo(2, 0.5)))
.andExpect(flash().attribute("three", notNullValue()));
.andExpect(flash().attribute("one", containsString("1")))
.andExpect(flash().attribute("two", closeTo(2, 0.5)))
.andExpect(flash().attribute("three", notNullValue()));
}

View File

@@ -48,10 +48,10 @@ public class RequestAttributeAssertionTests {
@Test
public void testRequestAttributeEqualTo() throws Exception {
this.mockMvc.perform(get("/main/1").servletPath("/main"))
.andExpect(request().attribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE, "/{id}"))
.andExpect(request().attribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, "/1"))
.andExpect(request().attribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE, equalTo("/{id}")))
.andExpect(request().attribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, equalTo("/1")));
.andExpect(request().attribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE, "/{id}"))
.andExpect(request().attribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, "/1"))
.andExpect(request().attribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE, equalTo("/{id}")))
.andExpect(request().attribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, equalTo("/1")));
}
@Test
@@ -60,8 +60,8 @@ public class RequestAttributeAssertionTests {
String producibleMediaTypes = HandlerMapping.PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE;
this.mockMvc.perform(get("/1"))
.andExpect(request().attribute(producibleMediaTypes, hasItem(MediaType.APPLICATION_JSON)))
.andExpect(request().attribute(producibleMediaTypes, not(hasItem(MediaType.APPLICATION_XML))));
.andExpect(request().attribute(producibleMediaTypes, hasItem(MediaType.APPLICATION_JSON)))
.andExpect(request().attribute(producibleMediaTypes, not(hasItem(MediaType.APPLICATION_XML))));
}

View File

@@ -54,14 +54,14 @@ public class SessionAttributeAssertionTests {
@Test
public void testSessionAttributeEqualTo() throws Exception {
this.mockMvc.perform(get("/"))
.andExpect(request().sessionAttribute("locale", Locale.UK))
.andExpect(request().sessionAttribute("locale", equalTo(Locale.UK)));
.andExpect(request().sessionAttribute("locale", Locale.UK))
.andExpect(request().sessionAttribute("locale", equalTo(Locale.UK)));
}
@Test
public void testSessionAttributeMatcher() throws Exception {
this.mockMvc.perform(get("/"))
.andExpect(request().sessionAttribute("locale", notNullValue()));
.andExpect(request().sessionAttribute("locale", notNullValue()));
}