This is an automated email from the ASF dual-hosted git repository.

jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git


The following commit(s) were added to refs/heads/master by this push:
     new c9fd683  REST refactoring.
c9fd683 is described below

commit c9fd68326f6fb5d08b46f739612df83198a1559b
Author: JamesBognar <[email protected]>
AuthorDate: Wed Feb 17 16:43:46 2021 -0500

    REST refactoring.
---
 .../apache/juneau/rest/client/ResponseBody.java    |  23 +-
 .../apache/juneau/rest/client/ResponseHeader.java  |  22 +-
 .../juneau/rest/client/ResponseStatusLine.java     |  91 ++++++
 .../org/apache/juneau/rest/client/RestClient.java  |  89 +++---
 .../apache/juneau/rest/client/RestOperation.java   |  21 +-
 .../org/apache/juneau/rest/client/RestRequest.java |   3 +-
 .../apache/juneau/rest/client/RestResponse.java    |  13 +-
 .../apache/juneau/rest/mock/MockRestClient.java    |   4 +-
 .../rest/annotation/Restx_RoleGuard_Test.java      | 330 ++++++++++-----------
 .../rest/client/RestClient_Response_Body_Test.java |   4 +-
 .../client/RestClient_Response_Headers_Test.java   |   2 +-
 11 files changed, 355 insertions(+), 247 deletions(-)

diff --git 
a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/ResponseBody.java
 
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/ResponseBody.java
index 72a1db2..297eeea 100644
--- 
a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/ResponseBody.java
+++ 
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/ResponseBody.java
@@ -1054,15 +1054,6 @@ public class ResponseBody implements HttpEntity {
                return asMatcher(Pattern.compile(regex, flags));
        }
 
-       /**
-        * Returns the response that created this object.
-        *
-        * @return The response that created this object.
-        */
-       public RestResponse toResponse() {
-               return response;
-       }
-
        
//------------------------------------------------------------------------------------------------------------------
        // Assertions
        
