Add HttpRequest.getMethodValue
This commit introduces a new method in HttpRequest: `String getMethodValue`, which returns the HTTP method as a String. Furthermore, HttpRequest.getMethod() has been given a default implementation using this String value in combination with `HttpMethod.resolve`. Issue: SPR-15545
This commit is contained in:
		
							parent
							
								
									31d1e26c95
								
							
						
					
					
						commit
						630fc194f0
					
				|  | @ -1,5 +1,5 @@ | ||||||
| /* | /* | ||||||
|  * Copyright 2002-2016 the original author or authors. |  * Copyright 2002-2017 the original author or authors. | ||||||
|  * |  * | ||||||
|  * Licensed under the Apache License, Version 2.0 (the "License"); |  * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  * you may not use this file except in compliance with the License. |  * you may not use this file except in compliance with the License. | ||||||
|  | @ -66,6 +66,11 @@ public class MockClientHttpRequest extends MockHttpOutputMessage implements Clie | ||||||
| 		return this.httpMethod; | 		return this.httpMethod; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	@Override | ||||||
|  | 	public String getMethodValue() { | ||||||
|  | 		return this.httpMethod.name(); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	public void setURI(URI uri) { | 	public void setURI(URI uri) { | ||||||
| 		this.uri = uri; | 		this.uri = uri; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | @ -83,6 +83,11 @@ public class MockServerHttpRequest extends AbstractServerHttpRequest { | ||||||
| 		return this.httpMethod; | 		return this.httpMethod; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	@Override | ||||||
|  | 	public String getMethodValue() { | ||||||
|  | 		return this.httpMethod.name(); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public String getContextPath() { | 	public String getContextPath() { | ||||||
| 		return this.contextPath; | 		return this.contextPath; | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| /* | /* | ||||||
|  * Copyright 2002-2015 the original author or authors. |  * Copyright 2002-2017 the original author or authors. | ||||||
|  * |  * | ||||||
|  * Licensed under the Apache License, Version 2.0 (the "License"); |  * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  * you may not use this file except in compliance with the License. |  * you may not use this file except in compliance with the License. | ||||||
|  | @ -32,7 +32,15 @@ public interface HttpRequest extends HttpMessage { | ||||||
| 	 * @return the HTTP method as an HttpMethod enum value, or {@code null} | 	 * @return the HTTP method as an HttpMethod enum value, or {@code null} | ||||||
| 	 * if not resolvable (e.g. in case of a non-standard HTTP method) | 	 * if not resolvable (e.g. in case of a non-standard HTTP method) | ||||||
| 	 */ | 	 */ | ||||||
| 	HttpMethod getMethod(); | 	default HttpMethod getMethod() { | ||||||
|  | 		return HttpMethod.resolve(getMethodValue()); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	/** | ||||||
|  | 	 * Return the HTTP method of the request as a String | ||||||
|  | 	 * @return the HTTP method as a String | ||||||
|  | 	 */ | ||||||
|  | 	String getMethodValue(); | ||||||
| 
 | 
 | ||||||
| 	/** | 	/** | ||||||
| 	 * Return the URI of the request. | 	 * Return the URI of the request. | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| /* | /* | ||||||
|  * Copyright 2002-2015 the original author or authors. |  * Copyright 2002-2017 the original author or authors. | ||||||
|  * |  * | ||||||
|  * Licensed under the Apache License, Version 2.0 (the "License"); |  * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  * you may not use this file except in compliance with the License. |  * you may not use this file except in compliance with the License. | ||||||
|  | @ -44,6 +44,11 @@ final class BufferingClientHttpRequestWrapper extends AbstractBufferingClientHtt | ||||||
| 		return this.request.getMethod(); | 		return this.request.getMethod(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	@Override | ||||||
|  | 	public String getMethodValue() { | ||||||
|  | 		return this.request.getMethodValue(); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public URI getURI() { | 	public URI getURI() { | ||||||
| 		return this.request.getURI(); | 		return this.request.getURI(); | ||||||
|  |  | ||||||
|  | @ -30,7 +30,6 @@ import org.apache.http.nio.entity.NByteArrayEntity; | ||||||
| import org.apache.http.protocol.HttpContext; | import org.apache.http.protocol.HttpContext; | ||||||
| 
 | 
 | ||||||
| import org.springframework.http.HttpHeaders; | import org.springframework.http.HttpHeaders; | ||||||
| import org.springframework.http.HttpMethod; |  | ||||||
| import org.springframework.util.concurrent.FailureCallback; | import org.springframework.util.concurrent.FailureCallback; | ||||||
| import org.springframework.util.concurrent.FutureAdapter; | import org.springframework.util.concurrent.FutureAdapter; | ||||||
| import org.springframework.util.concurrent.ListenableFuture; | import org.springframework.util.concurrent.ListenableFuture; | ||||||
|  | @ -69,8 +68,8 @@ final class HttpComponentsAsyncClientHttpRequest extends AbstractBufferingAsyncC | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public HttpMethod getMethod() { | 	public String getMethodValue() { | ||||||
| 		return HttpMethod.resolve(this.httpRequest.getMethod()); | 		return this.httpRequest.getMethod(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| /* | /* | ||||||
|  * Copyright 2002-2016 the original author or authors. |  * Copyright 2002-2017 the original author or authors. | ||||||
|  * |  * | ||||||
|  * Licensed under the Apache License, Version 2.0 (the "License"); |  * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  * you may not use this file except in compliance with the License. |  * you may not use this file except in compliance with the License. | ||||||
|  | @ -63,8 +63,8 @@ final class HttpComponentsClientHttpRequest extends AbstractBufferingClientHttpR | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public HttpMethod getMethod() { | 	public String getMethodValue() { | ||||||
| 		return HttpMethod.resolve(this.httpRequest.getMethod()); | 		return this.httpRequest.getMethod(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| /* | /* | ||||||
|  * Copyright 2002-2015 the original author or authors. |  * Copyright 2002-2017 the original author or authors. | ||||||
|  * |  * | ||||||
|  * Licensed under the Apache License, Version 2.0 (the "License"); |  * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  * you may not use this file except in compliance with the License. |  * you may not use this file except in compliance with the License. | ||||||
|  | @ -31,7 +31,6 @@ import org.apache.http.message.BasicHeader; | ||||||
| import org.apache.http.protocol.HttpContext; | import org.apache.http.protocol.HttpContext; | ||||||
| 
 | 
 | ||||||
| import org.springframework.http.HttpHeaders; | import org.springframework.http.HttpHeaders; | ||||||
| import org.springframework.http.HttpMethod; |  | ||||||
| import org.springframework.http.MediaType; | import org.springframework.http.MediaType; | ||||||
| import org.springframework.http.StreamingHttpOutputMessage; | import org.springframework.http.StreamingHttpOutputMessage; | ||||||
| 
 | 
 | ||||||
|  | @ -65,8 +64,8 @@ final class HttpComponentsStreamingClientHttpRequest extends AbstractClientHttpR | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public HttpMethod getMethod() { | 	public String getMethodValue() { | ||||||
| 		return HttpMethod.resolve(this.httpRequest.getMethod()); | 		return this.httpRequest.getMethod(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
|  |  | ||||||
|  | @ -75,7 +75,12 @@ class InterceptingAsyncClientHttpRequest extends AbstractBufferingAsyncClientHtt | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public HttpMethod getMethod() { | 	public HttpMethod getMethod() { | ||||||
| 		return httpMethod; | 		return this.httpMethod; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	@Override | ||||||
|  | 	public String getMethodValue() { | ||||||
|  | 		return this.httpMethod.name(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
|  |  | ||||||
|  | @ -59,6 +59,11 @@ class InterceptingClientHttpRequest extends AbstractBufferingClientHttpRequest { | ||||||
| 		return this.method; | 		return this.method; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	@Override | ||||||
|  | 	public String getMethodValue() { | ||||||
|  | 		return this.method.name(); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public URI getURI() { | 	public URI getURI() { | ||||||
| 		return this.uri; | 		return this.uri; | ||||||
|  |  | ||||||
|  | @ -77,6 +77,11 @@ class Netty4ClientHttpRequest extends AbstractAsyncClientHttpRequest implements | ||||||
| 		return this.method; | 		return this.method; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	@Override | ||||||
|  | 	public String getMethodValue() { | ||||||
|  | 		return this.method.name(); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public URI getURI() { | 	public URI getURI() { | ||||||
| 		return this.uri; | 		return this.uri; | ||||||
|  |  | ||||||
|  | @ -63,6 +63,11 @@ class OkHttp3AsyncClientHttpRequest extends AbstractBufferingAsyncClientHttpRequ | ||||||
| 		return this.method; | 		return this.method; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	@Override | ||||||
|  | 	public String getMethodValue() { | ||||||
|  | 		return this.method.name(); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public URI getURI() { | 	public URI getURI() { | ||||||
| 		return this.uri; | 		return this.uri; | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| /* | /* | ||||||
|  * Copyright 2002-2016 the original author or authors. |  * Copyright 2002-2017 the original author or authors. | ||||||
|  * |  * | ||||||
|  * Licensed under the Apache License, Version 2.0 (the "License"); |  * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  * you may not use this file except in compliance with the License. |  * you may not use this file except in compliance with the License. | ||||||
|  | @ -56,6 +56,11 @@ class OkHttp3ClientHttpRequest extends AbstractBufferingClientHttpRequest { | ||||||
| 		return this.method; | 		return this.method; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	@Override | ||||||
|  | 	public String getMethodValue() { | ||||||
|  | 		return this.method.name(); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public URI getURI() { | 	public URI getURI() { | ||||||
| 		return this.uri; | 		return this.uri; | ||||||
|  |  | ||||||
|  | @ -58,8 +58,8 @@ final class SimpleBufferingAsyncClientHttpRequest extends AbstractBufferingAsync | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public HttpMethod getMethod() { | 	public String getMethodValue() { | ||||||
| 		return HttpMethod.resolve(this.connection.getRequestMethod()); | 		return this.connection.getRequestMethod(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| /* | /* | ||||||
|  * Copyright 2002-2016 the original author or authors. |  * Copyright 2002-2017 the original author or authors. | ||||||
|  * |  * | ||||||
|  * Licensed under the Apache License, Version 2.0 (the "License"); |  * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  * you may not use this file except in compliance with the License. |  * you may not use this file except in compliance with the License. | ||||||
|  | @ -51,8 +51,8 @@ final class SimpleBufferingClientHttpRequest extends AbstractBufferingClientHttp | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public HttpMethod getMethod() { | 	public String getMethodValue() { | ||||||
| 		return HttpMethod.resolve(this.connection.getRequestMethod()); | 		return this.connection.getRequestMethod(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
|  |  | ||||||
|  | @ -25,7 +25,6 @@ import java.util.concurrent.Callable; | ||||||
| 
 | 
 | ||||||
| import org.springframework.core.task.AsyncListenableTaskExecutor; | import org.springframework.core.task.AsyncListenableTaskExecutor; | ||||||
| import org.springframework.http.HttpHeaders; | import org.springframework.http.HttpHeaders; | ||||||
| import org.springframework.http.HttpMethod; |  | ||||||
| import org.springframework.util.StreamUtils; | import org.springframework.util.StreamUtils; | ||||||
| import org.springframework.util.concurrent.ListenableFuture; | import org.springframework.util.concurrent.ListenableFuture; | ||||||
| 
 | 
 | ||||||
|  | @ -64,8 +63,8 @@ final class SimpleStreamingAsyncClientHttpRequest extends AbstractAsyncClientHtt | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public HttpMethod getMethod() { | 	public String getMethodValue() { | ||||||
| 		return HttpMethod.resolve(this.connection.getRequestMethod()); | 		return this.connection.getRequestMethod(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| /* | /* | ||||||
|  * Copyright 2002-2016 the original author or authors. |  * Copyright 2002-2017 the original author or authors. | ||||||
|  * |  * | ||||||
|  * Licensed under the Apache License, Version 2.0 (the "License"); |  * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  * you may not use this file except in compliance with the License. |  * you may not use this file except in compliance with the License. | ||||||
|  | @ -52,8 +52,9 @@ final class SimpleStreamingClientHttpRequest extends AbstractClientHttpRequest { | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	public HttpMethod getMethod() { | 	@Override | ||||||
| 		return HttpMethod.resolve(this.connection.getRequestMethod()); | 	public String getMethodValue() { | ||||||
|  | 		return this.connection.getRequestMethod(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| /* | /* | ||||||
|  * Copyright 2002-2015 the original author or authors. |  * Copyright 2002-2017 the original author or authors. | ||||||
|  * |  * | ||||||
|  * Licensed under the Apache License, Version 2.0 (the "License"); |  * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  * you may not use this file except in compliance with the License. |  * you may not use this file except in compliance with the License. | ||||||
|  | @ -62,6 +62,14 @@ public class HttpRequestWrapper implements HttpRequest { | ||||||
| 		return this.request.getMethod(); | 		return this.request.getMethod(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	/** | ||||||
|  | 	 * Return the method value of the wrapped request. | ||||||
|  | 	 */ | ||||||
|  | 	@Override | ||||||
|  | 	public String getMethodValue() { | ||||||
|  | 		return this.request.getMethodValue(); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	/** | 	/** | ||||||
| 	 * Return the URI of the wrapped request. | 	 * Return the URI of the wrapped request. | ||||||
| 	 */ | 	 */ | ||||||
|  |  | ||||||
|  | @ -83,8 +83,8 @@ public class ServletServerHttpRequest implements ServerHttpRequest { | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public HttpMethod getMethod() { | 	public String getMethodValue() { | ||||||
| 		return HttpMethod.resolve(this.servletRequest.getMethod()); | 		return this.servletRequest.getMethod(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
|  |  | ||||||
|  | @ -28,7 +28,6 @@ import org.springframework.core.io.buffer.DataBuffer; | ||||||
| import org.springframework.core.io.buffer.NettyDataBufferFactory; | import org.springframework.core.io.buffer.NettyDataBufferFactory; | ||||||
| import org.springframework.http.HttpCookie; | import org.springframework.http.HttpCookie; | ||||||
| import org.springframework.http.HttpHeaders; | import org.springframework.http.HttpHeaders; | ||||||
| import org.springframework.http.HttpMethod; |  | ||||||
| import org.springframework.util.Assert; | import org.springframework.util.Assert; | ||||||
| import org.springframework.util.LinkedMultiValueMap; | import org.springframework.util.LinkedMultiValueMap; | ||||||
| import org.springframework.util.MultiValueMap; | import org.springframework.util.MultiValueMap; | ||||||
|  | @ -82,8 +81,8 @@ public class ReactorServerHttpRequest extends AbstractServerHttpRequest { | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public HttpMethod getMethod() { | 	public String getMethodValue() { | ||||||
| 		return HttpMethod.valueOf(this.request.method().name()); | 		return this.request.method().name(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
|  |  | ||||||
|  | @ -58,6 +58,11 @@ public class ServerHttpRequestDecorator implements ServerHttpRequest { | ||||||
| 		return getDelegate().getMethod(); | 		return getDelegate().getMethod(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	@Override | ||||||
|  | 	public String getMethodValue() { | ||||||
|  | 		return getDelegate().getMethodValue(); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public URI getURI() { | 	public URI getURI() { | ||||||
| 		return getDelegate().getURI(); | 		return getDelegate().getURI(); | ||||||
|  |  | ||||||
|  | @ -39,7 +39,6 @@ import org.springframework.core.io.buffer.DataBuffer; | ||||||
| import org.springframework.core.io.buffer.DataBufferFactory; | import org.springframework.core.io.buffer.DataBufferFactory; | ||||||
| import org.springframework.http.HttpCookie; | import org.springframework.http.HttpCookie; | ||||||
| import org.springframework.http.HttpHeaders; | import org.springframework.http.HttpHeaders; | ||||||
| import org.springframework.http.HttpMethod; |  | ||||||
| import org.springframework.http.MediaType; | import org.springframework.http.MediaType; | ||||||
| import org.springframework.util.Assert; | import org.springframework.util.Assert; | ||||||
| import org.springframework.util.LinkedCaseInsensitiveMap; | import org.springframework.util.LinkedCaseInsensitiveMap; | ||||||
|  | @ -150,8 +149,8 @@ public class ServletServerHttpRequest extends AbstractServerHttpRequest { | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public HttpMethod getMethod() { | 	public String getMethodValue() { | ||||||
| 		return HttpMethod.valueOf(getServletRequest().getMethod()); | 		return getServletRequest().getMethod(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
|  |  | ||||||
|  | @ -34,7 +34,6 @@ import org.springframework.core.io.buffer.DataBuffer; | ||||||
| import org.springframework.core.io.buffer.DataBufferFactory; | import org.springframework.core.io.buffer.DataBufferFactory; | ||||||
| import org.springframework.http.HttpCookie; | import org.springframework.http.HttpCookie; | ||||||
| import org.springframework.http.HttpHeaders; | import org.springframework.http.HttpHeaders; | ||||||
| import org.springframework.http.HttpMethod; |  | ||||||
| import org.springframework.util.Assert; | import org.springframework.util.Assert; | ||||||
| import org.springframework.util.LinkedMultiValueMap; | import org.springframework.util.LinkedMultiValueMap; | ||||||
| import org.springframework.util.MultiValueMap; | import org.springframework.util.MultiValueMap; | ||||||
|  | @ -83,8 +82,8 @@ public class UndertowServerHttpRequest extends AbstractServerHttpRequest { | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public HttpMethod getMethod() { | 	public String getMethodValue() { | ||||||
| 		return HttpMethod.valueOf(this.getUndertowExchange().getRequestMethod().toString()); | 		return this.getUndertowExchange().getRequestMethod().toString(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
|  |  | ||||||
|  | @ -662,6 +662,10 @@ public class AsyncRestTemplate extends org.springframework.http.client.support.I | ||||||
| 						return request.getMethod(); | 						return request.getMethod(); | ||||||
| 					} | 					} | ||||||
| 					@Override | 					@Override | ||||||
|  | 					public String getMethodValue() { | ||||||
|  | 						return request.getMethodValue(); | ||||||
|  | 					} | ||||||
|  | 					@Override | ||||||
| 					public URI getURI() { | 					public URI getURI() { | ||||||
| 						return request.getURI(); | 						return request.getURI(); | ||||||
| 					} | 					} | ||||||
|  |  | ||||||
|  | @ -267,6 +267,11 @@ public class InterceptingClientHttpRequestFactoryTests { | ||||||
| 			return method; | 			return method; | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  | 		@Override | ||||||
|  | 		public String getMethodValue() { | ||||||
|  | 			return method.name(); | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
| 		public void setMethod(HttpMethod method) { | 		public void setMethod(HttpMethod method) { | ||||||
| 			this.method = method; | 			this.method = method; | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | @ -31,7 +31,6 @@ import org.springframework.core.io.buffer.DataBuffer; | ||||||
| import org.springframework.core.io.buffer.NettyDataBufferFactory; | import org.springframework.core.io.buffer.NettyDataBufferFactory; | ||||||
| import org.springframework.http.HttpCookie; | import org.springframework.http.HttpCookie; | ||||||
| import org.springframework.http.HttpHeaders; | import org.springframework.http.HttpHeaders; | ||||||
| import org.springframework.http.HttpMethod; |  | ||||||
| import org.springframework.util.Assert; | import org.springframework.util.Assert; | ||||||
| import org.springframework.util.LinkedMultiValueMap; | import org.springframework.util.LinkedMultiValueMap; | ||||||
| import org.springframework.util.MultiValueMap; | import org.springframework.util.MultiValueMap; | ||||||
|  | @ -93,8 +92,8 @@ public class RxNettyServerHttpRequest extends AbstractServerHttpRequest { | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public HttpMethod getMethod() { | 	public String getMethodValue() { | ||||||
| 		return HttpMethod.valueOf(this.request.getHttpMethod().name()); | 		return this.request.getHttpMethod().name(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@Override | 	@Override | ||||||
|  |  | ||||||
|  | @ -82,6 +82,11 @@ public class MockServerHttpRequest extends AbstractServerHttpRequest { | ||||||
| 		return this.httpMethod; | 		return this.httpMethod; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	@Override | ||||||
|  | 	public String getMethodValue() { | ||||||
|  | 		return this.httpMethod.name(); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	@Override | 	@Override | ||||||
| 	public String getContextPath() { | 	public String getContextPath() { | ||||||
| 		return this.contextPath; | 		return this.contextPath; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue