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 10fbdc8 RestClient tests.
10fbdc8 is described below
commit 10fbdc8f01a5fced232261d7ee6acf320226cd3a
Author: JamesBognar <[email protected]>
AuthorDate: Sat Jun 13 17:03:10 2020 -0400
RestClient tests.
---
.../org/apache/juneau/reflect/ConstructorInfo.java | 10 +++
.../org/apache/juneau/reflect/ExecutableInfo.java | 5 ++
.../java/org/apache/juneau/reflect/MethodInfo.java | 10 +++
.../main/ConfigurablePropertyCodeGenerator.java | 5 +-
.../juneau/rest/client2/InterfaceProxyTest.java | 4 +-
.../apache/juneau/rest/client2/RemotesTest.java | 67 ++++++++++++++++--
.../juneau/rest/client2/RequestBeanProxyTest.java | 50 ++++++++++---
.../org/apache/juneau/rest/client2/RestClient.java | 8 +--
.../apache/juneau/rest/mock2/MockRestClient.java | 82 +++++++++++++++++++++-
.../juneau/rest/mock2/MockRestClientBuilder.java | 1 -
.../org/apache/juneau/rest/StatusCodesTest.java | 6 +-
.../rest/annotation/RestMethodGuardsTest.java | 2 +-
.../rest/annotation/RestResourceLoggingTest.java | 2 +-
.../annotation/RestResourceSerializersTest.java | 2 +-
.../annotation/RestResourceStaticFilesTest.java | 2 +-
.../rest/annotation2/BodyAnnotationTest.java | 10 +--
.../rest/annotation2/PathAnnotationTest.java | 14 ++--
.../rest/annotation2/ResponseAnnotationTest.java | 6 +-
.../rest/annotation2/RestResourceParsersTest.java | 2 +-
.../juneau/rest/annotation2/RoleGuardTest.java | 76 ++++++++++----------
.../apache/juneau/rest/exceptions/BasicTest.java | 14 ++--
.../juneau/rest/headers/AcceptCharsetTest.java | 2 +-
.../juneau/rest/headers/AcceptEncodingTest.java | 4 +-
.../org/apache/juneau/rest/headers/AcceptTest.java | 10 +--
.../juneau/rest/headers/ContentEncodingTest.java | 2 +-
.../juneau/rest/headers/ContentTypeTest.java | 8 +--
.../apache/juneau/rest/responses/BasicTest.java | 4 +-
27 files changed, 300 insertions(+), 108 deletions(-)
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/reflect/ConstructorInfo.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/reflect/ConstructorInfo.java
index 8b93b7b..367a18b 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/reflect/ConstructorInfo.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/reflect/ConstructorInfo.java
@@ -175,4 +175,14 @@ public final class ConstructorInfo extends ExecutableInfo
implements Comparable<
}
return i;
}
+
+ // <FluentSetters>
+
+ @Override /* GENERATED - ExecutableInfo */
+ public ConstructorInfo accessible() {
+ super.accessible();
+ return this;
+ }
+
+ // </FluentSetters>
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/reflect/ExecutableInfo.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/reflect/ExecutableInfo.java
index b60ac3e..a8d24af 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/reflect/ExecutableInfo.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/reflect/ExecutableInfo.java
@@ -688,6 +688,7 @@ public abstract class ExecutableInfo {
*
* @return This object (for method chaining).
*/
+ @FluentSetter
public ExecutableInfo accessible() {
setAccessible();
return this;
@@ -827,4 +828,8 @@ public abstract class ExecutableInfo {
public String toString() {
return getShortName();
}
+
+ // <FluentSetters>
+
+ // </FluentSetters>
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/reflect/MethodInfo.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/reflect/MethodInfo.java
index 96635cc..c2bfe43 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/reflect/MethodInfo.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/reflect/MethodInfo.java
@@ -580,4 +580,14 @@ public final class MethodInfo extends ExecutableInfo
implements Comparable<Metho
}
return i;
}
+
+ // <FluentSetters>
+
+ @Override /* GENERATED - ExecutableInfo */
+ public MethodInfo accessible() {
+ super.accessible();
+ return this;
+ }
+
+ // </FluentSetters>
}
diff --git
a/juneau-releng/juneau-all/src/java/main/ConfigurablePropertyCodeGenerator.java
b/juneau-releng/juneau-all/src/java/main/ConfigurablePropertyCodeGenerator.java
index 9781e10..9e96693 100644
---
a/juneau-releng/juneau-all/src/java/main/ConfigurablePropertyCodeGenerator.java
+++
b/juneau-releng/juneau-all/src/java/main/ConfigurablePropertyCodeGenerator.java
@@ -168,7 +168,10 @@ public class ConfigurablePropertyCodeGenerator {
FluentStringAssertion.class,
ReaderResourceBuilder.class,
StreamResourceBuilder.class,
- ResolvingResourceReaderBuilder.class
+ ResolvingResourceReaderBuilder.class,
+ ExecutableInfo.class,
+ ConstructorInfo.class,
+ MethodInfo.class
};
private static String[] SOURCE_PATHS = {
diff --git
a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/InterfaceProxyTest.java
b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/InterfaceProxyTest.java
index 04e94d0..f87f012 100644
---
a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/InterfaceProxyTest.java
+++
b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/InterfaceProxyTest.java
@@ -219,14 +219,14 @@ public class InterfaceProxyTest {
//-------------------------------------------------------------------------------------------------------------
@SuppressWarnings("serial")
- public static class InterfaceProxyException1 extends Throwable {
+ public static class InterfaceProxyException1 extends Exception {
public InterfaceProxyException1(String msg) {
super(msg);
}
}
@SuppressWarnings("serial")
- public static class InterfaceProxyException2 extends Throwable {
+ public static class InterfaceProxyException2 extends Exception {
}
}
diff --git
a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/RemotesTest.java
b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/RemotesTest.java
index 7322a57..068e18b 100644
---
a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/RemotesTest.java
+++
b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/RemotesTest.java
@@ -284,30 +284,54 @@ public class RemotesTest {
@Rest(path="/C01")
public static class C01 implements BasicSimpleJsonRest {
- @RestMethod(path="c01")
+ @RestMethod
public String c01() {
return "foo";
}
- @RestMethod(path="c02")
+ @RestMethod
public String c02() {
return "bar";
}
- @RestMethod(path="c03")
+ @RestMethod
public String c03() {
return "baz";
}
+
+ @RestMethod
+ public String c04() throws C01Exception {
+ throw new C01Exception("foo");
+ }
+
+ @RestMethod
+ public String c05() throws C02Exception {
+ throw new C02Exception("foo");
+ }
}
@Remote(path="/")
public static interface C01i {
@RemoteMethod
public String c01();
-
public String c02();
-
public String getC03();
+ public String c04() throws C01Exception;
+ public String c05();
+ }
+
+ @SuppressWarnings("serial")
+ public static class C01Exception extends Exception {
+ public C01Exception(String msg) {
+ super(msg);
+ }
+ }
+
+ @SuppressWarnings("serial")
+ public static class C02Exception extends Exception {
+ public C02Exception(String msg) {
+ super(msg);
+ }
}
@Test
@@ -349,4 +373,37 @@ public class RemotesTest {
assertEquals("Invalid remote definition found on class
org.apache.juneau.rest.client2.RemotesTest$C01i. Root URI has not been
specified. Cannot construct absolute path to remote resource.",
e.getLocalizedMessage());
}
}
+
+// @Test
+// public void c04_rethrownException() throws Exception {
+// C01i x = MockRestClient
+// .create(C01.class)
+// .json()
+// .build()
+// .getRemote(C01i.class);
+//
+// try {
+// x.c04();
+// fail();
+// } catch (C01Exception e) {
+// assertEquals("foo", e.getLocalizedMessage());
+// }
+// }
+//
+//
+// @Test
+// public void c05_rethrownUndefinedException() throws Exception {
+// C01i x = MockRestClient
+// .create(C01.class)
+// .json()
+// .build()
+// .getRemote(C01i.class);
+//
+// try {
+// x.c05();
+// fail();
+// } catch (RuntimeException e) {
+// assertEquals("foo", e.getLocalizedMessage());
+// }
+// }
}
diff --git
a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/RequestBeanProxyTest.java
b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/RequestBeanProxyTest.java
index 453b644..ac5f8c3 100644
---
a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/RequestBeanProxyTest.java
+++
b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/RequestBeanProxyTest.java
@@ -75,6 +75,9 @@ public class RequestBeanProxyTest {
@Query("f") String getX5();
@Query("g") String getX6();
@Query("h") String getX7();
+ @Query(n="i1",sie=true) String getX8();
+ @Query(n="i2",sie=true) String getX9();
+ @Query(n="i3",sie=true) String getX10();
}
public static class A01_BeanImpl implements A01_BeanInterface {
@@ -85,6 +88,9 @@ public class RequestBeanProxyTest {
@Override public String getX5() { return null; }
@Override public String getX6() { return "true"; }
@Override public String getX7() { return "123"; }
+ @Override public String getX8() { return "foo"; }
+ @Override public String getX9() { return ""; }
+ @Override public String getX10() { return null; }
}
static A01_RemoteResource a01a =
MockRestClient.build(A.class).getRemote(A01_RemoteResource.class);
@@ -92,15 +98,15 @@ public class RequestBeanProxyTest {
@Test
public void a01a_query_simpleVals_plainText() throws Exception {
- assertEquals("{a:'a1',b:'b1',c:'c1',e:'',g:'true',h:'123'}",
a01a.normal(new A01_BeanImpl()));
+
assertEquals("{a:'a1',b:'b1',c:'c1',e:'',g:'true',h:'123',i1:'foo'}",
a01a.normal(new A01_BeanImpl()));
}
@Test
public void a01b_query_simpleVals_uon() throws Exception {
-
assertEquals("{a:'a1',b:'b1',c:'c1',e:'',g:'\\'true\\'',h:'\\'123\\''}",
a01b.normal(new A01_BeanImpl()));
+
assertEquals("{a:'a1',b:'b1',c:'c1',e:'',g:'\\'true\\'',h:'\\'123\\'',i1:'foo'}",
a01b.normal(new A01_BeanImpl()));
}
@Test
public void a01c_query_simpleVals_x() throws Exception {
-
assertEquals("{a:'xa1x',b:'xb1x',c:'xc1x',e:'xx',g:'xtruex',h:'x123x'}",
a01b.serialized(new A01_BeanImpl()));
+
assertEquals("{a:'xa1x',b:'xb1x',c:'xc1x',e:'xx',g:'xtruex',h:'x123x',i1:'xfoox'}",
a01b.serialized(new A01_BeanImpl()));
}
//=================================================================================================================
@@ -384,6 +390,18 @@ public class RequestBeanProxyTest {
public String getX7() {
return "123";
}
+ @FormData(n="i1",sie=true)
+ public String getX8() {
+ return "foo";
+ }
+ @FormData(n="i2",sie=true)
+ public String getX9() {
+ return "";
+ }
+ @FormData(n="i3",sie=true)
+ public String getX10() {
+ return null;
+ }
}
static C01_RemoteResource c01a =
MockRestClient.build(C.class).getRemote(C01_RemoteResource.class);
@@ -392,17 +410,17 @@ public class RequestBeanProxyTest {
@Test
public void c01a_formData_simpleVals_plainText() throws Exception {
String r = c01a.normal(new C01_Bean());
- assertEquals("{a:'a1',b:'b1',c:'c1',e:'',g:'true',h:'123'}", r);
+
assertEquals("{a:'a1',b:'b1',c:'c1',e:'',g:'true',h:'123',i1:'foo'}", r);
}
@Test
public void c01b_formData_simpleVals_uon() throws Exception {
String r = c01b.normal(new C01_Bean());
-
assertEquals("{a:'a1',b:'b1',c:'c1',e:'',g:'\\'true\\'',h:'\\'123\\''}", r);
+
assertEquals("{a:'a1',b:'b1',c:'c1',e:'',g:'\\'true\\'',h:'\\'123\\'',i1:'foo'}",
r);
}
@Test
public void c01c_formData_simpleVals_x() throws Exception {
String r = c01b.serialized(new C01_Bean());
-
assertEquals("{a:'xa1x',b:'xb1x',c:'xc1x',e:'xx',g:'xtruex',h:'x123x'}", r);
+
assertEquals("{a:'xa1x',b:'xb1x',c:'xc1x',e:'xx',g:'xtruex',h:'x123x',i1:'xfoox'}",
r);
}
//=================================================================================================================
@@ -640,7 +658,7 @@ public class RequestBeanProxyTest {
public static class E {
@RestMethod(name=GET)
public String echoHeaders(RestRequest req) throws Exception {
- return
req.getHeaders().subset("a,b,c,d,e,f,g,h,i,a1,a2,a3,a4,b1,b2,b3,b4,c1,c2,c3,c4").toString(true);
+ return
req.getHeaders().subset("a,b,c,d,e,f,g,h,i,i1,i2,i3,a1,a2,a3,a4,b1,b2,b3,b4,c1,c2,c3,c4").toString(true);
}
}
@@ -687,6 +705,18 @@ public class RequestBeanProxyTest {
public String getX7() {
return "123";
}
+ @Header(n="i1",sie=true)
+ public String getX8() {
+ return "foo";
+ }
+ @Header(n="i2",sie=true)
+ public String getX9() {
+ return "";
+ }
+ @Header(n="i3",sie=true)
+ public String getX10() {
+ return null;
+ }
}
static E01_RemoteResource e01a =
MockRestClient.build(E.class).getRemote(E01_RemoteResource.class);
@@ -695,17 +725,17 @@ public class RequestBeanProxyTest {
@Test
public void e01a_headerSimpleValsPlainText() throws Exception {
String r = e01a.normal(new E01_Bean());
- assertEquals("{a:'a1',b:'b1',c:'c1',e:'',g:'true',h:'123'}", r);
+
assertEquals("{a:'a1',b:'b1',c:'c1',e:'',g:'true',h:'123',i1:'foo'}", r);
}
@Test
public void e01b_headerSimpleValsUon() throws Exception {
String r = e01b.normal(new E01_Bean());
-
assertEquals("{a:'a1',b:'b1',c:'c1',e:'',g:'\\'true\\'',h:'\\'123\\''}", r);
+
assertEquals("{a:'a1',b:'b1',c:'c1',e:'',g:'\\'true\\'',h:'\\'123\\'',i1:'foo'}",
r);
}
@Test
public void e01c_headerSimpleValsX() throws Exception {
String r = e01b.serialized(new E01_Bean());
-
assertEquals("{a:'xa1x',b:'xb1x',c:'xc1x',e:'xx',g:'xtruex',h:'x123x'}", r);
+
assertEquals("{a:'xa1x',b:'xb1x',c:'xc1x',e:'xx',g:'xtruex',h:'x123x',i1:'xfoox'}",
r);
}
//=================================================================================================================
diff --git
a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client2/RestClient.java
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client2/RestClient.java
index ae2edec..39d1893 100644
---
a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client2/RestClient.java
+++
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client2/RestClient.java
@@ -3002,16 +3002,16 @@ public class RestClient extends BeanContext implements
HttpClient, Closeable, Re
HttpPartSerializerSession ps = p.getSerializer(s);
String pn = p.getPartName();
HttpPartSchema schema = p.getSchema();
-
boolean sie = schema.isSkipIfEmpty();
+
EnumSet<AddFlag> flags = schema.isSkipIfEmpty() ? SKIP_IF_EMPTY_FLAGS :
DEFAULT_FLAGS;
if (pt == PATH)
rc.path(pn, val, schema, p.getSerializer(s));
else if (val != null) {
if (pt == QUERY)
-
rc.query(sie ? SKIP_IF_EMPTY_FLAGS : DEFAULT_FLAGS, pn,
val, schema, ps);
+
rc.query(flags, pn, val, schema, ps);
else if (pt == FORMDATA)
-
rc.formData(sie ? SKIP_IF_EMPTY_FLAGS : DEFAULT_FLAGS,
pn, val, schema, ps);
+
rc.formData(flags, pn, val, schema, ps);
else if (pt == HEADER)
-
rc.header(sie ? SKIP_IF_EMPTY_FLAGS : DEFAULT_FLAGS,
pn, val, schema, ps);
+
rc.header(flags, pn, val, schema, ps);
else /* (pt == HttpPartType.BODY) */
rc.body(val, schema);
}
diff --git
a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockRestClient.java
b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockRestClient.java
index bd44843..d512f23 100644
---
a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockRestClient.java
+++
b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockRestClient.java
@@ -317,6 +317,21 @@ public class MockRestClient extends RestClient implements
HttpClientConnection {
}
/**
+ * Creates a new {@link RestClientBuilder} configured with the
specified REST implementation bean or bean class.
+ *
+ * <p>
+ * Same as {@link #create(Object)} but HTTP 400+ codes don't trigger
{@link RestCallException RestCallExceptions}.
+ *
+ * @param impl
+ * The REST bean or bean class annotated with {@link Rest @Rest}.
+ * <br>If a class, it must have a no-arg constructor.
+ * @return A new builder.
+ */
+ public static MockRestClientBuilder createLax(Object impl) {
+ return new
MockRestClientBuilder().restBean(impl).ignoreErrors();
+ }
+
+ /**
* Creates a new {@link RestClient} with no registered serializer or
parser.
*
* <p>
@@ -335,6 +350,27 @@ public class MockRestClient extends RestClient implements
HttpClientConnection {
}
/**
+ * Creates a new {@link RestClient} with no registered serializer or
parser.
+ *
+ * <p>
+ * Same as {@link #build(Object)} but HTTP 400+ codes don't trigger
{@link RestCallException RestCallExceptions}.
+ *
+ * <p>
+ * Equivalent to calling:
+ * <p class='bcode w800'>
+ * MockRestClient.create(impl).ignoreErrors().build();
+ * </p>
+ *
+ * @param impl
+ * The REST bean or bean class annotated with {@link Rest @Rest}.
+ * <br>If a class, it must have a no-arg constructor.
+ * @return A new builder.
+ */
+ public static MockRestClient buildLax(Object impl) {
+ return create(impl).ignoreErrors().build();
+ }
+
+ /**
* Creates a new {@link RestClient} with JSON marshalling support.
*
* <p>
@@ -349,7 +385,28 @@ public class MockRestClient extends RestClient implements
HttpClientConnection {
* @return A new builder.
*/
public static MockRestClient buildJson(Object impl) {
- return create(impl).json().build(MockRestClient.class);
+ return create(impl).json().build();
+ }
+
+ /**
+ * Creates a new {@link RestClient} with JSON marshalling support.
+ *
+ * <p>
+ * Same as {@link #buildJson(Object)} but HTTP 400+ codes don't trigger
{@link RestCallException RestCallExceptions}.
+ *
+ * <p>
+ * Equivalent to calling:
+ * <p class='bcode w800'>
+ * MockRestClient.create(impl).json().ignoreErrors().build();
+ * </p>
+ *
+ * @param impl
+ * The REST bean or bean class annotated with {@link Rest @Rest}.
+ * <br>If a class, it must have a no-arg constructor.
+ * @return A new builder.
+ */
+ public static MockRestClient buildJsonLax(Object impl) {
+ return create(impl).json().ignoreErrors().build();
}
/**
@@ -367,7 +424,28 @@ public class MockRestClient extends RestClient implements
HttpClientConnection {
* @return A new builder.
*/
public static MockRestClient buildSimpleJson(Object impl) {
- return create(impl).simpleJson().build(MockRestClient.class);
+ return create(impl).simpleJson().build();
+ }
+
+ /**
+ * Creates a new {@link RestClient} with Simplified-JSON marshalling
support.
+ *
+ * <p>
+ * Same as {@link #buildSimpleJson(Object)} but HTTP 400+ codes don't
trigger {@link RestCallException RestCallExceptions}.
+ *
+ * <p>
+ * Equivalent to calling:
+ * <p class='bcode w800'>
+ * MockRestClient.create(impl).json().ignoreErrors().build();
+ * </p>
+ *
+ * @param impl
+ * The REST bean or bean class annotated with {@link Rest @Rest}.
+ * <br>If a class, it must have a no-arg constructor.
+ * @return A new builder.
+ */
+ public static MockRestClient buildSimpleJsonLax(Object impl) {
+ return create(impl).simpleJson().ignoreErrors().build();
}
//------------------------------------------------------------------------------------------------------------------
diff --git
a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockRestClientBuilder.java
b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockRestClientBuilder.java
index 8739c14..72cbead 100644
---
a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockRestClientBuilder.java
+++
b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockRestClientBuilder.java
@@ -81,7 +81,6 @@ public class MockRestClientBuilder extends RestClientBuilder {
*/
protected MockRestClientBuilder() {
super(null);
- ignoreErrors();
}
/**
diff --git
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/StatusCodesTest.java
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/StatusCodesTest.java
index b607352..db303e4 100644
---
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/StatusCodesTest.java
+++
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/StatusCodesTest.java
@@ -106,7 +106,7 @@ public class StatusCodesTest {
return "OK";
}
}
- private static MockRestClient b = MockRestClient.build(B.class);
+ private static MockRestClient b = MockRestClient.buildLax(B.class);
@Test
public void b01a_nonExistentBeanProperties() throws Exception {
@@ -211,7 +211,7 @@ public class StatusCodesTest {
return "OK";
}
}
- private static MockRestClient c = MockRestClient.build(C.class);
+ private static MockRestClient c = MockRestClient.buildLax(C.class);
@Test
public void c01_badPath() throws Exception {
@@ -248,7 +248,7 @@ public class StatusCodesTest {
}
}
}
- private static MockRestClient d = MockRestClient.build(D.class);
+ private static MockRestClient d = MockRestClient.buildLax(D.class);
@Test
public void d01() throws Exception {
diff --git
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestMethodGuardsTest.java
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestMethodGuardsTest.java
index d7c5c53..961d1a5 100644
---
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestMethodGuardsTest.java
+++
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestMethodGuardsTest.java
@@ -48,7 +48,7 @@ public class RestMethodGuardsTest {
}
}
}
- static MockRestClient a = MockRestClient.build(A.class);
+ static MockRestClient a = MockRestClient.buildLax(A.class);
@Test
public void a01_overlappingOneGuard() throws Exception {
diff --git
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceLoggingTest.java
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceLoggingTest.java
index 879536c..90e2a92 100644
---
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceLoggingTest.java
+++
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceLoggingTest.java
@@ -669,7 +669,7 @@ public class RestResourceLoggingTest {
}
}
- static MockRestClient MY_REST = MockRestClient.build(MyRestClass.class);
+ static MockRestClient MY_REST =
MockRestClient.buildLax(MyRestClass.class);
@Test
public void test() throws Exception {
diff --git
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceSerializersTest.java
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceSerializersTest.java
index dc554e9..8895566 100644
---
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceSerializersTest.java
+++
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceSerializersTest.java
@@ -117,7 +117,7 @@ public class RestResourceSerializersTest {
return "test406";
}
}
- static MockRestClient a = MockRestClient.build(A.class);
+ static MockRestClient a = MockRestClient.buildLax(A.class);
@Test
public void a01_serializerOnClass() throws Exception {
diff --git
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceStaticFilesTest.java
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceStaticFilesTest.java
index 66c7495..f09681d 100644
---
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceStaticFilesTest.java
+++
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceStaticFilesTest.java
@@ -31,7 +31,7 @@ public class RestResourceStaticFilesTest {
return null;
}
}
- static MockRestClient a1 = MockRestClient.build(A1.class);
+ static MockRestClient a1 = MockRestClient.buildLax(A1.class);
@Test
public void a01a() throws Exception {
diff --git
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/BodyAnnotationTest.java
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/BodyAnnotationTest.java
index 14b20ea..8d6acd0 100644
---
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/BodyAnnotationTest.java
+++
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/BodyAnnotationTest.java
@@ -127,7 +127,7 @@ public class BodyAnnotationTest {
@Override public String toString() { return s; }
}
}
- private static MockRestClient a = MockRestClient.build(A.class);
+ private static MockRestClient a = MockRestClient.buildLax(A.class);
@Test
public void a01a_onParameter_String() throws Exception {
@@ -383,7 +383,7 @@ public class BodyAnnotationTest {
@Override public String toString() { return s; }
}
}
- private static MockRestClient b = MockRestClient.build(B.class);
+ private static MockRestClient b = MockRestClient.buildLax(B.class);
@Test
public void b01a_onPojo_StringTransform() throws Exception {
@@ -730,7 +730,7 @@ public class BodyAnnotationTest {
@Override public String toString() { return s; }
}
}
- private static MockRestClient d = MockRestClient.build(D.class);
+ private static MockRestClient d = MockRestClient.buildLax(D.class);
@Test
public void d01a_noMediaTypes_String() throws Exception {
@@ -1113,7 +1113,7 @@ public class BodyAnnotationTest {
return content;
}
}
- static MockRestClient i = MockRestClient.build(I.class);
+ static MockRestClient i = MockRestClient.buildLax(I.class);
@Test
public void i01() throws Exception {
@@ -1135,7 +1135,7 @@ public class BodyAnnotationTest {
return content;
}
}
- static MockRestClient i2 = MockRestClient.build(I2.class);
+ static MockRestClient i2 = MockRestClient.buildLax(I2.class);
@Test
public void i02() throws Exception {
diff --git
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/PathAnnotationTest.java
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/PathAnnotationTest.java
index b96e3db..32fedf6 100644
---
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/PathAnnotationTest.java
+++
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/PathAnnotationTest.java
@@ -60,7 +60,7 @@ public class PathAnnotationTest {
return "GET /a "+foo+","+bar+",r="+remainder;
}
}
- static MockRestClient a = MockRestClient.build(A.class);
+ static MockRestClient a = MockRestClient.buildLax(A.class);
@Test
public void a00_nonExistentPath() throws Exception {
@@ -154,7 +154,7 @@ public class PathAnnotationTest {
return String.valueOf(x);
}
}
- static MockRestClient b = MockRestClient.build(B.class);
+ static MockRestClient b = MockRestClient.buildLax(B.class);
@Test
public void b01_int() throws Exception {
@@ -268,7 +268,7 @@ public class PathAnnotationTest {
return String.valueOf(x);
}
}
- static MockRestClient c = MockRestClient.build(C.class);
+ static MockRestClient c = MockRestClient.buildLax(C.class);
@Test
public void c01_Integer() throws Exception {
@@ -459,7 +459,7 @@ public class PathAnnotationTest {
return SimpleJson.DEFAULT.format(msg, args);
}
}
- static MockRestClient f =
MockRestClient.create(F.class).servletPath("/f").build();
+ static MockRestClient f =
MockRestClient.createLax(F.class).servletPath("/f").build();
@Test
public void f01a_noPath() throws Exception {
@@ -592,7 +592,7 @@ public class PathAnnotationTest {
@Rest(children={F.class})
public static class G {}
- static MockRestClient g = MockRestClient.create(G.class).build();
+ static MockRestClient g = MockRestClient.buildLax(G.class);
@Test
public void g01a_noPath() throws Exception {
@@ -705,7 +705,7 @@ public class PathAnnotationTest {
@Rest(path="/h/{ha}/{hb}", children={F.class})
public static class H {}
- static MockRestClient h =
MockRestClient.create(H.class).servletPath("/h").build();
+ static MockRestClient h =
MockRestClient.createLax(H.class).servletPath("/h").build();
@Test
public void h01a_noPath() throws Exception {
@@ -847,7 +847,7 @@ public class PathAnnotationTest {
@Rest(path="/i/{ia}/{ib}", children={H.class})
public static class I {}
- static MockRestClient i =
MockRestClient.create(I.class).servletPath("/i").build();
+ static MockRestClient i =
MockRestClient.createLax(I.class).servletPath("/i").build();
@Test
public void i01a_noPath() throws Exception {
diff --git
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/ResponseAnnotationTest.java
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/ResponseAnnotationTest.java
index 3b28455..661c94f 100644
---
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/ResponseAnnotationTest.java
+++
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/ResponseAnnotationTest.java
@@ -67,7 +67,7 @@ public class ResponseAnnotationTest {
public String toString() {return "foo";}
}
- static MockRestClient a = MockRestClient.build(A.class);
+ static MockRestClient a = MockRestClient.buildLax(A.class);
@Test
public void a01_codeOnClass() throws Exception {
@@ -125,7 +125,7 @@ public class ResponseAnnotationTest {
public String toString() {return "foo";}
}
- static MockRestClient b = MockRestClient.build(B.class);
+ static MockRestClient b = MockRestClient.buildLax(B.class);
@Test
public void b01_useOnMethod() throws Exception {
@@ -228,7 +228,7 @@ public class ResponseAnnotationTest {
}
}
- static MockRestClient d = MockRestClient.build(D.class);
+ static MockRestClient d = MockRestClient.buildLax(D.class);
@Test
public void d01_useOnMethod() throws Exception {
diff --git
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RestResourceParsersTest.java
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RestResourceParsersTest.java
index 724b3ee..d71651f 100644
---
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RestResourceParsersTest.java
+++
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RestResourceParsersTest.java
@@ -124,7 +124,7 @@ public class RestResourceParsersTest {
return in;
}
}
- static MockRestClient a = MockRestClient.build(A.class);
+ static MockRestClient a = MockRestClient.buildLax(A.class);
@Test
public void a01_parserOnClass() throws Exception {
diff --git
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RoleGuardTest.java
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RoleGuardTest.java
index bcde8b2..f960f96 100644
---
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RoleGuardTest.java
+++
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RoleGuardTest.java
@@ -32,7 +32,7 @@ public class RoleGuardTest {
return "OK";
}
}
- static MockRestClient a1 = MockRestClient.build(A1.class);
+ static MockRestClient a1 = MockRestClient.buildLax(A1.class);
@Test
public void a01a_onClass_simple_pass() throws Exception {
@@ -59,7 +59,7 @@ public class RoleGuardTest {
return "OK";
}
}
- static MockRestClient a2 = MockRestClient.build(A2.class);
+ static MockRestClient a2 = MockRestClient.buildLax(A2.class);
@Test
public void a02a_onMethod_simple_pass() throws Exception {
@@ -86,7 +86,7 @@ public class RoleGuardTest {
return "OK";
}
}
- static MockRestClient a3 = MockRestClient.build(A3.class);
+ static MockRestClient a3 = MockRestClient.buildLax(A3.class);
@Test
public void a03a_onBoth_simple_pass() throws Exception {
@@ -125,7 +125,7 @@ public class RoleGuardTest {
}
}
- static MockRestClient a4 = MockRestClient.build(A4b.class);
+ static MockRestClient a4 = MockRestClient.buildLax(A4b.class);
@Test
public void a04a_inheritence_simple_pass() throws Exception {
@@ -182,14 +182,14 @@ public class RoleGuardTest {
@Rest(roleGuard="foo || (bar && baz)")
public static class B1h extends B1 {}
- static MockRestClient b1a = MockRestClient.build(B1a.class);
- static MockRestClient b1b = MockRestClient.build(B1b.class);
- static MockRestClient b1c = MockRestClient.build(B1c.class);
- static MockRestClient b1d = MockRestClient.build(B1d.class);
- static MockRestClient b1e = MockRestClient.build(B1e.class);
- static MockRestClient b1f = MockRestClient.build(B1f.class);
- static MockRestClient b1g = MockRestClient.build(B1g.class);
- static MockRestClient b1h = MockRestClient.build(B1h.class);
+ static MockRestClient b1a = MockRestClient.buildLax(B1a.class);
+ static MockRestClient b1b = MockRestClient.buildLax(B1b.class);
+ static MockRestClient b1c = MockRestClient.buildLax(B1c.class);
+ static MockRestClient b1d = MockRestClient.buildLax(B1d.class);
+ static MockRestClient b1e = MockRestClient.buildLax(B1e.class);
+ static MockRestClient b1f = MockRestClient.buildLax(B1f.class);
+ static MockRestClient b1g = MockRestClient.buildLax(B1g.class);
+ static MockRestClient b1h = MockRestClient.buildLax(B1h.class);
@Test
public void b01a_orsWithComma_pass() throws Exception {
@@ -388,14 +388,14 @@ public class RoleGuardTest {
}
}
- static MockRestClient b2a = MockRestClient.build(B2a.class);
- static MockRestClient b2b = MockRestClient.build(B2b.class);
- static MockRestClient b2c = MockRestClient.build(B2c.class);
- static MockRestClient b2d = MockRestClient.build(B2d.class);
- static MockRestClient b2e = MockRestClient.build(B2e.class);
- static MockRestClient b2f = MockRestClient.build(B2f.class);
- static MockRestClient b2g = MockRestClient.build(B2g.class);
- static MockRestClient b2h = MockRestClient.build(B2h.class);
+ static MockRestClient b2a = MockRestClient.buildLax(B2a.class);
+ static MockRestClient b2b = MockRestClient.buildLax(B2b.class);
+ static MockRestClient b2c = MockRestClient.buildLax(B2c.class);
+ static MockRestClient b2d = MockRestClient.buildLax(B2d.class);
+ static MockRestClient b2e = MockRestClient.buildLax(B2e.class);
+ static MockRestClient b2f = MockRestClient.buildLax(B2f.class);
+ static MockRestClient b2g = MockRestClient.buildLax(B2g.class);
+ static MockRestClient b2h = MockRestClient.buildLax(B2h.class);
@Test
public void b02a_orsWithComma_pass() throws Exception {
@@ -562,14 +562,14 @@ public class RoleGuardTest {
@Rest(roleGuard="fo* || (*ar && *az)")
public static class C1h extends C1 {}
- static MockRestClient c1a = MockRestClient.build(C1a.class);
- static MockRestClient c1b = MockRestClient.build(C1b.class);
- static MockRestClient c1c = MockRestClient.build(C1c.class);
- static MockRestClient c1d = MockRestClient.build(C1d.class);
- static MockRestClient c1e = MockRestClient.build(C1e.class);
- static MockRestClient c1f = MockRestClient.build(C1f.class);
- static MockRestClient c1g = MockRestClient.build(C1g.class);
- static MockRestClient c1h = MockRestClient.build(C1h.class);
+ static MockRestClient c1a = MockRestClient.buildLax(C1a.class);
+ static MockRestClient c1b = MockRestClient.buildLax(C1b.class);
+ static MockRestClient c1c = MockRestClient.buildLax(C1c.class);
+ static MockRestClient c1d = MockRestClient.buildLax(C1d.class);
+ static MockRestClient c1e = MockRestClient.buildLax(C1e.class);
+ static MockRestClient c1f = MockRestClient.buildLax(C1f.class);
+ static MockRestClient c1g = MockRestClient.buildLax(C1g.class);
+ static MockRestClient c1h = MockRestClient.buildLax(C1h.class);
@Test
public void c01a_orPatternsWithComma_pass() throws Exception {
@@ -768,14 +768,14 @@ public class RoleGuardTest {
}
}
- static MockRestClient c2a = MockRestClient.build(C2a.class);
- static MockRestClient c2b = MockRestClient.build(C2b.class);
- static MockRestClient c2c = MockRestClient.build(C2c.class);
- static MockRestClient c2d = MockRestClient.build(C2d.class);
- static MockRestClient c2e = MockRestClient.build(C2e.class);
- static MockRestClient c2f = MockRestClient.build(C2f.class);
- static MockRestClient c2g = MockRestClient.build(C2g.class);
- static MockRestClient c2h = MockRestClient.build(C2h.class);
+ static MockRestClient c2a = MockRestClient.buildLax(C2a.class);
+ static MockRestClient c2b = MockRestClient.buildLax(C2b.class);
+ static MockRestClient c2c = MockRestClient.buildLax(C2c.class);
+ static MockRestClient c2d = MockRestClient.buildLax(C2d.class);
+ static MockRestClient c2e = MockRestClient.buildLax(C2e.class);
+ static MockRestClient c2f = MockRestClient.buildLax(C2f.class);
+ static MockRestClient c2g = MockRestClient.buildLax(C2g.class);
+ static MockRestClient c2h = MockRestClient.buildLax(C2h.class);
@Test
public void c02a_orPatternsWithComma_pass() throws Exception {
@@ -918,7 +918,7 @@ public class RoleGuardTest {
}
}
- static MockRestClient d = MockRestClient.build(D.class);
+ static MockRestClient d = MockRestClient.buildLax(D.class);
@Test
public void d01_patternsWithoutRoles_fail() throws Exception {
@@ -942,7 +942,7 @@ public class RoleGuardTest {
}
}
- static MockRestClient e = MockRestClient.build(E.class);
+ static MockRestClient e = MockRestClient.buildLax(E.class);
@Test
public void e01_anyRole_pass() throws Exception {
diff --git
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/exceptions/BasicTest.java
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/exceptions/BasicTest.java
index d38dfdb..e6b2a9d 100644
---
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/exceptions/BasicTest.java
+++
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/exceptions/BasicTest.java
@@ -69,7 +69,7 @@ public class BasicTest {
@RestMethod public void variantAlsoNegotiates() { throw new
VariantAlsoNegotiates(); }
}
- static MockRestClient a = MockRestClient.build(A.class);
+ static MockRestClient a = MockRestClient.buildLax(A.class);
@Test
public void a01_badRequest() throws Exception {
@@ -344,7 +344,7 @@ public class BasicTest {
@RestMethod public void variantAlsoNegotiates() { throw new
VariantAlsoNegotiates("foo {0}", "bar"); }
}
- static MockRestClient b = MockRestClient.build(B.class);
+ static MockRestClient b = MockRestClient.buildLax(B.class);
@Test
public void b01_badRequest() throws Exception {
@@ -621,7 +621,7 @@ public class BasicTest {
@RestMethod public void variantAlsoNegotiates() { throw new
VariantAlsoNegotiates(t); }
}
- static MockRestClient c = MockRestClient.build(C.class);
+ static MockRestClient c = MockRestClient.buildLax(C.class);
@Test
public void c01_badRequest() throws Exception {
@@ -896,7 +896,7 @@ public class BasicTest {
@RestMethod public void variantAlsoNegotiates() { throw new
VariantAlsoNegotiates(t, "foo {0}", "bar"); }
}
- static MockRestClient d = MockRestClient.build(D.class);
+ static MockRestClient d = MockRestClient.buildLax(D.class);
@Test
public void d01_badRequest() throws Exception {
@@ -1139,7 +1139,7 @@ public class BasicTest {
@RestMethod public void badRequest() { throw new BadRequest(t,
"foo {0}", "bar"); }
}
- static MockRestClient e = MockRestClient.build(E.class);
+ static MockRestClient e = MockRestClient.buildLax(E.class);
@Test
public void e01_badRequest() throws Exception {
@@ -1369,7 +1369,7 @@ public class BasicTest {
public SeeOtherRoot thrownObjectDoesntMatchReturnType() throws
Exception { throw new NotFound(); }
}
- static MockRestClient g = MockRestClient.create(G.class).build();
+ static MockRestClient g = MockRestClient.buildLax(G.class);
@Test
public void g01_thrownObjectDoesntMatchReturnType() throws Exception {
@@ -1390,7 +1390,7 @@ public class BasicTest {
}
}
- static MockRestClient h = MockRestClient.create(H.class).build();
+ static MockRestClient h = MockRestClient.buildLax(H.class);
@Test
public void h01_parseExceptionCausesBadRequest() throws Exception {
diff --git
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptCharsetTest.java
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptCharsetTest.java
index 4aa7a2d..d11ca41 100644
---
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptCharsetTest.java
+++
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptCharsetTest.java
@@ -103,7 +103,7 @@ public class AcceptCharsetTest {
}
}
}
- static MockRestClient b = MockRestClient.build(B.class);
+ static MockRestClient b = MockRestClient.buildLax(B.class);
@Test
public void b01_testCharsetOnResponse() throws Exception {
diff --git
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptEncodingTest.java
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptEncodingTest.java
index af781a9..29c5f44 100644
---
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptEncodingTest.java
+++
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptEncodingTest.java
@@ -49,7 +49,7 @@ public class AcceptEncodingTest {
return "foo";
}
}
- static MockRestClient a = MockRestClient.build(A.class);
+ static MockRestClient a = MockRestClient.buildLax(A.class);
@Test
public void a01_noCompression() throws Exception {
@@ -120,7 +120,7 @@ public class AcceptEncodingTest {
return "foo";
}
}
- static MockRestClient b = MockRestClient.build(B.class);
+ static MockRestClient b = MockRestClient.buildLax(B.class);
@Test
public void b01_withCompression_identity() throws Exception {
diff --git
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptTest.java
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptTest.java
index f20ded1..db464f2 100644
---
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptTest.java
+++
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptTest.java
@@ -67,7 +67,7 @@ public class AcceptTest {
return in;
}
}
- private static MockRestClient a = MockRestClient.build(A.class);
+ private static MockRestClient a = MockRestClient.buildLax(A.class);
@Test
public void a01_defaultHeadersOnServletAnnotation_valid() throws
Exception {
@@ -108,7 +108,7 @@ public class AcceptTest {
return in;
}
}
- private static MockRestClient b = MockRestClient.build(B.class);
+ private static MockRestClient b = MockRestClient.buildLax(B.class);
@Test
public void b01_restMethodWithParsersSerializers_valid() throws
Exception {
@@ -142,7 +142,7 @@ public class AcceptTest {
return in;
}
}
- private static MockRestClient c = MockRestClient.build(C.class);
+ private static MockRestClient c = MockRestClient.buildLax(C.class);
@Test
public void c01_restMethodAddParsersSerializersInherit() throws
Exception {
@@ -189,7 +189,7 @@ public class AcceptTest {
return in;
}
}
- private static MockRestClient d = MockRestClient.build(D.class);
+ private static MockRestClient d = MockRestClient.buildLax(D.class);
@Test
public void d01_accept_valid() throws Exception {
@@ -229,7 +229,7 @@ public class AcceptTest {
return in;
}
}
- private static MockRestClient e = MockRestClient.build(E.class);
+ private static MockRestClient e = MockRestClient.buildLax(E.class);
@Test
public void e01_restMethodParserSerializerAnnotations_valid() throws
Exception {
diff --git
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/ContentEncodingTest.java
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/ContentEncodingTest.java
index 7137279..ecbb6ef 100644
---
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/ContentEncodingTest.java
+++
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/ContentEncodingTest.java
@@ -47,7 +47,7 @@ public class ContentEncodingTest {
return in;
}
}
- static MockRestClient a = MockRestClient.build(A.class);
+ static MockRestClient a = MockRestClient.buildLax(A.class);
@Test
public void a01_noCompression() throws Exception {
diff --git
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/ContentTypeTest.java
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/ContentTypeTest.java
index b864507..f86c060 100644
---
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/ContentTypeTest.java
+++
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/ContentTypeTest.java
@@ -68,7 +68,7 @@ public class ContentTypeTest {
return in;
}
}
- private static MockRestClient a = MockRestClient.build(A.class);
+ private static MockRestClient a = MockRestClient.buildLax(A.class);
@Test
public void a01_defaultHeadersOnServletAnnotation_valid() throws
Exception {
@@ -106,7 +106,7 @@ public class ContentTypeTest {
return in;
}
}
- private static MockRestClient b = MockRestClient.build(B.class);
+ private static MockRestClient b = MockRestClient.buildLax(B.class);
@Test
public void b01_restMethodWithParsersSerializers_valid() throws
Exception {
@@ -153,7 +153,7 @@ public class ContentTypeTest {
return in;
}
}
- private static MockRestClient c = MockRestClient.build(C.class);
+ private static MockRestClient c = MockRestClient.buildLax(C.class);
@Test
public void c01_restMethodAddParsersSerializersInherit() throws
Exception {
@@ -189,7 +189,7 @@ public class ContentTypeTest {
return in;
}
}
- private static MockRestClient e = MockRestClient.build(E.class);
+ private static MockRestClient e = MockRestClient.buildLax(E.class);
@Test
public void e01_restMethodParserSerializerAnnotations_valid() throws
Exception {
diff --git
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/responses/BasicTest.java
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/responses/BasicTest.java
index 1720dda..5b781ef 100644
---
a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/responses/BasicTest.java
+++
b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/responses/BasicTest.java
@@ -59,7 +59,7 @@ public class BasicTest {
@RestMethod public UseProxy useProxy() { return new UseProxy();
}
}
- static MockRestClient a =
MockRestClient.create(A.class).disableRedirectHandling().build();
+ static MockRestClient a =
MockRestClient.createLax(A.class).disableRedirectHandling().build();
@Test
public void a01_accepted() throws Exception {
@@ -286,7 +286,7 @@ public class BasicTest {
@RestMethod public UseProxy useProxy() { return new
UseProxy("foo"); }
}
- static MockRestClient c =
MockRestClient.create(C.class).disableRedirectHandling().build();
+ static MockRestClient c =
MockRestClient.createLax(C.class).disableRedirectHandling().build();
@Test
public void c01_accepted() throws Exception {