@@ -19,7 +19,7 @@ package org.springframework.boot.actuate.trace;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.boot.autoconfigure.web.DefaulErrorAttributes;
|
||||
import org.springframework.boot.autoconfigure.web.DefaultErrorAttributes;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.MockHttpServletResponse;
|
||||
|
||||
@@ -27,7 +27,7 @@ import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* Tests for {@link WebRequestTraceFilter}.
|
||||
*
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
public class WebRequestTraceFilterTests {
|
||||
@@ -76,7 +76,7 @@ public class WebRequestTraceFilterTests {
|
||||
|
||||
@Test
|
||||
public void filterHasError() {
|
||||
this.filter.setErrorAttributes(new DefaulErrorAttributes());
|
||||
this.filter.setErrorAttributes(new DefaultErrorAttributes());
|
||||
MockHttpServletRequest request = new MockHttpServletRequest("GET", "/foo");
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
response.setStatus(500);
|
||||
|
||||
@@ -55,10 +55,10 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
* @see ErrorAttributes
|
||||
*/
|
||||
@Order(Ordered.HIGHEST_PRECEDENCE)
|
||||
public class DefaulErrorAttributes implements ErrorAttributes, HandlerExceptionResolver,
|
||||
public class DefaultErrorAttributes implements ErrorAttributes, HandlerExceptionResolver,
|
||||
Ordered {
|
||||
|
||||
private static final String ERROR_ATTRIBUTE = DefaulErrorAttributes.class.getName()
|
||||
private static final String ERROR_ATTRIBUTE = DefaultErrorAttributes.class.getName()
|
||||
+ ".ERROR";
|
||||
|
||||
@Override
|
||||
@@ -27,7 +27,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @since 1.1.0
|
||||
* @see DefaulErrorAttributes
|
||||
* @see DefaultErrorAttributes
|
||||
*/
|
||||
public interface ErrorAttributes {
|
||||
|
||||
|
||||
@@ -74,8 +74,8 @@ public class ErrorMvcAutoConfiguration implements EmbeddedServletContainerCustom
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(value = ErrorAttributes.class, search = SearchStrategy.CURRENT)
|
||||
public DefaulErrorAttributes errorAttributes() {
|
||||
return new DefaulErrorAttributes();
|
||||
public DefaultErrorAttributes errorAttributes() {
|
||||
return new DefaultErrorAttributes();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -41,13 +41,13 @@ import static org.hamcrest.Matchers.startsWith;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
/**
|
||||
* Tests for {@link DefaulErrorAttributes}.
|
||||
* Tests for {@link DefaultErrorAttributes}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
public class DefaultErrorAttributesTests {
|
||||
|
||||
private DefaulErrorAttributes errorAttributes = new DefaulErrorAttributes();
|
||||
private DefaultErrorAttributes errorAttributes = new DefaultErrorAttributes();
|
||||
|
||||
private MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user