@@ -47,6 +47,15 @@ public static MockHttpServletRequestBuilder get(String urlTemplate, Object... ur
47
47
return new MockHttpServletRequestBuilder (HttpMethod .GET , urlTemplate , urlVariables );
48
48
}
49
49
50
+ /**
51
+ * Create a {@link MockHttpServletRequestBuilder} for a GET request.
52
+ * @param uri the URL
53
+ * @since 4.0.3
54
+ */
55
+ public static MockHttpServletRequestBuilder get (URI uri ) {
56
+ return new MockHttpServletRequestBuilder (HttpMethod .GET , uri );
57
+ }
58
+
50
59
/**
51
60
* Create a {@link MockHttpServletRequestBuilder} for a POST request.
52
61
* @param urlTemplate a URL template; the resulting URL will be encoded
@@ -56,6 +65,15 @@ public static MockHttpServletRequestBuilder post(String urlTemplate, Object... u
56
65
return new MockHttpServletRequestBuilder (HttpMethod .POST , urlTemplate , urlVariables );
57
66
}
58
67
68
+ /**
69
+ * Create a {@link MockHttpServletRequestBuilder} for a POST request.
70
+ * @param uri the URL
71
+ * @since 4.0.3
72
+ */
73
+ public static MockHttpServletRequestBuilder post (URI uri ) {
74
+ return new MockHttpServletRequestBuilder (HttpMethod .POST , uri );
75
+ }
76
+
59
77
/**
60
78
* Create a {@link MockHttpServletRequestBuilder} for a PUT request.
61
79
* @param urlTemplate a URL template; the resulting URL will be encoded
@@ -65,6 +83,15 @@ public static MockHttpServletRequestBuilder put(String urlTemplate, Object... ur
65
83
return new MockHttpServletRequestBuilder (HttpMethod .PUT , urlTemplate , urlVariables );
66
84
}
67
85
86
+ /**
87
+ * Create a {@link MockHttpServletRequestBuilder} for a PUT request.
88
+ * @param uri the URL
89
+ * @since 4.0.3
90
+ */
91
+ public static MockHttpServletRequestBuilder put (URI uri ) {
92
+ return new MockHttpServletRequestBuilder (HttpMethod .PUT , uri );
93
+ }
94
+
68
95
/**
69
96
* Create a {@link MockHttpServletRequestBuilder} for a PATCH request.
70
97
* @param urlTemplate a URL template; the resulting URL will be encoded
@@ -74,6 +101,15 @@ public static MockHttpServletRequestBuilder patch(String urlTemplate, Object...
74
101
return new MockHttpServletRequestBuilder (HttpMethod .PATCH , urlTemplate , urlVariables );
75
102
}
76
103
104
+ /**
105
+ * Create a {@link MockHttpServletRequestBuilder} for a PATCH request.
106
+ * @param uri the URL
107
+ * @since 4.0.3
108
+ */
109
+ public static MockHttpServletRequestBuilder patch (URI uri ) {
110
+ return new MockHttpServletRequestBuilder (HttpMethod .PATCH , uri );
111
+ }
112
+
77
113
/**
78
114
* Create a {@link MockHttpServletRequestBuilder} for a DELETE request.
79
115
* @param urlTemplate a URL template; the resulting URL will be encoded
@@ -83,6 +119,15 @@ public static MockHttpServletRequestBuilder delete(String urlTemplate, Object...
83
119
return new MockHttpServletRequestBuilder (HttpMethod .DELETE , urlTemplate , urlVariables );
84
120
}
85
121
122
+ /**
123
+ * Create a {@link MockHttpServletRequestBuilder} for a DELETE request.
124
+ * @param uri the URL
125
+ * @since 4.0.3
126
+ */
127
+ public static MockHttpServletRequestBuilder delete (URI uri ) {
128
+ return new MockHttpServletRequestBuilder (HttpMethod .DELETE , uri );
129
+ }
130
+
86
131
/**
87
132
* Create a {@link MockHttpServletRequestBuilder} for an OPTIONS request.
88
133
* @param urlTemplate a URL template; the resulting URL will be encoded
@@ -92,6 +137,14 @@ public static MockHttpServletRequestBuilder options(String urlTemplate, Object..
92
137
return new MockHttpServletRequestBuilder (HttpMethod .OPTIONS , urlTemplate , urlVariables );
93
138
}
94
139
140
+ /**
141
+ * Create a {@link MockHttpServletRequestBuilder} for an OPTIONS request.
142
+ * @param uri the URL
143
+ * @since 4.0.3
144
+ */
145
+ public static MockHttpServletRequestBuilder options (URI uri ) {
146
+ return new MockHttpServletRequestBuilder (HttpMethod .OPTIONS , uri );
147
+ }
95
148
96
149
/**
97
150
* Create a {@link MockHttpServletRequestBuilder} for a request with the given HTTP method.
@@ -104,86 +157,31 @@ public static MockHttpServletRequestBuilder request(HttpMethod httpMethod, Strin
104
157
}
105
158
106
159
/**
107
- * Create a {@link MockHttpServletRequestBuilder} for a multipart request.
108
- * @param urlTemplate a URL template; the resulting URL will be encoded
109
- * @param urlVariables zero or more URL variables
110
- */
111
- public static MockMultipartHttpServletRequestBuilder fileUpload (String urlTemplate , Object ... urlVariables ) {
112
- return new MockMultipartHttpServletRequestBuilder (urlTemplate , urlVariables );
113
- }
114
-
115
-
116
- /**
117
- * Create a {@link MockHttpServletRequestBuilder} for a GET request.
118
- * @param url the URL
119
- * @since 4.0.3
120
- */
121
- public static MockHttpServletRequestBuilder get (URI url ) {
122
- return new MockHttpServletRequestBuilder (HttpMethod .GET , url );
123
- }
124
-
125
- /**
126
- * Create a {@link MockHttpServletRequestBuilder} for a POST request.
127
- * @param url the URL
128
- * @since 4.0.3
129
- */
130
- public static MockHttpServletRequestBuilder post (URI url ) {
131
- return new MockHttpServletRequestBuilder (HttpMethod .POST , url );
132
- }
133
-
134
- /**
135
- * Create a {@link MockHttpServletRequestBuilder} for a PUT request.
136
- * @param url the URL
137
- * @since 4.0.3
138
- */
139
- public static MockHttpServletRequestBuilder put (URI url ) {
140
- return new MockHttpServletRequestBuilder (HttpMethod .PUT , url );
141
- }
142
-
143
- /**
144
- * Create a {@link MockHttpServletRequestBuilder} for a PATCH request.
145
- * @param url the URL
146
- * @since 4.0.3
147
- */
148
- public static MockHttpServletRequestBuilder patch (URI url ) {
149
- return new MockHttpServletRequestBuilder (HttpMethod .PATCH , url );
150
- }
151
-
152
- /**
153
- * Create a {@link MockHttpServletRequestBuilder} for a DELETE request.
154
- * @param url the URL
155
- * @since 4.0.3
156
- */
157
- public static MockHttpServletRequestBuilder delete (URI url ) {
158
- return new MockHttpServletRequestBuilder (HttpMethod .DELETE , url );
159
- }
160
-
161
- /**
162
- * Create a {@link MockHttpServletRequestBuilder} for an OPTIONS request.
163
- * @param url the URL
160
+ * Create a {@link MockHttpServletRequestBuilder} for a request with the given HTTP method.
161
+ * @param httpMethod the HTTP method (GET, POST, etc)
162
+ * @param uri the URL
164
163
* @since 4.0.3
165
164
*/
166
- public static MockHttpServletRequestBuilder options ( URI url ) {
167
- return new MockHttpServletRequestBuilder (HttpMethod . OPTIONS , url );
165
+ public static MockHttpServletRequestBuilder request ( HttpMethod httpMethod , URI uri ) {
166
+ return new MockHttpServletRequestBuilder (httpMethod , uri );
168
167
}
169
168
170
169
/**
171
- * Create a {@link MockHttpServletRequestBuilder} for a request with the given HTTP method.
172
- * @param httpMethod the HTTP method (GET, POST, etc)
173
- * @param url the URL
174
- * @since 4.0.3
170
+ * Create a {@link MockHttpServletRequestBuilder} for a multipart request.
171
+ * @param urlTemplate a URL template; the resulting URL will be encoded
172
+ * @param urlVariables zero or more URL variables
175
173
*/
176
- public static MockHttpServletRequestBuilder request ( HttpMethod httpMethod , URI url ) {
177
- return new MockHttpServletRequestBuilder ( httpMethod , url );
174
+ public static MockMultipartHttpServletRequestBuilder fileUpload ( String urlTemplate , Object ... urlVariables ) {
175
+ return new MockMultipartHttpServletRequestBuilder ( urlTemplate , urlVariables );
178
176
}
179
177
180
178
/**
181
179
* Create a {@link MockHttpServletRequestBuilder} for a multipart request.
182
- * @param url the URL
180
+ * @param uri the URL
183
181
* @since 4.0.3
184
182
*/
185
- public static MockMultipartHttpServletRequestBuilder fileUpload (URI url ) {
186
- return new MockMultipartHttpServletRequestBuilder (url );
183
+ public static MockMultipartHttpServletRequestBuilder fileUpload (URI uri ) {
184
+ return new MockMultipartHttpServletRequestBuilder (uri );
187
185
}
188
186
189
187
/**
0 commit comments