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 41f9e86 REST refactoring.
41f9e86 is described below
commit 41f9e866a90f1d2dd878c8f0e03078febb75501c
Author: JamesBognar <[email protected]>
AuthorDate: Sun Jan 24 14:09:55 2021 -0500
REST refactoring.
---
.../java/org/apache/juneau/rest/mock/MockRestClient.java | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
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 775ef25..1d93a96 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
@@ -229,9 +229,7 @@ public class MockRestClient extends RestClient implements
HttpClientConnection {
MOCKRESTCLIENT_pathVars = PREFIX + "pathVars.oms";
- private static Map<Class<?>,RestContext>
- CONTEXTS_DEBUG = new ConcurrentHashMap<>(),
- CONTEXTS_NORMAL = new ConcurrentHashMap<>();
+ private static Map<Class<?>,RestContext> REST_CONTEXTS = new
ConcurrentHashMap<>();
//-------------------------------------------------------------------------------------------------------------------
// Instance properties
@@ -274,11 +272,9 @@ public class MockRestClient extends RestClient implements
HttpClientConnection {
String contextPath =
ps.getProperty(MOCKRESTCLIENT_contextPath, String.class, null);
String servletPath =
ps.getProperty(MOCKRESTCLIENT_servletPath, String.class, null);
String rootUrl = ps.getProperty(RESTCLIENT_rootUri,
String.class, "http://localhost");
- boolean isDebug = ps.getProperty(CONTEXT_debug,
Boolean.class, false);
Class<?> c = restBean instanceof Class ?
(Class<?>)restBean : restBean.getClass();
- Map<Class<?>,RestContext> contexts = isDebug ?
CONTEXTS_DEBUG : CONTEXTS_NORMAL;
- if (! contexts.containsKey(c)) {
+ if (! REST_CONTEXTS.containsKey(c)) {
boolean isClass = restBean instanceof Class;
Object o = isClass ?
((Class<?>)restBean).newInstance() : restBean;
RestContext rc = RestContext
@@ -288,9 +284,9 @@ public class MockRestClient extends RestClient implements
HttpClientConnection {
.build()
.postInit()
.postInitChildFirst();
- contexts.put(c, rc);
+ REST_CONTEXTS.put(c, rc);
}
- RestContext restBeanCtx = contexts.get(c);
+ RestContext restBeanCtx = REST_CONTEXTS.get(c);
psb.set(MOCKRESTCLIENT_restBeanCtx, restBeanCtx);
if (servletPath == null)