//------------------------------------------------------------------------------------------------------------------
@@ -1135,10 +1126,18 @@ public class ResponseBody implements HttpEntity {
         * </ul>
         *
         * @return A new fluent assertion object.
-        * @throws RestCallException If REST call failed.
         */
-       public FluentResponseBodyAssertion<RestResponse> assertValue() throws 
RestCallException {
-               return new FluentResponseBodyAssertion<>(this, response);
+       public FluentResponseBodyAssertion<ResponseBody> assertValue() {
+               return new FluentResponseBodyAssertion<>(this, this);
+       }
+
+       /**
+        * Returns the response that created this object.
+        *
+        * @return The response that created this object.
+        */
+       public RestResponse response() {
+               return response;
        }
 
        
//------------------------------------------------------------------------------------------------------------------
diff --git 
a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/ResponseHeader.java
 
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/ResponseHeader.java
index b16f81b..38379df 100644
--- 
a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/ResponseHeader.java
+++ 
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/ResponseHeader.java
@@ -469,15 +469,6 @@ public class ResponseHeader implements Header {
                return asMatcher(Pattern.compile(regex, flags));
        }
 
-       /**
-        * Returns the response that created this object.
-        *
-        * @return The response that created this object.
-        */
-       public RestResponse toResponse() {
-               return response;
-       }
-
        
//------------------------------------------------------------------------------------------------------------------
        // Assertions.
        
//------------------------------------------------------------------------------------------------------------------
@@ -538,8 +529,17 @@ public class ResponseHeader implements Header {
         *
         * @return A new fluent assertion object.
         */
-       public FluentResponseHeaderAssertion<RestResponse> assertValue() {
-               return new FluentResponseHeaderAssertion<>(this, response);
+       public FluentResponseHeaderAssertion<ResponseHeader> assertValue() {
+               return new FluentResponseHeaderAssertion<>(this, this);
+       }
+
+       /**
+        * Returns the response that created this object.
+        *
+        * @return The response that created this object.
+        */
+       public RestResponse response() {
+               return response;
        }
 
        
//------------------------------------------------------------------------------------------------------------------
diff --git 
a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/ResponseStatusLine.java
 
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/ResponseStatusLine.java
new file mode 100644
index 0000000..41c6f0c
--- /dev/null
+++ 
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/ResponseStatusLine.java
@@ -0,0 +1,91 @@
+// 
***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license agreements.  See the NOTICE file *
+// * distributed with this work for additional information regarding copyright 
ownership.  The ASF licenses this file        *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not 
use this file except in compliance            *
+// * with the License.  You may obtain a copy of the License at                
                                              *
+// *                                                                           
                                              *
+// *  http://www.apache.org/licenses/LICENSE-2.0                               
                                              *
+// *                                                                           
                                              *
+// * Unless required by applicable law or agreed to in writing, software 
distributed under the License is distributed on an  *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 
express or implied.  See the License for the        *
+// * specific language governing permissions and limitations under the 
License.                                              *
+// 
***************************************************************************************************************************
+package org.apache.juneau.rest.client;
+
+import org.apache.http.*;
+import org.apache.juneau.rest.client.assertion.*;
+
+/**
+ * An implementation of {@link StatusLine} that adds assertions methods.
+ */
+public class ResponseStatusLine implements StatusLine {
+
+       private final RestResponse response;
+       private final StatusLine inner;
+
+       /**
+        * Constructor.
+        *
+        * @param response The response that created this object.
+        * @param inner The status line returned by the underlying client.
+        */
+       protected ResponseStatusLine(RestResponse response, StatusLine inner) {
+               this.response = response;
+               this.inner = inner;
+       }
+
+       @Override /* StatusLine */
+       public ProtocolVersion getProtocolVersion() {
+               return inner.getProtocolVersion();
+       }
+
+       @Override /* StatusLine */
+       public int getStatusCode() {
+               return inner.getStatusCode();
+       }
+
+       @Override /* StatusLine */
+       public String getReasonPhrase() {
+               return inner.getReasonPhrase();
+       }
+
+       
//------------------------------------------------------------------------------------------------------------------
+       // Assertions.
+       
//------------------------------------------------------------------------------------------------------------------
+
+       /**
+        * Provides the ability to perform fluent-style assertions on this 
response status line.
+        *
+        * <h5 class='section'>Examples:</h5>
+        * <p class='bcode w800'>
+        *      <jc>// Validates the content type header is provided.</jc>
+        *      <jv>client</jv>
+        *              .get(<jsf>URI</jsf>)
+        *              .run()
+        *              .getStatusLine().assertValue().code().is(200);
+        * </p>
+        *
+        * @return A new fluent assertion object.
+        */
+       public FluentResponseStatusLineAssertion<ResponseStatusLine> 
assertValue() {
+               return new FluentResponseStatusLineAssertion<>(this, this);
+       }
+
+       /**
+        * Returns the response that created this object.
+        *
+        * @return The response that created this object.
+        */
+       public RestResponse response() {
+               return response;
+       }
+
+       
//------------------------------------------------------------------------------------------------------------------
+       // Other methods.
+       
//------------------------------------------------------------------------------------------------------------------
+
+       @Override /* Object */
+       public String toString() {
+               return inner.toString();
+       }
+}
diff --git 
a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
 
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
index 9c801f5..940a184 100644
--- 
a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
+++ 
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
@@ -2195,22 +2195,6 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
        }
 
        /**
-        * Perform an arbitrary request against the specified URI.
-        *
-        * @param op The operation that identifies the HTTP method, URL, and 
optional payload.
-        * @return
-        *      A {@link RestRequest} object that can be further tailored 
before executing the request and getting the response
-        *      as a parsed object.
-        * @throws RestCallException If any authentication errors occurred.
-        */
-       public RestRequest op(RestOperation op) throws RestCallException {
-               RestRequest req = request(op.getMethod(), op.getUrl(), 
op.hasBody());
-               if (op.getBody() != null)
-                       req.body(op.getBody());
-               return req;
-       }
-
-       /**
         * Perform a <c>GET</c> request against the specified URI.
         *
         * @param uri
@@ -2229,7 +2213,7 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
         * @throws RestCallException If any authentication errors occurred.
         */
        public RestRequest get(Object uri) throws RestCallException {
-               return request("GET", uri, false);
+               return request(op("GET", uri));
        }
 
        /**
@@ -2241,7 +2225,7 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
         * @throws RestCallException If any authentication errors occurred.
         */
        public RestRequest get() throws RestCallException {
-               return request("GET", null, false);
+               return request(op("GET", null));
        }
 
        /**
@@ -2281,7 +2265,7 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
         * @throws RestCallException If any authentication errors occurred.
         */
        public RestRequest put(Object uri, Object body) throws 
RestCallException {
-               return request("PUT", uri, true).body(body);
+               return request(op("PUT", uri, body));
        }
 
        /**
@@ -2306,7 +2290,7 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
         * @throws RestCallException If any authentication errors occurred.
         */
        public RestRequest put(Object uri, String body, String contentType) 
throws RestCallException {
-               return request("PUT", uri, 
true).bodyString(body).contentType(contentType);
+               return request(op("PUT", uri, 
stringBody(body))).contentType(contentType);
        }
 
        /**
@@ -2332,7 +2316,7 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
         * @throws RestCallException REST call failed.
         */
        public RestRequest put(Object uri) throws RestCallException {
-               return request("PUT", uri, true);
+               return request(op("PUT", uri));
        }
 
        /**
@@ -2376,7 +2360,7 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
         * @throws RestCallException If any authentication errors occurred.
         */
        public RestRequest post(Object uri, Object body) throws 
RestCallException {
-               return request("POST", uri, true).body(body);
+               return request(op("POST", uri, body));
        }
 
        /**
@@ -2402,7 +2386,7 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
         * @throws RestCallException If any authentication errors occurred.
         */
        public RestRequest post(Object uri, String body, String contentType) 
throws RestCallException {
-               return request("POST", uri, 
true).bodyString(body).contentType(contentType);
+               return request(op("POST", uri, 
stringBody(body))).contentType(contentType);
        }
 
        /**
@@ -2432,7 +2416,7 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
         * @throws RestCallException REST call failed.
         */
        public RestRequest post(Object uri) throws RestCallException {
-               return request("POST", uri, true);
+               return request(op("POST", uri));
        }
 
        /**
@@ -2454,7 +2438,7 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
         * @throws RestCallException If any authentication errors occurred.
         */
        public RestRequest delete(Object uri) throws RestCallException {
-               return request("DELETE", uri, false);
+               return request(op("DELETE", uri));
        }
 
        /**
@@ -2476,7 +2460,7 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
         * @throws RestCallException If any authentication errors occurred.
         */
        public RestRequest options(Object uri) throws RestCallException {
-               return request("OPTIONS", uri, true);
+               return request(op("OPTIONS", uri));
        }
 
        /**
@@ -2498,7 +2482,7 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
         * @throws RestCallException If any authentication errors occurred.
         */
        public RestRequest head(Object uri) throws RestCallException {
-               return request("HEAD", uri, false);
+               return request(op("HEAD", uri));
        }
 
        /**
@@ -2533,7 +2517,7 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
         * @throws RestCallException If any authentication errors occurred.
         */
        public RestRequest formPost(Object uri, Object body) throws 
RestCallException {
-               RestRequest req = request("POST", uri, true);
+               RestRequest req = request(op("POST", uri));
                try {
                        if (body instanceof Supplier)
                                body = ((Supplier<?>)body).get();
@@ -2580,7 +2564,7 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
         * @throws RestCallException If any authentication errors occurred.
         */
        public RestRequest formPost(Object uri) throws RestCallException {
-               return request("POST", uri, true);
+               return request(op("POST", uri));
        }
 
        /**
@@ -2649,7 +2633,7 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
         * @throws RestCallException If any authentication errors occurred.
         */
        public RestRequest patch(Object uri, Object body) throws 
RestCallException {
-               return request("PATCH", uri, true).body(body);
+               return request(op("PATCH", uri, body));
        }
 
        /**
@@ -2675,7 +2659,7 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
         * @throws RestCallException If any authentication errors occurred.
         */
        public RestRequest patch(Object uri, String body, String contentType) 
throws RestCallException {
-               return request("PATCH", uri, 
true).bodyString(body).contentType(contentType);
+               return request(op("PATCH", uri, 
stringBody(body))).contentType(contentType);
        }
 
        /**
@@ -2700,7 +2684,7 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
         * @throws RestCallException REST call failed.
         */
        public RestRequest patch(Object uri) throws RestCallException {
-               return request("PATCH", uri, true);
+               return request(op("PATCH", uri));
        }
 
 
@@ -2834,11 +2818,7 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
         * @throws RestCallException If any authentication errors occurred.
         */
        public RestRequest request(String method, Object uri, Object body) 
throws RestCallException {
-               boolean b = hasContent(method);
-               RestRequest rc = request(method, uri, b);
-               if (b)
-                       rc.body(body);
-               return rc;
+               return request(op(method, uri, body));
        }
 
        /**
@@ -2861,8 +2841,7 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
         * @throws RestCallException If any authentication errors occurred.
         */
        public RestRequest request(String method, Object uri) throws 
RestCallException {
-               RestRequest rc = request(method, uri, hasContent(method));
-               return rc;
+               return request(op(method, uri));
        }
 
        /**
@@ -2890,8 +2869,19 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
         * @throws RestCallException If any authentication errors occurred.
         */
        public RestRequest request(String method, Object uri, boolean hasBody) 
throws RestCallException {
-               if (method == null)
-                       method = "GET";
+               return request(op(method, uri).hasBody(hasBody));
+       }
+
+       /**
+        * Perform an arbitrary request against the specified URI.
+        *
+        * @param op The operation that identifies the HTTP method, URL, and 
optional payload.
+        * @return
+        *      A {@link RestRequest} object that can be further tailored 
before executing the request and getting the response
+        *      as a parsed object.
+        * @throws RestCallException If any authentication errors occurred.
+        */
+       public RestRequest request(RestOperation op) throws RestCallException {
                if (isClosed) {
                        Exception e2 = null;
                        if (closedStack != null) {
@@ -2902,7 +2892,7 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
                        throw new RestCallException(null, null, 
"RestClient.close() has already been called.  This client cannot be reused.  
Closed location stack trace can be displayed by setting the system property 
'org.apache.juneau.rest.client2.RestClient.trackCreation' to true.");
                }
 
-               RestRequest req = createRequest(toURI(uri, rootUri), 
method.toUpperCase(Locale.ENGLISH), hasBody);
+               RestRequest req = createRequest(toURI(op.getUri(), rootUri), 
op.getMethod(), op.hasBody());
 
                for (Object o : headers)
                        req.header(BasicHeader.cast(o));
@@ -2915,6 +2905,9 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
 
                onInit(req);
 
+               if (op.hasBody())
+                       req.body(op.getBody());
+
                return req;
        }
 
@@ -3796,6 +3789,18 @@ public class RestClient extends BeanContext implements 
HttpClient, Closeable, Re
                return (T)o;
        }
 
+       private RestOperation op(String method, Object url) {
+               return RestOperation.of(method, url);
+       }
+
+       private RestOperation op(String method, Object url, Object body) {
+               return RestOperation.of(method, url, body);
+       }
+
+       private Reader stringBody(String body) {
+               return body == null ? null : new StringReader(stringify(body));
+       }
+
        @Override /* Context */
        public OMap toMap() {
                return super.toMap()
diff --git 
a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestOperation.java
 
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestOperation.java
index 37eab0b..1b4b641 100644
--- 
a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestOperation.java
+++ 
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestOperation.java
@@ -13,8 +13,10 @@
 package org.apache.juneau.rest.client;
 
 import java.net.*;
+import java.util.*;
 
 import org.apache.http.client.utils.*;
+import org.apache.juneau.http.*;
 
 /**
  * Aggregates the HTTP method, URL, and optional body into a single bean.
@@ -24,6 +26,7 @@ public class RestOperation {
        private final Object url;
        private final String method;
        private final Object body;
+       private boolean hasBody;
 
        /**
         * Creator.
@@ -84,8 +87,9 @@ public class RestOperation {
         */
        public RestOperation(String method, Object url, Object body) {
                this.url = url;
-               this.method = method;
+               this.method = method.toUpperCase(Locale.ENGLISH);
                this.body = body;
+               this.hasBody = HttpMethod.hasContent(method);
        }
 
        /**
@@ -93,7 +97,7 @@ public class RestOperation {
         *
         * @return The value of the <property>url</property> property on this 
bean, or <jk>null</jk> if it is not set.
         */
-       public Object getUrl() {
+       public Object getUri() {
                return url;
        }
 
@@ -121,6 +125,17 @@ public class RestOperation {
         * @return <jk>true</jk> if this HTTP method typically has a body.
         */
        public boolean hasBody() {
-               return ! (method.equalsIgnoreCase("get") || 
method.equalsIgnoreCase("delete"));
+               return hasBody;
+       }
+
+       /**
+        * Overrides the default value for the {@link #hasBody()} method.
+        *
+        * @param value The new value.
+        * @return This object (for method chaining).
+        */
+       public RestOperation hasBody(boolean value) {
+               this.hasBody = value;
+               return this;
        }
 }
diff --git 
a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestRequest.java
 
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestRequest.java
index 61f8a10..33c7a05 100644
--- 
a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestRequest.java
+++ 
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestRequest.java
@@ -1877,7 +1877,8 @@ public class RestRequest extends BeanSession implements 
HttpUriRequest, Configur
        public RestRequest body(Object input) throws RestCallException {
                this.input = input;
                this.hasInput = true;
-               this.formData = null;
+               if (input != null)
+                       formData = null;
                return this;
        }
 
diff --git 
a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestResponse.java
 
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestResponse.java
index 49efccd..871d066 100644
--- 
a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestResponse.java
+++ 
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestResponse.java
@@ -175,9 +175,8 @@ public class RestResponse implements HttpResponse {
         * </p>
         *
         * @return A new fluent assertion object.
-        * @throws RestCallException If REST call failed.
         */
-       public FluentResponseStatusLineAssertion<RestResponse> assertStatus() 
throws RestCallException {
+       public FluentResponseStatusLineAssertion<RestResponse> assertStatus() {
                return new FluentResponseStatusLineAssertion<>(getStatusLine(), 
this);
        }
 
@@ -194,9 +193,8 @@ public class RestResponse implements HttpResponse {
         * </p>
         *
         * @return A new fluent assertion object.
-        * @throws RestCallException If REST call failed.
         */
-       public FluentIntegerAssertion<RestResponse> assertCode() throws 
RestCallException {
+       public FluentIntegerAssertion<RestResponse> assertCode() {
                return assertStatus().code();
        }
 
@@ -415,9 +413,8 @@ public class RestResponse implements HttpResponse {
         * </ul>
         *
         * @return A new fluent assertion object.
-        * @throws RestCallException If REST call failed.
         */
-       public FluentResponseBodyAssertion<RestResponse> assertBody() throws 
RestCallException {
+       public FluentResponseBodyAssertion<RestResponse> assertBody() {
                return new FluentResponseBodyAssertion<>(responseBody, this);
        }
 
@@ -500,8 +497,8 @@ public class RestResponse implements HttpResponse {
         * @return The status line, or <jk>null</jk> if not yet set.
         */
        @Override /* HttpResponse */
-       public StatusLine getStatusLine() {
-               return response.getStatusLine();
+       public ResponseStatusLine getStatusLine() {
+               return new ResponseStatusLine(this, response.getStatusLine());
        }
 
        /**
diff --git 
a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockRestClient.java
 
b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockRestClient.java
index b87472f..9cb7bc8 100644
--- 
a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockRestClient.java
+++ 
b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockRestClient.java
@@ -452,8 +452,8 @@ public class MockRestClient extends RestClient implements 
HttpClientConnection {
        
//------------------------------------------------------------------------------------------------------------------
 
        @Override /* RestClient */
-       public MockRestRequest op(RestOperation op) throws RestCallException {
-               return (MockRestRequest)super.op(op);
+       public MockRestRequest request(RestOperation op) throws 
RestCallException {
+               return (MockRestRequest)super.request(op);
        }
 
        @Override /* RestClient */
diff --git 
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Restx_RoleGuard_Test.java
 
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Restx_RoleGuard_Test.java
index 0d1ff73..4cb14df 100644
--- 
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Restx_RoleGuard_Test.java
+++ 
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Restx_RoleGuard_Test.java
@@ -62,12 +62,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient a1 = MockRestClient.buildLax(A1.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       a1.op(op).roles("foo").run().assertCode().is(200);
-                       a1.op(op).roles("foo","bar").run().assertCode().is(200);
-                       a1.op(op).roles("bar","foo").run().assertCode().is(200);
-                       a1.op(op).run().assertCode().is(403);
-                       a1.op(op).roles("foo2").run().assertCode().is(403);
-                       
a1.op(op).roles("foo2","bar").run().assertCode().is(403);
+                       a1.request(op).roles("foo").run().assertCode().is(200);
+                       
a1.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
a1.request(op).roles("bar","foo").run().assertCode().is(200);
+                       a1.request(op).run().assertCode().is(403);
+                       a1.request(op).roles("foo2").run().assertCode().is(403);
+                       
a1.request(op).roles("foo2","bar").run().assertCode().is(403);
                }
        }
 
@@ -104,12 +104,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient a2 = MockRestClient.buildLax(A2.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       a2.op(op).roles("foo").run().assertCode().is(200);
-                       a2.op(op).roles("foo","bar").run().assertCode().is(200);
-                       a2.op(op).roles("bar","foo").run().assertCode().is(200);
-                       a2.op(op).run().assertCode().is(403);
-                       a2.op(op).roles("foo2").run().assertCode().is(403);
-                       
a2.op(op).roles("foo2","bar").run().assertCode().is(403);
+                       a2.request(op).roles("foo").run().assertCode().is(200);
+                       
a2.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
a2.request(op).roles("bar","foo").run().assertCode().is(200);
+                       a2.request(op).run().assertCode().is(403);
+                       a2.request(op).roles("foo2").run().assertCode().is(403);
+                       
a2.request(op).roles("foo2","bar").run().assertCode().is(403);
                }
        }
 
@@ -146,14 +146,14 @@ public class Restx_RoleGuard_Test {
                MockRestClient a3 = MockRestClient.buildLax(A3.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       a3.op(op).roles("foo","bar").run().assertCode().is(200);
-                       a3.op(op).roles("bar","foo").run().assertCode().is(200);
-                       
a3.op(op).roles("bar","foo","baz").run().assertCode().is(200);
-                       a3.op(op).run().assertCode().is(403);
-                       a3.op(op).roles("foo").run().assertCode().is(403);
-                       a3.op(op).roles("bar").run().assertCode().is(403);
-                       a3.op(op).roles("foo2").run().assertCode().is(403);
-                       
a3.op(op).roles("foo2","bar").run().assertCode().is(403);
+                       
a3.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
a3.request(op).roles("bar","foo").run().assertCode().is(200);
+                       
a3.request(op).roles("bar","foo","baz").run().assertCode().is(200);
+                       a3.request(op).run().assertCode().is(403);
+                       a3.request(op).roles("foo").run().assertCode().is(403);
+                       a3.request(op).roles("bar").run().assertCode().is(403);
+                       a3.request(op).roles("foo2").run().assertCode().is(403);
+                       
a3.request(op).roles("foo2","bar").run().assertCode().is(403);
                }
        }
 
@@ -219,12 +219,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient a4 = MockRestClient.buildLax(A4b.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       
a4.op(op).roles("foo","bar","baz","qux").run().assertCode().is(200);
-                       
a4.op(op).roles("foo","bar","baz","qux","quux").run().assertCode().is(200);
-                       
a4.op(op).roles("foo","bar","baz").run().assertCode().is(403);
-                       
a4.op(op).roles("foo","bar","qux").run().assertCode().is(403);
-                       
a4.op(op).roles("foo","baz","qux").run().assertCode().is(403);
-                       
a4.op(op).roles("bar","baz","qux").run().assertCode().is(403);
+                       
a4.request(op).roles("foo","bar","baz","qux").run().assertCode().is(200);
+                       
a4.request(op).roles("foo","bar","baz","qux","quux").run().assertCode().is(200);
+                       
a4.request(op).roles("foo","bar","baz").run().assertCode().is(403);
+                       
a4.request(op).roles("foo","bar","qux").run().assertCode().is(403);
+                       
a4.request(op).roles("foo","baz","qux").run().assertCode().is(403);
+                       
a4.request(op).roles("bar","baz","qux").run().assertCode().is(403);
                }
        }
 
@@ -264,12 +264,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient b1a = MockRestClient.buildLax(B1a.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       b1a.op(op).roles("foo").run().assertCode().is(200);
-                       b1a.op(op).roles("bar").run().assertCode().is(200);
-                       
b1a.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
b1a.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       b1a.op(op).roles().run().assertCode().is(403);
-                       b1a.op(op).roles("baz").run().assertCode().is(403);
+                       b1a.request(op).roles("foo").run().assertCode().is(200);
+                       b1a.request(op).roles("bar").run().assertCode().is(200);
+                       
b1a.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
b1a.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       b1a.request(op).roles().run().assertCode().is(403);
+                       b1a.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -281,12 +281,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient b1b = MockRestClient.buildLax(B1b.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       b1b.op(op).roles("foo").run().assertCode().is(200);
-                       b1b.op(op).roles("bar").run().assertCode().is(200);
-                       
b1b.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
b1b.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       b1b.op(op).roles().run().assertCode().is(403);
-                       b1b.op(op).roles("baz").run().assertCode().is(403);
+                       b1b.request(op).roles("foo").run().assertCode().is(200);
+                       b1b.request(op).roles("bar").run().assertCode().is(200);
+                       
b1b.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
b1b.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       b1b.request(op).roles().run().assertCode().is(403);
+                       b1b.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -298,12 +298,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient b1c = MockRestClient.buildLax(B1c.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       b1c.op(op).roles("foo").run().assertCode().is(200);
-                       b1c.op(op).roles("bar").run().assertCode().is(200);
-                       
b1c.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
b1c.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       b1c.op(op).roles().run().assertCode().is(403);
-                       b1c.op(op).roles("baz").run().assertCode().is(403);
+                       b1c.request(op).roles("foo").run().assertCode().is(200);
+                       b1c.request(op).roles("bar").run().assertCode().is(200);
+                       
b1c.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
b1c.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       b1c.request(op).roles().run().assertCode().is(403);
+                       b1c.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -315,12 +315,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient b1d = MockRestClient.buildLax(B1d.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       
b1d.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
b1d.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       b1d.op(op).roles().run().assertCode().is(403);
-                       b1d.op(op).roles("foo").run().assertCode().is(403);
-                       b1d.op(op).roles("bar").run().assertCode().is(403);
-                       b1d.op(op).roles("baz").run().assertCode().is(403);
+                       
b1d.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
b1d.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       b1d.request(op).roles().run().assertCode().is(403);
+                       b1d.request(op).roles("foo").run().assertCode().is(403);
+                       b1d.request(op).roles("bar").run().assertCode().is(403);
+                       b1d.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -332,12 +332,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient b1e = MockRestClient.buildLax(B1e.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       
b1e.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
b1e.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       b1e.op(op).roles().run().assertCode().is(403);
-                       b1e.op(op).roles("foo").run().assertCode().is(403);
-                       b1e.op(op).roles("bar").run().assertCode().is(403);
-                       b1e.op(op).roles("baz").run().assertCode().is(403);
+                       
b1e.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
b1e.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       b1e.request(op).roles().run().assertCode().is(403);
+                       b1e.request(op).roles("foo").run().assertCode().is(403);
+                       b1e.request(op).roles("bar").run().assertCode().is(403);
+                       b1e.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -349,12 +349,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient b1f = MockRestClient.buildLax(B1f.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       
b1f.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
b1f.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       b1f.op(op).roles().run().assertCode().is(403);
-                       b1f.op(op).roles("foo").run().assertCode().is(403);
-                       b1f.op(op).roles("bar").run().assertCode().is(403);
-                       b1f.op(op).roles("baz").run().assertCode().is(403);
+                       
b1f.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
b1f.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       b1f.request(op).roles().run().assertCode().is(403);
+                       b1f.request(op).roles("foo").run().assertCode().is(403);
+                       b1f.request(op).roles("bar").run().assertCode().is(403);
+                       b1f.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -366,13 +366,13 @@ public class Restx_RoleGuard_Test {
                MockRestClient b1g = MockRestClient.buildLax(B1g.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       
b1g.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
b1g.op(op).roles("foo","baz").run().assertCode().is(200);
-                       
b1g.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       b1g.op(op).roles().run().assertCode().is(403);
-                       b1g.op(op).roles("foo").run().assertCode().is(403);
-                       
b1g.op(op).roles("bar","baz").run().assertCode().is(403);
-                       b1g.op(op).roles("baz").run().assertCode().is(403);
+                       
b1g.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
b1g.request(op).roles("foo","baz").run().assertCode().is(200);
+                       
b1g.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       b1g.request(op).roles().run().assertCode().is(403);
+                       b1g.request(op).roles("foo").run().assertCode().is(403);
+                       
b1g.request(op).roles("bar","baz").run().assertCode().is(403);
+                       b1g.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -384,12 +384,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient b1h = MockRestClient.buildLax(B1h.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       b1h.op(op).roles("foo").run().assertCode().is(200);
-                       
b1h.op(op).roles("bar","baz").run().assertCode().is(200);
-                       
b1h.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       b1h.op(op).roles().run().assertCode().is(403);
-                       b1h.op(op).roles("bar").run().assertCode().is(403);
-                       b1h.op(op).roles("baz").run().assertCode().is(403);
+                       b1h.request(op).roles("foo").run().assertCode().is(200);
+                       
b1h.request(op).roles("bar","baz").run().assertCode().is(200);
+                       
b1h.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       b1h.request(op).roles().run().assertCode().is(403);
+                       b1h.request(op).roles("bar").run().assertCode().is(403);
+                       b1h.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -426,12 +426,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient b2a = MockRestClient.buildLax(B2a.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       b2a.op(op).roles("foo").run().assertCode().is(200);
-                       b2a.op(op).roles("bar").run().assertCode().is(200);
-                       
b2a.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
b2a.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       b2a.op(op).roles().run().assertCode().is(403);
-                       b2a.op(op).roles("baz").run().assertCode().is(403);
+                       b2a.request(op).roles("foo").run().assertCode().is(200);
+                       b2a.request(op).roles("bar").run().assertCode().is(200);
+                       
b2a.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
b2a.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       b2a.request(op).roles().run().assertCode().is(403);
+                       b2a.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -464,12 +464,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient b2b = MockRestClient.buildLax(B2b.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       b2b.op(op).roles("foo").run().assertCode().is(200);
-                       b2b.op(op).roles("bar").run().assertCode().is(200);
-                       
b2b.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
b2b.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       b2b.op(op).roles().run().assertCode().is(403);
-                       b2b.op(op).roles("baz").run().assertCode().is(403);
+                       b2b.request(op).roles("foo").run().assertCode().is(200);
+                       b2b.request(op).roles("bar").run().assertCode().is(200);
+                       
b2b.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
b2b.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       b2b.request(op).roles().run().assertCode().is(403);
+                       b2b.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -502,12 +502,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient b2c = MockRestClient.buildLax(B2c.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       b2c.op(op).roles("foo").run().assertCode().is(200);
-                       b2c.op(op).roles("bar").run().assertCode().is(200);
-                       
b2c.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
b2c.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       b2c.op(op).roles().run().assertCode().is(403);
-                       b2c.op(op).roles("baz").run().assertCode().is(403);
+                       b2c.request(op).roles("foo").run().assertCode().is(200);
+                       b2c.request(op).roles("bar").run().assertCode().is(200);
+                       
b2c.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
b2c.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       b2c.request(op).roles().run().assertCode().is(403);
+                       b2c.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -540,12 +540,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient b2d = MockRestClient.buildLax(B2d.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       
b2d.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
b2d.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       b2d.op(op).roles().run().assertCode().is(403);
-                       b2d.op(op).roles("foo").run().assertCode().is(403);
-                       b2d.op(op).roles("bar").run().assertCode().is(403);
-                       b2d.op(op).roles("baz").run().assertCode().is(403);
+                       
b2d.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
b2d.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       b2d.request(op).roles().run().assertCode().is(403);
+                       b2d.request(op).roles("foo").run().assertCode().is(403);
+                       b2d.request(op).roles("bar").run().assertCode().is(403);
+                       b2d.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -578,12 +578,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient b2e = MockRestClient.buildLax(B2e.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       
b2e.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
b2e.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       b2e.op(op).roles().run().assertCode().is(403);
-                       b2e.op(op).roles("foo").run().assertCode().is(403);
-                       b2e.op(op).roles("bar").run().assertCode().is(403);
-                       b2e.op(op).roles("baz").run().assertCode().is(403);
+                       
b2e.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
b2e.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       b2e.request(op).roles().run().assertCode().is(403);
+                       b2e.request(op).roles("foo").run().assertCode().is(403);
+                       b2e.request(op).roles("bar").run().assertCode().is(403);
+                       b2e.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -681,12 +681,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient c1a = MockRestClient.buildLax(C1a.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       c1a.op(op).roles("foo").run().assertCode().is(200);
-                       c1a.op(op).roles("bar").run().assertCode().is(200);
-                       
c1a.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
c1a.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       c1a.op(op).roles().run().assertCode().is(403);
-                       c1a.op(op).roles("baz").run().assertCode().is(403);
+                       c1a.request(op).roles("foo").run().assertCode().is(200);
+                       c1a.request(op).roles("bar").run().assertCode().is(200);
+                       
c1a.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
c1a.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       c1a.request(op).roles().run().assertCode().is(403);
+                       c1a.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -698,12 +698,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient c1b = MockRestClient.buildLax(C1b.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       c1b.op(op).roles("foo").run().assertCode().is(200);
-                       c1b.op(op).roles("bar").run().assertCode().is(200);
-                       
c1b.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
c1b.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       c1b.op(op).roles().run().assertCode().is(403);
-                       c1b.op(op).roles("baz").run().assertCode().is(403);
+                       c1b.request(op).roles("foo").run().assertCode().is(200);
+                       c1b.request(op).roles("bar").run().assertCode().is(200);
+                       
c1b.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
c1b.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       c1b.request(op).roles().run().assertCode().is(403);
+                       c1b.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -715,12 +715,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient c1c = MockRestClient.buildLax(C1c.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       c1c.op(op).roles("foo").run().assertCode().is(200);
-                       c1c.op(op).roles("bar").run().assertCode().is(200);
-                       
c1c.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
c1c.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       c1c.op(op).roles().run().assertCode().is(403);
-                       c1c.op(op).roles("baz").run().assertCode().is(403);
+                       c1c.request(op).roles("foo").run().assertCode().is(200);
+                       c1c.request(op).roles("bar").run().assertCode().is(200);
+                       
c1c.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
c1c.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       c1c.request(op).roles().run().assertCode().is(403);
+                       c1c.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -732,12 +732,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient c1d = MockRestClient.buildLax(C1d.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       
c1d.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
c1d.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       c1d.op(op).roles().run().assertCode().is(403);
-                       c1d.op(op).roles("foo").run().assertCode().is(403);
-                       c1d.op(op).roles("bar").run().assertCode().is(403);
-                       c1d.op(op).roles("baz").run().assertCode().is(403);
+                       
c1d.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
c1d.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       c1d.request(op).roles().run().assertCode().is(403);
+                       c1d.request(op).roles("foo").run().assertCode().is(403);
+                       c1d.request(op).roles("bar").run().assertCode().is(403);
+                       c1d.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -749,12 +749,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient c1e = MockRestClient.buildLax(C1e.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       
c1e.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
c1e.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       c1e.op(op).roles().run().assertCode().is(403);
-                       c1e.op(op).roles("foo").run().assertCode().is(403);
-                       c1e.op(op).roles("bar").run().assertCode().is(403);
-                       c1e.op(op).roles("baz").run().assertCode().is(403);
+                       
c1e.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
c1e.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       c1e.request(op).roles().run().assertCode().is(403);
+                       c1e.request(op).roles("foo").run().assertCode().is(403);
+                       c1e.request(op).roles("bar").run().assertCode().is(403);
+                       c1e.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -766,12 +766,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient c1f = MockRestClient.buildLax(C1f.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       
c1f.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
c1f.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       c1f.op(op).roles().run().assertCode().is(403);
-                       c1f.op(op).roles("foo").run().assertCode().is(403);
-                       c1f.op(op).roles("bar").run().assertCode().is(403);
-                       c1f.op(op).roles("baz").run().assertCode().is(403);
+                       
c1f.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
c1f.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       c1f.request(op).roles().run().assertCode().is(403);
+                       c1f.request(op).roles("foo").run().assertCode().is(403);
+                       c1f.request(op).roles("bar").run().assertCode().is(403);
+                       c1f.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -783,13 +783,13 @@ public class Restx_RoleGuard_Test {
                MockRestClient c1g = MockRestClient.buildLax(C1g.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       
c1g.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
c1g.op(op).roles("foo","baz").run().assertCode().is(200);
-                       
c1g.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       c1g.op(op).roles().run().assertCode().is(403);
-                       c1g.op(op).roles("foo").run().assertCode().is(403);
-                       
c1g.op(op).roles("bar","baz").run().assertCode().is(403);
-                       c1g.op(op).roles("baz").run().assertCode().is(403);
+                       
c1g.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
c1g.request(op).roles("foo","baz").run().assertCode().is(200);
+                       
c1g.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       c1g.request(op).roles().run().assertCode().is(403);
+                       c1g.request(op).roles("foo").run().assertCode().is(403);
+                       
c1g.request(op).roles("bar","baz").run().assertCode().is(403);
+                       c1g.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -801,12 +801,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient c1h = MockRestClient.buildLax(C1h.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       c1h.op(op).roles("foo").run().assertCode().is(200);
-                       
c1h.op(op).roles("bar","baz").run().assertCode().is(200);
-                       
c1h.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       c1h.op(op).roles().run().assertCode().is(403);
-                       c1h.op(op).roles("bar").run().assertCode().is(403);
-                       c1h.op(op).roles("baz").run().assertCode().is(403);
+                       c1h.request(op).roles("foo").run().assertCode().is(200);
+                       
c1h.request(op).roles("bar","baz").run().assertCode().is(200);
+                       
c1h.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       c1h.request(op).roles().run().assertCode().is(403);
+                       c1h.request(op).roles("bar").run().assertCode().is(403);
+                       c1h.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -843,12 +843,12 @@ public class Restx_RoleGuard_Test {
                MockRestClient c2a = MockRestClient.buildLax(C2a.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       c2a.op(op).roles("foo").run().assertCode().is(200);
-                       c2a.op(op).roles("bar").run().assertCode().is(200);
-                       
c2a.op(op).roles("foo","bar").run().assertCode().is(200);
-                       
c2a.op(op).roles("foo","bar","baz").run().assertCode().is(200);
-                       c2a.op(op).roles().run().assertCode().is(403);
-                       c2a.op(op).roles("baz").run().assertCode().is(403);
+                       c2a.request(op).roles("foo").run().assertCode().is(200);
+                       c2a.request(op).roles("bar").run().assertCode().is(200);
+                       
c2a.request(op).roles("foo","bar").run().assertCode().is(200);
+                       
c2a.request(op).roles("foo","bar","baz").run().assertCode().is(200);
+                       c2a.request(op).roles().run().assertCode().is(403);
+                       c2a.request(op).roles("baz").run().assertCode().is(403);
                }
        }
 
@@ -1019,11 +1019,11 @@ public class Restx_RoleGuard_Test {
                MockRestClient d = MockRestClient.buildLax(D.class);
 
                for (RestOperation op : 
ops(op("get","/a"),op("get","/b"),op("put","/c"),op("post","/d"),op("delete","/e")))
 {
-                       d.op(op).roles().run().assertCode().is(403);
-                       d.op(op).roles("foo").run().assertCode().is(403);
-                       d.op(op).roles("bar").run().assertCode().is(403);
-                       d.op(op).roles("baz").run().assertCode().is(403);
-                       d.op(op).roles("foo","bar").run().assertCode().is(403);
+                       d.request(op).roles().run().assertCode().is(403);
+                       d.request(op).roles("foo").run().assertCode().is(403);
+                       d.request(op).roles("bar").run().assertCode().is(403);
+                       d.request(op).roles("baz").run().assertCode().is(403);
+                       
d.request(op).roles("foo","bar").run().assertCode().is(403);
                }
        }
 
diff --git 
a/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Response_Body_Test.java
 
b/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Response_Body_Test.java
index 3952da5..65c7774 100644
--- 
a/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Response_Body_Test.java
+++ 
b/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Response_Body_Test.java
@@ -285,8 +285,8 @@ public class RestClient_Response_Body_Test {
                InputStreamEntity x3 = inputStreamEntity("foo");
                x3.setContentType("text/foo");
                x3.setContentEncoding("identity");
-               testClient().entity(x3).get().run().getBody().toResponse()
-                       .getBody().getContentType().assertValue().is("text/foo")
+               testClient().entity(x3).get().run().getBody().response()
+                       
.getBody().getContentType().assertValue().is("text/foo").response()
                        
.getBody().getContentEncoding().assertValue().is("identity");
 
                InputStream x4 = 
testClient().entity(inputStreamEntity("foo")).get().run().getBody().asInputStream();
diff --git 
a/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Response_Headers_Test.java
 
b/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Response_Headers_Test.java
index 4eb867a..6dbc18c 100644
--- 
a/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Response_Headers_Test.java
+++ 
b/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Response_Headers_Test.java
@@ -154,7 +154,7 @@ public class RestClient_Response_Headers_Test {
        @Test
        public void a05_toResponse() throws Exception {
                RestResponse r = 
checkFooClient().build().get("/echo").header("Foo","123").run();
-               assertTrue(r == r.getResponseHeader("Foo").toResponse());
+               assertTrue(r == r.getResponseHeader("Foo").response());
        }
 
        
//------------------------------------------------------------------------------------------------------------------

Reply via email to