Add @Override annotations to main sources

Issue: SPR-10130
This commit is contained in:
Chris Beams
2012-12-28 14:00:16 +01:00
parent 9c2046c3ee
commit 3b40ce76bf
1256 changed files with 5716 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ public class MockMvcClientHttpRequestFactory implements ClientHttpRequestFactory
this.mockMvc = mockMvc;
}
@Override
public ClientHttpRequest createRequest(final URI uri, final HttpMethod httpMethod) throws IOException {
return new MockClientHttpRequest(httpMethod, uri) {

View File

@@ -184,6 +184,7 @@ public class MockRestServiceServer {
private Iterator<RequestMatcherClientHttpRequest> requestIterator;
@Override
public ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) throws IOException {
Assert.notNull(uri, "'uri' must not be null");
Assert.notNull(httpMethod, "'httpMethod' must not be null");

View File

@@ -45,17 +45,20 @@ class RequestMatcherClientHttpRequest extends MockClientHttpRequest implements R
this.requestMatchers.add(requestMatcher);
}
@Override
public ResponseActions andExpect(RequestMatcher requestMatcher) {
Assert.notNull(requestMatcher, "RequestMatcher is required");
this.requestMatchers.add(requestMatcher);
return this;
}
@Override
public void andRespond(ResponseCreator responseCreator) {
Assert.notNull(responseCreator, "ResponseCreator is required");
this.responseCreator = responseCreator;
}
@Override
public ClientHttpResponse executeInternal() throws IOException {
if (this.requestMatchers.isEmpty()) {

View File

@@ -64,6 +64,7 @@ public class ContentRequestMatchers {
*/
public RequestMatcher contentType(final MediaType expectedContentType) {
return new RequestMatcher() {
@Override
public void match(ClientHttpRequest request) throws IOException, AssertionError {
MediaType actualContentType = request.getHeaders().getContentType();
assertTrue("Content type not set", actualContentType != null);
@@ -77,6 +78,7 @@ public class ContentRequestMatchers {
*/
public RequestMatcher string(final Matcher<? super String> matcher) {
return new RequestMatcher() {
@Override
public void match(ClientHttpRequest request) throws IOException, AssertionError {
MockClientHttpRequest mockRequest = (MockClientHttpRequest) request;
assertThat("Request content", mockRequest.getBodyAsString(), matcher);
@@ -89,6 +91,7 @@ public class ContentRequestMatchers {
*/
public RequestMatcher string(final String expectedContent) {
return new RequestMatcher() {
@Override
public void match(ClientHttpRequest request) throws IOException, AssertionError {
MockClientHttpRequest mockRequest = (MockClientHttpRequest) request;
assertEquals("Request content", expectedContent, mockRequest.getBodyAsString());
@@ -101,6 +104,7 @@ public class ContentRequestMatchers {
*/
public RequestMatcher bytes(final byte[] expectedContent) {
return new RequestMatcher() {
@Override
public void match(ClientHttpRequest request) throws IOException, AssertionError {
MockClientHttpRequest mockRequest = (MockClientHttpRequest) request;
assertEquals("Request content", expectedContent, mockRequest.getBodyAsBytes());
@@ -157,6 +161,7 @@ public class ContentRequestMatchers {
*/
private abstract static class AbstractXmlRequestMatcher implements RequestMatcher {
@Override
public final void match(ClientHttpRequest request) throws IOException, AssertionError {
try {
MockClientHttpRequest mockRequest = (MockClientHttpRequest) request;

View File

@@ -118,6 +118,7 @@ public class JsonPathRequestMatchers {
*/
private abstract static class AbstractJsonPathRequestMatcher implements RequestMatcher {
@Override
public final void match(ClientHttpRequest request) throws IOException, AssertionError {
try {
MockClientHttpRequest mockRequest = (MockClientHttpRequest) request;

View File

@@ -59,6 +59,7 @@ public abstract class MockRestRequestMatchers {
*/
public static RequestMatcher anything() {
return new RequestMatcher() {
@Override
public void match(ClientHttpRequest request) throws AssertionError {
}
};
@@ -73,6 +74,7 @@ public abstract class MockRestRequestMatchers {
public static RequestMatcher requestTo(final Matcher<String> matcher) {
Assert.notNull(matcher, "'matcher' must not be null");
return new RequestMatcher() {
@Override
public void match(ClientHttpRequest request) throws IOException, AssertionError {
assertThat("Request URI", request.getURI().toString(), matcher);
}
@@ -88,6 +90,7 @@ public abstract class MockRestRequestMatchers {
public static RequestMatcher requestTo(final String expectedUri) {
Assert.notNull(expectedUri, "'uri' must not be null");
return new RequestMatcher() {
@Override
public void match(ClientHttpRequest request) throws IOException, AssertionError {
assertEquals("Request URI", expectedUri, request.getURI().toString());
}
@@ -103,6 +106,7 @@ public abstract class MockRestRequestMatchers {
public static RequestMatcher method(final HttpMethod method) {
Assert.notNull(method, "'method' must not be null");
return new RequestMatcher() {
@Override
public void match(ClientHttpRequest request) throws AssertionError {
AssertionErrors.assertEquals("Unexpected HttpMethod", method, request.getMethod());
}
@@ -118,6 +122,7 @@ public abstract class MockRestRequestMatchers {
public static RequestMatcher requestTo(final URI uri) {
Assert.notNull(uri, "'uri' must not be null");
return new RequestMatcher() {
@Override
public void match(ClientHttpRequest request) throws IOException, AssertionError {
AssertionErrors.assertEquals("Unexpected request", uri, request.getURI());
}
@@ -129,6 +134,7 @@ public abstract class MockRestRequestMatchers {
*/
public static RequestMatcher header(final String name, final Matcher<? super String>... matchers) {
return new RequestMatcher() {
@Override
public void match(ClientHttpRequest request) {
assertHeaderValueCount(name, request.getHeaders(), matchers.length);
for (int i = 0 ; i < matchers.length; i++) {
@@ -143,6 +149,7 @@ public abstract class MockRestRequestMatchers {
*/
public static RequestMatcher header(final String name, final String... expectedValues) {
return new RequestMatcher() {
@Override
public void match(ClientHttpRequest request) {
assertHeaderValueCount(name, request.getHeaders(), expectedValues.length);
for (int i = 0 ; i < expectedValues.length; i++) {

View File

@@ -185,6 +185,7 @@ public class XpathRequestMatchers {
*/
private abstract static class AbstractXpathRequestMatcher implements RequestMatcher {
@Override
public final void match(ClientHttpRequest request) throws IOException, AssertionError {
try {
MockClientHttpRequest mockRequest = (MockClientHttpRequest) request;

View File

@@ -56,6 +56,7 @@ public class DefaultResponseCreator implements ResponseCreator {
this.statusCode = statusCode;
}
@Override
public ClientHttpResponse createResponse(ClientHttpRequest request) throws IOException {
MockClientHttpResponse response;
if (this.contentResource != null ){

View File

@@ -61,14 +61,17 @@ class DefaultMvcResult implements MvcResult {
this.mockResponse = response;
}
@Override
public MockHttpServletResponse getResponse() {
return mockResponse;
}
@Override
public MockHttpServletRequest getRequest() {
return mockRequest;
}
@Override
public Object getHandler() {
return this.handler;
}
@@ -77,6 +80,7 @@ class DefaultMvcResult implements MvcResult {
this.handler = handler;
}
@Override
public HandlerInterceptor[] getInterceptors() {
return this.interceptors;
}
@@ -85,6 +89,7 @@ class DefaultMvcResult implements MvcResult {
this.interceptors = interceptors;
}
@Override
public Exception getResolvedException() {
return this.resolvedException;
}
@@ -93,6 +98,7 @@ class DefaultMvcResult implements MvcResult {
this.resolvedException = resolvedException;
}
@Override
public ModelAndView getModelAndView() {
return this.modelAndView;
}
@@ -101,6 +107,7 @@ class DefaultMvcResult implements MvcResult {
this.modelAndView = mav;
}
@Override
public FlashMap getFlashMap() {
return RequestContextUtils.getOutputFlashMap(mockRequest);
}
@@ -109,10 +116,12 @@ class DefaultMvcResult implements MvcResult {
this.asyncResult = asyncResult;
}
@Override
public Object getAsyncResult() {
return getAsyncResult(-1);
}
@Override
public Object getAsyncResult(long timeout) {
// MockHttpServletRequest type doesn't have async methods
HttpServletRequest request = this.mockRequest;

View File

@@ -137,16 +137,19 @@ public final class MockMvc {
return new ResultActions() {
@Override
public ResultActions andExpect(ResultMatcher matcher) throws Exception {
matcher.match(mvcResult);
return this;
}
@Override
public ResultActions andDo(ResultHandler printer) throws Exception {
printer.handle(mvcResult);
return this;
}
@Override
public MvcResult andReturn() {
return mvcResult;
}

View File

@@ -73,12 +73,14 @@ final class TestDispatcherServlet extends DispatcherServlet {
WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(servletRequest);
asyncManager.registerCallableInterceptor(KEY, new CallableProcessingInterceptorAdapter() {
@Override
public <T> void postProcess(NativeWebRequest request, Callable<T> task, Object value) throws Exception {
getMvcResult(servletRequest).setAsyncResult(value);
asyncResultLatch.countDown();
}
});
asyncManager.registerDeferredResultInterceptor(KEY, new DeferredResultProcessingInterceptorAdapter() {
@Override
public <T> void postProcess(NativeWebRequest request, DeferredResult<T> result, Object value) throws Exception {
getMvcResult(servletRequest).setAsyncResult(value);
asyncResultLatch.countDown();

View File

@@ -58,14 +58,17 @@ class MockAsyncContext implements AsyncContext {
this.response = (HttpServletResponse) response;
}
@Override
public ServletRequest getRequest() {
return this.request;
}
@Override
public ServletResponse getResponse() {
return this.response;
}
@Override
public boolean hasOriginalRequestAndResponse() {
return (this.request instanceof MockHttpServletRequest) && (this.response instanceof MockHttpServletResponse);
}
@@ -74,18 +77,22 @@ class MockAsyncContext implements AsyncContext {
return this.dispatchedPath;
}
@Override
public void dispatch() {
dispatch(this.request.getRequestURI());
}
@Override
public void dispatch(String path) {
dispatch(null, path);
}
@Override
public void dispatch(ServletContext context, String path) {
this.dispatchedPath = path;
}
@Override
public void complete() {
Servlet3MockHttpServletRequest mockRequest = WebUtils.getNativeRequest(request, Servlet3MockHttpServletRequest.class);
if (mockRequest != null) {
@@ -101,6 +108,7 @@ class MockAsyncContext implements AsyncContext {
}
}
@Override
public void start(Runnable runnable) {
runnable.run();
}
@@ -109,22 +117,27 @@ class MockAsyncContext implements AsyncContext {
return this.listeners;
}
@Override
public void addListener(AsyncListener listener) {
this.listeners.add(listener);
}
@Override
public void addListener(AsyncListener listener, ServletRequest request, ServletResponse response) {
this.listeners.add(listener);
}
@Override
public <T extends AsyncListener> T createListener(Class<T> clazz) throws ServletException {
return BeanUtils.instantiateClass(clazz);
}
@Override
public long getTimeout() {
return this.timeout;
}
@Override
public void setTimeout(long timeout) {
this.timeout = timeout;
}

View File

@@ -432,6 +432,7 @@ public class MockHttpServletRequestBuilder implements RequestBuilder, Mergeable
* {@inheritDoc}
* @return always returns {@code true}.
*/
@Override
public boolean isMergeEnabled() {
return true;
}
@@ -443,6 +444,7 @@ public class MockHttpServletRequestBuilder implements RequestBuilder, Mergeable
* @param parent the parent {@code RequestBuilder} to inherit properties from
* @return the result of the merge
*/
@Override
public Object merge(Object parent) {
if (parent == null) {
return this;
@@ -546,6 +548,7 @@ public class MockHttpServletRequestBuilder implements RequestBuilder, Mergeable
/**
* Build a {@link MockHttpServletRequest}.
*/
@Override
public final MockHttpServletRequest buildRequest(ServletContext servletContext) {
MockHttpServletRequest request = createServletRequest(servletContext);

View File

@@ -124,6 +124,7 @@ public abstract class MockMvcRequestBuilders {
*/
public static RequestBuilder asyncDispatch(final MvcResult mvcResult) {
return new RequestBuilder() {
@Override
public MockHttpServletRequest buildRequest(ServletContext servletContext) {
MockHttpServletRequest request = mvcResult.getRequest();
Method method = ReflectionUtils.findMethod(request.getClass(), "setAsyncStarted", boolean.class);

View File

@@ -50,20 +50,24 @@ class Servlet3MockHttpServletRequest extends MockHttpServletRequest {
super(servletContext);
}
@Override
public boolean isAsyncSupported() {
return true;
}
@Override
public AsyncContext startAsync() {
return startAsync(this, null);
}
@Override
public AsyncContext startAsync(ServletRequest request, ServletResponse response) {
this.asyncStarted = true;
this.asyncContext = new MockAsyncContext(request, response);
return this.asyncContext;
}
@Override
public AsyncContext getAsyncContext() {
return this.asyncContext;
}
@@ -72,10 +76,12 @@ class Servlet3MockHttpServletRequest extends MockHttpServletRequest {
this.asyncContext = asyncContext;
}
@Override
public DispatcherType getDispatcherType() {
return DispatcherType.REQUEST;
}
@Override
public boolean isAsyncStarted() {
return this.asyncStarted;
}
@@ -88,14 +94,17 @@ class Servlet3MockHttpServletRequest extends MockHttpServletRequest {
this.parts.put(part.getName(), part);
}
@Override
public Part getPart(String key) throws IOException, IllegalStateException, ServletException {
return this.parts.get(key);
}
@Override
public Collection<Part> getParts() throws IOException, IllegalStateException, ServletException {
return this.parts.values();
}
@Override
public boolean authenticate(HttpServletResponse response) throws IOException, ServletException {
throw new UnsupportedOperationException();
}

View File

@@ -45,20 +45,24 @@ class Servlet3MockMultipartHttpServletRequest extends MockMultipartHttpServletRe
private Map<String, Part> parts = new HashMap<String, Part>();
@Override
public boolean isAsyncSupported() {
return true;
}
@Override
public AsyncContext startAsync() {
return startAsync(this, null);
}
@Override
public AsyncContext startAsync(ServletRequest request, ServletResponse response) {
this.asyncStarted = true;
this.asyncContext = new MockAsyncContext(request, response);
return this.asyncContext;
}
@Override
public AsyncContext getAsyncContext() {
return this.asyncContext;
}
@@ -67,10 +71,12 @@ class Servlet3MockMultipartHttpServletRequest extends MockMultipartHttpServletRe
this.asyncContext = asyncContext;
}
@Override
public DispatcherType getDispatcherType() {
return DispatcherType.REQUEST;
}
@Override
public boolean isAsyncStarted() {
return this.asyncStarted;
}
@@ -83,14 +89,17 @@ class Servlet3MockMultipartHttpServletRequest extends MockMultipartHttpServletRe
this.parts.put(part.getName(), part);
}
@Override
public Part getPart(String key) throws IOException, IllegalStateException, ServletException {
return this.parts.get(key);
}
@Override
public Collection<Part> getParts() throws IOException, IllegalStateException, ServletException {
return this.parts.values();
}
@Override
public boolean authenticate(HttpServletResponse response) throws IOException, ServletException {
throw new UnsupportedOperationException();
}

View File

@@ -65,6 +65,7 @@ public class ContentResultMatchers {
*/
public ResultMatcher contentType(final MediaType contentType) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
String actual = result.getResponse().getContentType();
assertTrue("Content type not set", actual != null);
@@ -79,6 +80,7 @@ public class ContentResultMatchers {
*/
public ResultMatcher encoding(final String characterEncoding) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) {
String actual = result.getResponse().getCharacterEncoding();
assertEquals("Character encoding", characterEncoding, actual);
@@ -95,6 +97,7 @@ public class ContentResultMatchers {
*/
public ResultMatcher string(final Matcher<? super String> matcher) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
assertThat("Response content", result.getResponse().getContentAsString(), matcher);
}
@@ -106,6 +109,7 @@ public class ContentResultMatchers {
*/
public ResultMatcher string(final String expectedContent) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
assertEquals("Response content", expectedContent, result.getResponse().getContentAsString());
}
@@ -117,6 +121,7 @@ public class ContentResultMatchers {
*/
public ResultMatcher bytes(final byte[] expectedContent) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
assertEquals("Response content", expectedContent, result.getResponse().getContentAsByteArray());
}
@@ -137,6 +142,7 @@ public class ContentResultMatchers {
*/
public ResultMatcher xml(final String xmlContent) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
String content = result.getResponse().getContentAsString();
xmlHelper.assertXmlEqual(xmlContent, content);
@@ -150,6 +156,7 @@ public class ContentResultMatchers {
*/
public ResultMatcher node(final Matcher<? super Node> matcher) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
String content = result.getResponse().getContentAsString();
xmlHelper.assertNode(content, matcher);
@@ -165,6 +172,7 @@ public class ContentResultMatchers {
*/
public ResultMatcher source(final Matcher<? super Source> matcher) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
String content = result.getResponse().getContentAsString();
xmlHelper.assertSource(content, matcher);

View File

@@ -49,6 +49,7 @@ public class CookieResultMatchers {
*/
public ResultMatcher value(final String name, final Matcher<? super String> matcher) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) {
Cookie cookie = result.getResponse().getCookie(name);
assertTrue("Response cookie not found: " + name, cookie != null);
@@ -62,6 +63,7 @@ public class CookieResultMatchers {
*/
public ResultMatcher value(final String name, final String expectedValue) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) {
Cookie cookie = result.getResponse().getCookie(name);
assertTrue("Response cookie not found: " + name, cookie != null);
@@ -76,6 +78,7 @@ public class CookieResultMatchers {
*/
public ResultMatcher exists(final String name) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) {
Cookie cookie = result.getResponse().getCookie(name);
assertTrue("No cookie with name: " + name, cookie != null);
@@ -89,6 +92,7 @@ public class CookieResultMatchers {
*/
public ResultMatcher doesNotExist(final String name) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) {
Cookie cookie = result.getResponse().getCookie(name);
assertTrue("Unexpected cookie with name " + name, cookie == null);
@@ -101,6 +105,7 @@ public class CookieResultMatchers {
*/
public ResultMatcher maxAge(final String name, final Matcher<? super Integer> matcher) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) {
Cookie cookie = result.getResponse().getCookie(name);
assertTrue("No cookie with name: " + name, cookie != null);
@@ -114,6 +119,7 @@ public class CookieResultMatchers {
*/
public ResultMatcher maxAge(final String name, final int maxAge) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) {
Cookie cookie = result.getResponse().getCookie(name);
assertTrue("No cookie with name: " + name, cookie != null);
@@ -127,6 +133,7 @@ public class CookieResultMatchers {
*/
public ResultMatcher path(final String name, final Matcher<? super String> matcher) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
Cookie cookie = result.getResponse().getCookie(name);
assertThat("Response cookie path", cookie.getPath(), matcher);
@@ -136,6 +143,7 @@ public class CookieResultMatchers {
public ResultMatcher path(final String name, final String path) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
Cookie cookie = result.getResponse().getCookie(name);
assertEquals("Response cookie path", path, cookie.getPath());
@@ -148,6 +156,7 @@ public class CookieResultMatchers {
*/
public ResultMatcher domain(final String name, final Matcher<? super String> matcher) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
Cookie cookie = result.getResponse().getCookie(name);
assertThat("Response cookie domain", cookie.getDomain(), matcher);
@@ -160,6 +169,7 @@ public class CookieResultMatchers {
*/
public ResultMatcher domain(final String name, final String domain) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
Cookie cookie = result.getResponse().getCookie(name);
assertEquals("Response cookie domain", domain, cookie.getDomain());
@@ -172,6 +182,7 @@ public class CookieResultMatchers {
*/
public ResultMatcher comment(final String name, final Matcher<? super String> matcher) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
Cookie cookie = result.getResponse().getCookie(name);
assertThat("Response cookie comment", cookie.getComment(), matcher);
@@ -184,6 +195,7 @@ public class CookieResultMatchers {
*/
public ResultMatcher comment(final String name, final String comment) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
Cookie cookie = result.getResponse().getCookie(name);
assertEquals("Response cookie comment", comment, cookie.getComment());
@@ -196,6 +208,7 @@ public class CookieResultMatchers {
*/
public ResultMatcher version(final String name, final Matcher<? super Integer> matcher) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
Cookie cookie = result.getResponse().getCookie(name);
assertThat("Response cookie version", cookie.getVersion(), matcher);
@@ -208,6 +221,7 @@ public class CookieResultMatchers {
*/
public ResultMatcher version(final String name, final int version) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
Cookie cookie = result.getResponse().getCookie(name);
assertEquals("Response cookie version", version, cookie.getVersion());
@@ -220,6 +234,7 @@ public class CookieResultMatchers {
*/
public ResultMatcher secure(final String name, final boolean secure) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
Cookie cookie = result.getResponse().getCookie(name);
assertEquals("Response cookie secure", secure, cookie.getSecure());

View File

@@ -45,6 +45,7 @@ public class FlashAttributeResultMatchers {
*/
public <T> ResultMatcher attribute(final String name, final Matcher<T> matcher) {
return new ResultMatcher() {
@Override
@SuppressWarnings("unchecked")
public void match(MvcResult result) throws Exception {
assertThat("Flash attribute", (T) result.getFlashMap().get(name), matcher);
@@ -57,6 +58,7 @@ public class FlashAttributeResultMatchers {
*/
public <T> ResultMatcher attribute(final String name, final Object value) {
return new ResultMatcher() {
@Override
@SuppressWarnings("unchecked")
public void match(MvcResult result) throws Exception {
assertEquals("Flash attribute", value, result.getFlashMap().get(name));
@@ -69,6 +71,7 @@ public class FlashAttributeResultMatchers {
*/
public <T> ResultMatcher attributeExists(final String... names) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
for (String name : names) {
assertTrue("Flash attribute [" + name + "] does not exist", result.getFlashMap().get(name) != null);
@@ -82,6 +85,7 @@ public class FlashAttributeResultMatchers {
*/
public <T> ResultMatcher attributeCount(final int count) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
assertEquals("FlashMap size", count, result.getFlashMap().size());
}

View File

@@ -52,6 +52,7 @@ public class HandlerResultMatchers {
*/
public ResultMatcher handlerType(final Class<?> type) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
Object handler = result.getHandler();
assertTrue("No handler: ", handler != null);
@@ -73,6 +74,7 @@ public class HandlerResultMatchers {
*/
public ResultMatcher methodName(final Matcher<? super String> matcher) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
Object handler = assertHandlerMethod(result);
assertThat("HandlerMethod", ((HandlerMethod) handler).getMethod().getName(), matcher);
@@ -88,6 +90,7 @@ public class HandlerResultMatchers {
*/
public ResultMatcher methodName(final String name) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
Object handler = assertHandlerMethod(result);
assertEquals("HandlerMethod", name, ((HandlerMethod) handler).getMethod().getName());
@@ -103,6 +106,7 @@ public class HandlerResultMatchers {
*/
public ResultMatcher method(final Method method) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
Object handler = assertHandlerMethod(result);
assertEquals("HandlerMethod", method, ((HandlerMethod) handler).getMethod());

View File

@@ -45,6 +45,7 @@ public class HeaderResultMatchers {
*/
public ResultMatcher string(final String name, final Matcher<? super String> matcher) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) {
assertThat("Response header", result.getResponse().getHeader(name), matcher);
}
@@ -56,6 +57,7 @@ public class HeaderResultMatchers {
*/
public ResultMatcher string(final String name, final String value) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) {
assertEquals("Response header", value, result.getResponse().getHeader(name));
}
@@ -67,6 +69,7 @@ public class HeaderResultMatchers {
*/
public ResultMatcher longValue(final String name, final long value) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) {
assertEquals("Response header " + name, value, Long.parseLong(result.getResponse().getHeader(name)));
}

View File

@@ -49,6 +49,7 @@ public class JsonPathResultMatchers {
*/
public <T> ResultMatcher value(final Matcher<T> matcher) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
String content = result.getResponse().getContentAsString();
jsonPathHelper.assertValue(content, matcher);
@@ -61,6 +62,7 @@ public class JsonPathResultMatchers {
*/
public ResultMatcher value(final Object expectedValue) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
jsonPathHelper.assertValue(result.getResponse().getContentAsString(), expectedValue);
}
@@ -72,6 +74,7 @@ public class JsonPathResultMatchers {
*/
public ResultMatcher exists() {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
String content = result.getResponse().getContentAsString();
jsonPathHelper.exists(content);
@@ -84,6 +87,7 @@ public class JsonPathResultMatchers {
*/
public ResultMatcher doesNotExist() {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
String content = result.getResponse().getContentAsString();
jsonPathHelper.doesNotExist(content);
@@ -96,6 +100,7 @@ public class JsonPathResultMatchers {
*/
public ResultMatcher isArray() {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
String content = result.getResponse().getContentAsString();
jsonPathHelper.assertValueIsArray(content);

View File

@@ -49,11 +49,13 @@ public abstract class MockMvcResultHandlers {
public ConsolePrintingResultHandler() {
super(new ResultValuePrinter() {
@Override
public void printHeading(String heading) {
System.out.println();
System.out.println(String.format("%20s:", heading));
}
@Override
public void printValue(String label, Object value) {
if (value != null && value.getClass().isArray()) {
value = CollectionUtils.arrayToList(value);

View File

@@ -81,6 +81,7 @@ public abstract class MockMvcResultMatchers {
*/
public static ResultMatcher forwardedUrl(final String expectedUrl) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) {
assertEquals("Forwarded URL", expectedUrl, result.getResponse().getForwardedUrl());
}
@@ -92,6 +93,7 @@ public abstract class MockMvcResultMatchers {
*/
public static ResultMatcher redirectedUrl(final String expectedUrl) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) {
assertEquals("Redirected URL", expectedUrl, result.getResponse().getRedirectedUrl());
}

View File

@@ -50,6 +50,7 @@ public class ModelResultMatchers {
*/
public <T> ResultMatcher attribute(final String name, final Matcher<T> matcher) {
return new ResultMatcher() {
@Override
@SuppressWarnings("unchecked")
public void match(MvcResult result) throws Exception {
ModelAndView mav = getModelAndView(result);
@@ -63,6 +64,7 @@ public class ModelResultMatchers {
*/
public ResultMatcher attribute(final String name, final Object value) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
ModelAndView mav = getModelAndView(result);
assertEquals("Model attribute '" + name + "'", value, mav.getModel().get(name));
@@ -75,6 +77,7 @@ public class ModelResultMatchers {
*/
public ResultMatcher attributeExists(final String... names) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
ModelAndView mav = getModelAndView(result);
for (String name : names) {
@@ -89,6 +92,7 @@ public class ModelResultMatchers {
*/
public ResultMatcher attributeErrorCount(final String name, final int expectedCount) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
ModelAndView mav = getModelAndView(result);
Errors errors = getBindingResult(mav, name);
@@ -103,6 +107,7 @@ public class ModelResultMatchers {
*/
public ResultMatcher attributeHasErrors(final String... names) {
return new ResultMatcher() {
@Override
public void match(MvcResult mvcResult) throws Exception {
ModelAndView mav = getModelAndView(mvcResult);
for (String name : names) {
@@ -118,6 +123,7 @@ public class ModelResultMatchers {
*/
public ResultMatcher attributeHasNoErrors(final String... names) {
return new ResultMatcher() {
@Override
public void match(MvcResult mvcResult) throws Exception {
ModelAndView mav = getModelAndView(mvcResult);
for (String name : names) {
@@ -133,6 +139,7 @@ public class ModelResultMatchers {
*/
public ResultMatcher attributeHasFieldErrors(final String name, final String... fieldNames) {
return new ResultMatcher() {
@Override
public void match(MvcResult mvcResult) throws Exception {
ModelAndView mav = getModelAndView(mvcResult);
BindingResult result = getBindingResult(mav, name);
@@ -150,6 +157,7 @@ public class ModelResultMatchers {
*/
public <T> ResultMatcher errorCount(final int expectedCount) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
int actualCount = getErrorCount(getModelAndView(result).getModelMap());
assertEquals("Binding/validation error count", expectedCount, actualCount);
@@ -162,6 +170,7 @@ public class ModelResultMatchers {
*/
public <T> ResultMatcher hasErrors() {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
int count = getErrorCount(getModelAndView(result).getModelMap());
assertTrue("Expected binding/validation errors", count != 0);
@@ -174,6 +183,7 @@ public class ModelResultMatchers {
*/
public <T> ResultMatcher hasNoErrors() {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
ModelAndView mav = getModelAndView(result);
for (Object value : mav.getModel().values()) {
@@ -191,6 +201,7 @@ public class ModelResultMatchers {
*/
public <T> ResultMatcher size(final int size) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
ModelAndView mav = getModelAndView(result);
int actual = 0;

View File

@@ -71,6 +71,7 @@ public class PrintingResultHandler implements ResultHandler {
/**
* Print {@link MvcResult} details to the "standard" output stream.
*/
@Override
public final void handle(MvcResult result) throws Exception {
this.printer.printHeading("MockHttpServletRequest");

View File

@@ -59,6 +59,7 @@ public class RequestResultMatchers {
*/
public ResultMatcher asyncStarted() {
return new ResultMatcher() {
@Override
public void match(MvcResult result) {
HttpServletRequest request = result.getRequest();
assertEquals("Async started", true, request.isAsyncStarted());
@@ -72,6 +73,7 @@ public class RequestResultMatchers {
*/
public ResultMatcher asyncNotStarted() {
return new ResultMatcher() {
@Override
public void match(MvcResult result) {
HttpServletRequest request = result.getRequest();
assertEquals("Async started", false, request.isAsyncStarted());
@@ -84,6 +86,7 @@ public class RequestResultMatchers {
*/
public <T> ResultMatcher asyncResult(final Matcher<T> matcher) {
return new ResultMatcher() {
@Override
@SuppressWarnings("unchecked")
public void match(MvcResult result) {
HttpServletRequest request = result.getRequest();
@@ -101,6 +104,7 @@ public class RequestResultMatchers {
*/
public <T> ResultMatcher asyncResult(final Object expectedResult) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) {
HttpServletRequest request = result.getRequest();
assertEquals("Async started", true, request.isAsyncStarted());
@@ -114,6 +118,7 @@ public class RequestResultMatchers {
*/
public <T> ResultMatcher attribute(final String name, final Matcher<T> matcher) {
return new ResultMatcher() {
@Override
@SuppressWarnings("unchecked")
public void match(MvcResult result) {
T value = (T) result.getRequest().getAttribute(name);
@@ -127,6 +132,7 @@ public class RequestResultMatchers {
*/
public <T> ResultMatcher attribute(final String name, final Object expectedValue) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) {
assertEquals("Request attribute", expectedValue, result.getRequest().getAttribute(name));
}
@@ -138,6 +144,7 @@ public class RequestResultMatchers {
*/
public <T> ResultMatcher sessionAttribute(final String name, final Matcher<T> matcher) {
return new ResultMatcher() {
@Override
@SuppressWarnings("unchecked")
public void match(MvcResult result) {
T value = (T) result.getRequest().getSession().getAttribute(name);
@@ -151,6 +158,7 @@ public class RequestResultMatchers {
*/
public <T> ResultMatcher sessionAttribute(final String name, final Object value) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) {
assertEquals("Request attribute", value, result.getRequest().getSession().getAttribute(name));
}

View File

@@ -46,6 +46,7 @@ public class StatusResultMatchers {
*/
public ResultMatcher is(final Matcher<Integer> matcher) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
assertThat("Response status", result.getResponse().getStatus(), matcher);
}
@@ -57,6 +58,7 @@ public class StatusResultMatchers {
*/
public ResultMatcher is(final int status) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
assertEquals("Response status", status, result.getResponse().getStatus());
}
@@ -69,6 +71,7 @@ public class StatusResultMatchers {
*/
public ResultMatcher reason(final Matcher<? super String> matcher) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
assertThat("Response status reason", result.getResponse().getErrorMessage(), matcher);
}
@@ -80,6 +83,7 @@ public class StatusResultMatchers {
*/
public ResultMatcher reason(final String reason) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
assertEquals("Response status reason", reason, result.getResponse().getErrorMessage());
}
@@ -545,6 +549,7 @@ public class StatusResultMatchers {
*/
private ResultMatcher matcher(final HttpStatus status) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) {
assertEquals("Status", status.value(), result.getResponse().getStatus());
}

View File

@@ -44,6 +44,7 @@ public class ViewResultMatchers {
*/
public ResultMatcher name(final Matcher<? super String> matcher) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
ModelAndView mav = result.getModelAndView();
assertTrue("No ModelAndView found", mav != null);
@@ -57,6 +58,7 @@ public class ViewResultMatchers {
*/
public ResultMatcher name(final String expectedViewName) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
ModelAndView mav = result.getModelAndView();
assertTrue("No ModelAndView found", mav != null);

View File

@@ -63,6 +63,7 @@ public class XpathResultMatchers {
*/
public ResultMatcher node(final Matcher<? super Node> matcher) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
String content = result.getResponse().getContentAsString();
xpathHelper.assertNode(content, matcher);
@@ -75,6 +76,7 @@ public class XpathResultMatchers {
*/
public ResultMatcher exists() {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
String content = result.getResponse().getContentAsString();
xpathHelper.exists(content);
@@ -87,6 +89,7 @@ public class XpathResultMatchers {
*/
public ResultMatcher doesNotExist() {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
String content = result.getResponse().getContentAsString();
xpathHelper.doesNotExist(content);
@@ -100,6 +103,7 @@ public class XpathResultMatchers {
*/
public ResultMatcher nodeCount(final Matcher<Integer> matcher) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
String content = result.getResponse().getContentAsString();
xpathHelper.assertNodeCount(content, matcher);
@@ -112,6 +116,7 @@ public class XpathResultMatchers {
*/
public ResultMatcher nodeCount(final int expectedCount) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
String content = result.getResponse().getContentAsString();
xpathHelper.assertNodeCount(content, expectedCount);
@@ -125,6 +130,7 @@ public class XpathResultMatchers {
*/
public ResultMatcher string(final Matcher<? super String> matcher) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
String content = result.getResponse().getContentAsString();
xpathHelper.assertString(content, matcher);
@@ -137,6 +143,7 @@ public class XpathResultMatchers {
*/
public ResultMatcher string(final String expectedValue) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
String content = result.getResponse().getContentAsString();
xpathHelper.assertString(content, expectedValue);
@@ -150,6 +157,7 @@ public class XpathResultMatchers {
*/
public ResultMatcher number(final Matcher<? super Double> matcher) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
String content = result.getResponse().getContentAsString();
xpathHelper.assertNumber(content, matcher);
@@ -162,6 +170,7 @@ public class XpathResultMatchers {
*/
public ResultMatcher number(final Double expectedValue) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
String content = result.getResponse().getContentAsString();
xpathHelper.assertNumber(content, expectedValue);
@@ -174,6 +183,7 @@ public class XpathResultMatchers {
*/
public ResultMatcher booleanValue(final Boolean value) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
String content = result.getResponse().getContentAsString();
xpathHelper.assertBoolean(content, value);

View File

@@ -181,6 +181,7 @@ public class DefaultMockMvcBuilder<Self extends MockMvcBuilder> extends MockMvcB
/**
* Build a {@link MockMvc} instance.
*/
@Override
public final MockMvc build() {
initWebAppContext(this.webAppContext);

View File

@@ -84,6 +84,7 @@ final class PatternMappingFilterProxy implements Filter {
}
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)
throws IOException, ServletException {
@@ -119,10 +120,12 @@ final class PatternMappingFilterProxy implements Filter {
return false;
}
@Override
public void init(FilterConfig filterConfig) throws ServletException {
this.delegate.init(filterConfig);
}
@Override
public void destroy() {
this.delegate.destroy();
}

View File

@@ -267,6 +267,7 @@ public class StandaloneMockMvcBuilder extends DefaultMockMvcBuilder<StandaloneMo
return this;
}
@Override
protected void initWebAppContext(WebApplicationContext cxt) {
StubWebApplicationContext mockCxt = (StubWebApplicationContext) cxt;
registerMvcSingletons(mockCxt);
@@ -412,6 +413,7 @@ public class StandaloneMockMvcBuilder extends DefaultMockMvcBuilder<StandaloneMo
this.view = view;
}
@Override
public View resolveViewName(String viewName, Locale locale) throws Exception {
return this.view;
}

View File

@@ -89,10 +89,12 @@ class StubWebApplicationContext implements WebApplicationContext {
/**
* Returns an instance that can initialize {@link ApplicationContextAware} beans.
*/
@Override
public AutowireCapableBeanFactory getAutowireCapableBeanFactory() throws IllegalStateException {
return this.beanFactory;
}
@Override
public ServletContext getServletContext() {
return this.servletContext;
}
@@ -101,26 +103,32 @@ class StubWebApplicationContext implements WebApplicationContext {
// Implementation of ApplicationContext interface
//---------------------------------------------------------------------
@Override
public String getId() {
return this.id;
}
@Override
public String getApplicationName() {
return "";
}
@Override
public String getDisplayName() {
return this.displayName;
}
@Override
public long getStartupDate() {
return this.startupDate;
}
@Override
public ApplicationContext getParent() {
return null;
}
@Override
public Environment getEnvironment() {
return this.environment ;
}
@@ -140,42 +148,52 @@ class StubWebApplicationContext implements WebApplicationContext {
// Implementation of BeanFactory interface
//---------------------------------------------------------------------
@Override
public Object getBean(String name) throws BeansException {
return this.beanFactory.getBean(name);
}
@Override
public <T> T getBean(String name, Class<T> requiredType) throws BeansException {
return this.beanFactory.getBean(name, requiredType);
}
@Override
public <T> T getBean(Class<T> requiredType) throws BeansException {
return this.beanFactory.getBean(requiredType);
}
@Override
public Object getBean(String name, Object... args) throws BeansException {
return this.beanFactory.getBean(name, args);
}
@Override
public boolean containsBean(String name) {
return this.beanFactory.containsBean(name);
}
@Override
public boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
return this.beanFactory.isSingleton(name);
}
@Override
public boolean isPrototype(String name) throws NoSuchBeanDefinitionException {
return this.beanFactory.isPrototype(name);
}
@Override
public boolean isTypeMatch(String name, Class<?> targetType) throws NoSuchBeanDefinitionException {
return this.beanFactory.isTypeMatch(name, targetType);
}
@Override
public Class<?> getType(String name) throws NoSuchBeanDefinitionException {
return this.beanFactory.getType(name);
}
@Override
public String[] getAliases(String name) {
return this.beanFactory.getAliases(name);
}
@@ -184,42 +202,51 @@ class StubWebApplicationContext implements WebApplicationContext {
// Implementation of ListableBeanFactory interface
//---------------------------------------------------------------------
@Override
public boolean containsBeanDefinition(String beanName) {
return this.beanFactory.containsBeanDefinition(beanName);
}
@Override
public int getBeanDefinitionCount() {
return this.beanFactory.getBeanDefinitionCount();
}
@Override
public String[] getBeanDefinitionNames() {
return this.beanFactory.getBeanDefinitionNames();
}
@Override
public String[] getBeanNamesForType(Class<?> type) {
return this.beanFactory.getBeanNamesForType(type);
}
@Override
public String[] getBeanNamesForType(Class<?> type, boolean includeNonSingletons, boolean allowEagerInit) {
return this.beanFactory.getBeanNamesForType(type, includeNonSingletons, allowEagerInit);
}
@Override
public <T> Map<String, T> getBeansOfType(Class<T> type) throws BeansException {
return this.beanFactory.getBeansOfType(type);
}
@Override
public <T> Map<String, T> getBeansOfType(Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)
throws BeansException {
return this.beanFactory.getBeansOfType(type, includeNonSingletons, allowEagerInit);
}
@Override
public Map<String, Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType)
throws BeansException {
return this.beanFactory.getBeansWithAnnotation(annotationType);
}
@Override
public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType) {
return this.beanFactory.findAnnotationOnBean(beanName, annotationType);
}
@@ -228,10 +255,12 @@ class StubWebApplicationContext implements WebApplicationContext {
// Implementation of HierarchicalBeanFactory interface
//---------------------------------------------------------------------
@Override
public BeanFactory getParentBeanFactory() {
return null;
}
@Override
public boolean containsLocalBean(String name) {
return this.beanFactory.containsBean(name);
}
@@ -240,14 +269,17 @@ class StubWebApplicationContext implements WebApplicationContext {
// Implementation of MessageSource interface
//---------------------------------------------------------------------
@Override
public String getMessage(String code, Object args[], String defaultMessage, Locale locale) {
return this.messageSource.getMessage(code, args, defaultMessage, locale);
}
@Override
public String getMessage(String code, Object args[], Locale locale) throws NoSuchMessageException {
return this.messageSource.getMessage(code, args, locale);
}
@Override
public String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException {
return this.messageSource.getMessage(resolvable, locale);
}
@@ -256,10 +288,12 @@ class StubWebApplicationContext implements WebApplicationContext {
// Implementation of ResourceLoader interface
//---------------------------------------------------------------------
@Override
public ClassLoader getClassLoader() {
return null;
}
@Override
public Resource getResource(String location) {
return this.resourcePatternResolver.getResource(location);
}
@@ -268,9 +302,11 @@ class StubWebApplicationContext implements WebApplicationContext {
// Other
//---------------------------------------------------------------------
@Override
public void publishEvent(ApplicationEvent event) {
}
@Override
public Resource[] getResources(String locationPattern) throws IOException {
return this.resourcePatternResolver.getResources(locationPattern);
}
@@ -283,6 +319,7 @@ class StubWebApplicationContext implements WebApplicationContext {
*/
private class StubBeanFactory extends StaticListableBeanFactory implements AutowireCapableBeanFactory {
@Override
public Object initializeBean(Object existingBean, String beanName) throws BeansException {
if (existingBean instanceof ApplicationContextAware) {
((ApplicationContextAware) existingBean).setApplicationContext(StubWebApplicationContext.this);
@@ -290,50 +327,61 @@ class StubWebApplicationContext implements WebApplicationContext {
return existingBean;
}
@Override
public <T> T createBean(Class<T> beanClass) throws BeansException {
throw new UnsupportedOperationException("Bean creation is not supported");
}
@Override
@SuppressWarnings("rawtypes")
public Object createBean(Class beanClass, int autowireMode, boolean dependencyCheck) throws BeansException {
throw new UnsupportedOperationException("Bean creation is not supported");
}
@Override
@SuppressWarnings("rawtypes")
public Object autowire(Class beanClass, int autowireMode, boolean dependencyCheck) throws BeansException {
return null;
}
@Override
public void autowireBean(Object existingBean) throws BeansException {
throw new UnsupportedOperationException("Autowiring is not supported");
}
@Override
public void autowireBeanProperties(Object existingBean, int autowireMode, boolean dependencyCheck) throws BeansException {
throw new UnsupportedOperationException("Autowiring is not supported");
}
@Override
public Object configureBean(Object existingBean, String beanName) throws BeansException {
throw new UnsupportedOperationException("Configuring a bean is not supported");
}
@Override
public Object resolveDependency(DependencyDescriptor descriptor, String beanName) throws BeansException {
throw new UnsupportedOperationException("Dependency resolution is not supported");
}
@Override
public Object resolveDependency(DependencyDescriptor descriptor, String beanName, Set<String> autowiredBeanNames,
TypeConverter typeConverter) throws BeansException {
throw new UnsupportedOperationException("Dependency resolution is not supported");
}
@Override
public void applyBeanPropertyValues(Object existingBean, String beanName) throws BeansException {
throw new UnsupportedOperationException("Bean property initialization is not supported");
}
@Override
public Object applyBeanPostProcessorsBeforeInitialization(Object existingBean, String beanName)
throws BeansException {
throw new UnsupportedOperationException("Post processing is not supported");
}
@Override
public Object applyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName)
throws BeansException {
throw new UnsupportedOperationException("Post processing is not supported");