You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2020/05/25 15:31:19 UTC
[juneau] branch master updated: Improved assertions.
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 0195406 Improved assertions.
0195406 is described below
commit 019540614f88e4ce7cdba8759c1fa93adbcdbec5
Author: JamesBognar <ja...@salesforce.com>
AuthorDate: Mon May 25 11:31:03 2020 -0400
Improved assertions.
---
.../org/apache/juneau/internal/StringUtils.java | 15 +
.../apache/juneau/utils/FluentStringAssertion.java | 112 ++-
.../apache/juneau/rest/client2/MarshallTest.java | 2 +-
.../apache/juneau/rest/client2/RestClientTest.java | 422 +++++------
.../rest/mock2/MockHttpClientConnection.java | 2 +-
.../apache/juneau/rest/mock2/MockHttpRequest.java | 2 +-
.../juneau/rest/mock2/MockServletRequest.java | 2 +-
.../juneau/rest/mock2/MockServletResponse.java | 173 ++---
.../mock2/MockServletResponseBodyAssertion.java} | 40 +-
.../mock2/MockServletResponseHeaderAssertion.java} | 40 +-
.../MockServletResponseStatusCodeAssertion.java} | 40 +-
.../juneau/rest/BasicRestInfoProviderTest.java | 2 +-
.../juneau/rest/BeanContextPropertiesTest.java | 4 +-
.../java/org/apache/juneau/rest/DebugModeTest.java | 436 ++++++------
.../test/java/org/apache/juneau/rest/NlsTest.java | 8 +-
.../java/org/apache/juneau/rest/PathsTest.java | 792 ++++++++++-----------
.../org/apache/juneau/rest/RestParamsTest.java | 46 +-
.../org/apache/juneau/rest/StatusCodesTest.java | 80 +--
.../apache/juneau/rest/ThreadLocalObjectsTest.java | 8 +-
.../juneau/rest/annotation/HtmlDocAsideTest.java | 20 +-
.../rest/annotation/HtmlDocConfigAsideTest.java | 20 +-
.../rest/annotation/HtmlDocConfigFooterTest.java | 20 +-
.../rest/annotation/HtmlDocConfigHeaderTest.java | 20 +-
.../rest/annotation/HtmlDocConfigNavTest.java | 20 +-
.../rest/annotation/HtmlDocConfigNavlinksTest.java | 44 +-
.../rest/annotation/HtmlDocConfigScriptTest.java | 20 +-
.../rest/annotation/HtmlDocConfigStyleTest.java | 20 +-
.../juneau/rest/annotation/HtmlDocFooterTest.java | 20 +-
.../juneau/rest/annotation/HtmlDocHeaderTest.java | 20 +-
.../juneau/rest/annotation/HtmlDocNavTest.java | 20 +-
.../rest/annotation/HtmlDocNavlinksTest.java | 44 +-
.../juneau/rest/annotation/HtmlDocScriptTest.java | 20 +-
.../juneau/rest/annotation/HtmlDocStyleTest.java | 20 +-
.../annotation/ResponseHeaderAnnotationTest.java | 6 +-
.../annotation/ResponseStatusAnnotationTest.java | 2 +-
.../juneau/rest/annotation/RestMethodBpiTest.java | 320 ++++-----
.../rest/annotation/RestMethodGuardsTest.java | 12 +-
.../rest/annotation/RestMethodMatchersTest.java | 14 +-
.../juneau/rest/annotation/RestMethodPathTest.java | 16 +-
.../rest/annotation/RestResourceLoggingTest.java | 110 +--
.../rest/annotation/RestResourceMessagesTest.java | 4 +-
.../rest/annotation/RestResourcePathTest.java | 6 +-
.../annotation/RestResourcePropertiesTest.java | 2 +-
.../annotation/RestResourceSerializersTest.java | 28 +-
.../annotation/RestResourceStaticFilesTest.java | 42 +-
.../juneau/rest/annotation/RestResourceTest.java | 300 ++++----
.../annotation2/AnnotationInheritanceTest.java | 6 +-
.../rest/annotation2/BodyAnnotationTest.java | 282 ++++----
.../rest/annotation2/FormDataAnnotationTest.java | 62 +-
.../annotation2/HasFormDataAnnotationTest.java | 22 +-
.../rest/annotation2/HasQueryAnnotationTest.java | 44 +-
.../rest/annotation2/HeaderAnnotationTest.java | 16 +-
.../rest/annotation2/PathAnnotationTest.java | 316 ++++----
.../annotation2/PathRemainderAnnotationTest.java | 14 +-
.../rest/annotation2/QueryAnnotationTest.java | 116 +--
.../rest/annotation2/ResponseAnnotationTest.java | 54 +-
.../juneau/rest/annotation2/RestHookTest.java | 68 +-
.../rest/annotation2/RestMethodInheritTest.java | 26 +-
.../rest/annotation2/RestResourceParsersTest.java | 30 +-
.../annotation2/RestResourcePojoSwapsTest.java | 12 +-
.../juneau/rest/annotation2/RoleGuardTest.java | 474 ++++++------
.../apache/juneau/rest/exceptions/BasicTest.java | 270 +++----
.../juneau/rest/headers/AcceptCharsetTest.java | 36 +-
.../juneau/rest/headers/AcceptEncodingTest.java | 146 ++--
.../org/apache/juneau/rest/headers/AcceptTest.java | 72 +-
.../juneau/rest/headers/ClientVersionTest.java | 18 +-
.../juneau/rest/headers/ContentEncodingTest.java | 20 +-
.../juneau/rest/headers/ContentTypeTest.java | 66 +-
.../apache/juneau/rest/headers/HeadersTest.java | 180 ++---
.../apache/juneau/rest/helper/HyperlinkTest.java | 6 +-
.../juneau/rest/helper/ReaderResourceTest.java | 14 +-
.../juneau/rest/helper/StreamResourceTest.java | 14 +-
.../apache/juneau/rest/responses/BasicTest.java | 98 +--
73 files changed, 2964 insertions(+), 2934 deletions(-)
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/StringUtils.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/StringUtils.java
index b4e922b..f69e05f 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/StringUtils.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/StringUtils.java
@@ -1161,6 +1161,21 @@ public final class StringUtils {
}
/**
+ * Tests two strings for case-insensitive equality, but gracefully handles nulls.
+ *
+ * @param s1 String 1.
+ * @param s2 String 2.
+ * @return <jk>true</jk> if the strings are equal.
+ */
+ public static boolean isEqualsIc(String s1, String s2) {
+ if (s1 == null)
+ return s2 == null;
+ if (s2 == null)
+ return false;
+ return s1.equalsIgnoreCase(s2);
+ }
+
+ /**
* Tests two strings for non-equality, but gracefully handles nulls.
*
* @param s1 String 1.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/FluentStringAssertion.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/FluentStringAssertion.java
index 1e75a23..4cc745b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/FluentStringAssertion.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/FluentStringAssertion.java
@@ -72,6 +72,41 @@ public class FluentStringAssertion<R> {
/**
* Asserts that the text equals the specified value.
*
+ * <p>
+ * Equivalent to {@link #equals(String)}.
+ *
+ * @param value The value to check against.
+ * @return The response object (for method chaining).
+ * @throws AssertionError If assertion failed.
+ */
+ public R is(String value) throws AssertionError {
+ return equals(value);
+ }
+
+ /**
+ * Asserts that the text equals the specified value ignoring case.
+ *
+ * @param value The value to check against.
+ * @return The response object (for method chaining).
+ * @throws AssertionError If assertion failed.
+ */
+ public R equalsIc(String value) throws AssertionError {
+ if (! StringUtils.isEqualsIc(value, text)) {
+ if (value != null && value.startsWith("x")) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("Text did not equal expected.");
+ sb.append("\nExpected: [").append(value.replaceAll("\\\\", "\\\\\\\\").replaceAll("\n", "\\\\n").replaceAll("\t", "\\\\t")).append("]");
+ sb.append("\nActual : [").append(text.replaceAll("\\\\", "\\\\\\\\").replaceAll("\n", "\\\\n").replaceAll("\t", "\\\\t")).append("]");
+ System.err.println(sb.toString());
+ }
+ throw new BasicAssertionError("Text did not equal expected.\n\tExpected=[{0}]\n\tActual=[{1}]", value, text);
+ }
+ return returns;
+ }
+
+ /**
+ * Asserts that the text equals the specified value.
+ *
* @param value The value to check against.
* @return The response object (for method chaining).
* @throws AssertionError If assertion failed.
@@ -90,6 +125,40 @@ public class FluentStringAssertion<R> {
}
/**
+ * Asserts that the text equals the specified value.
+ *
+ * <p>
+ * Equivalent to {@link #doesNotEqual(String)}.
+ *
+ * @param value The value to check against.
+ * @return The response object (for method chaining).
+ * @throws AssertionError If assertion failed.
+ */
+ public R isNot(String value) throws AssertionError {
+ return doesNotEqual(value);
+ }
+
+ /**
+ * Asserts that the text does not equal the specified value ignoring case.
+ *
+ * @param value The value to check against.
+ * @return The response object (for method chaining).
+ * @throws AssertionError If assertion failed.
+ */
+ public R doesNotEqualIc(String value) throws AssertionError {
+ if (StringUtils.isEqualsIc(value, text)) {
+ if (value != null && value.startsWith("x")) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("Text equaled unexpected.");
+ sb.append("\nText: [").append(value.replaceAll("\\\\", "\\\\\\\\").replaceAll("\n", "\\\\n").replaceAll("\t", "\\\\t")).append("]");
+ System.err.println(sb.toString());
+ }
+ throw new BasicAssertionError("Text equaled unexpected.\n\tText=[{1}]", value, text);
+ }
+ return returns;
+ }
+
+ /**
* Asserts that the text contains all of the specified substrings.
*
* @param values The values to check against.
@@ -137,14 +206,37 @@ public class FluentStringAssertion<R> {
* Asserts that the text is not null.
*
* <p>
- * Equivalent to {@link #isNotEmpty()}.
+ * Equivalent to {@link #isNotNull()}.
*
* @return The response object (for method chaining).
* @throws AssertionError If assertion failed.
*/
public R exists() throws AssertionError {
- if (text == null)
- throw new BasicAssertionError("Text was null.");
+ return isNotNull();
+ }
+
+ /**
+ * Asserts that the text is not null.
+ *
+ * <p>
+ * Equivalent to {@link #isNull()}.
+ *
+ * @return The response object (for method chaining).
+ * @throws AssertionError If assertion failed.
+ */
+ public R doesNotExist() throws AssertionError {
+ return isNull();
+ }
+
+ /**
+ * Asserts that the text is not null.
+ *
+ * @return The response object (for method chaining).
+ * @throws AssertionError If assertion failed.
+ */
+ public R isNull() throws AssertionError {
+ if (text != null)
+ throw new BasicAssertionError("Text was not null.");
return returns;
}
@@ -161,6 +253,18 @@ public class FluentStringAssertion<R> {
}
/**
+ * Asserts that the text is not empty.
+ *
+ * @return The response object (for method chaining).
+ * @throws AssertionError If assertion failed.
+ */
+ public R isEmpty() throws AssertionError {
+ if (! text.isEmpty())
+ throw new BasicAssertionError("Text was not empty.");
+ return returns;
+ }
+
+ /**
* Asserts that the text is not null or empty.
*
* @return The response object (for method chaining).
@@ -170,7 +274,7 @@ public class FluentStringAssertion<R> {
if (text == null)
throw new BasicAssertionError("Text was null.");
if (text.isEmpty())
- throw new BasicAssertionError("Text was emtpy.");
+ throw new BasicAssertionError("Text was empty.");
return returns;
}
diff --git a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/MarshallTest.java b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/MarshallTest.java
index 163e998..b134642 100644
--- a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/MarshallTest.java
+++ b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/MarshallTest.java
@@ -158,7 +158,7 @@ public class MarshallTest {
.body("{f:1}")
.run()
.assertStatusCode().equals(200)
- .assertBody().equals("{\"f\":1}");
+ .assertBody().is("{\"f\":1}");
}
//------------------------------------------------------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/RestClientTest.java b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/RestClientTest.java
index 46f1a19..3c42656 100644
--- a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/RestClientTest.java
+++ b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/RestClientTest.java
@@ -216,8 +216,8 @@ public class RestClientTest {
.get("/echo")
.run()
.assertBody().contains("A1: 1", "A2: 2")
- .assertHeader("B1").equals("1")
- .assertHeader("B2").equals("2")
+ .assertHeader("B1").is("1")
+ .assertHeader("B2").is("2")
;
}
@@ -241,7 +241,7 @@ public class RestClientTest {
.get("/echo")
.run()
.assertBody().contains("A1: 1")
- .assertHeader("B1").equals("1");
+ .assertHeader("B1").is("1");
}
@Test
@@ -383,7 +383,7 @@ public class RestClientTest {
.get("/checkHeader")
.header("Foo","baz")
.run()
- .assertBody().equals("['bar','baz']");
+ .assertBody().is("['bar','baz']");
}
@Test
@@ -397,7 +397,7 @@ public class RestClientTest {
.get("/checkHeader")
.header("Foo", bean)
.run()
- .assertBody().equals("['f=1','f=1']");
+ .assertBody().is("['f=1','f=1']");
}
@Test
@@ -411,7 +411,7 @@ public class RestClientTest {
.get("/checkHeader")
.header("Foo", null)
.run()
- .assertBody().equals("null");
+ .assertBody().is("null");
}
@Test
@@ -425,7 +425,7 @@ public class RestClientTest {
.get("/checkHeader")
.header(new org.apache.http.message.BasicHeader("Foo", "baz"))
.run()
- .assertBody().equals("['bar','baz']");
+ .assertBody().is("['bar','baz']");
}
@Test
@@ -439,7 +439,7 @@ public class RestClientTest {
.get("/checkHeader")
.header(new BasicNameValuePair("Foo", "baz"))
.run()
- .assertBody().equals("['bar','baz']");
+ .assertBody().is("['bar','baz']");
}
@Test
@@ -453,7 +453,7 @@ public class RestClientTest {
.get("/checkHeader")
.header(new BasicObjectHeader("Foo", "baz"))
.run()
- .assertBody().equals("['bar','baz']");
+ .assertBody().is("['bar','baz']");
}
@Test
@@ -467,7 +467,7 @@ public class RestClientTest {
.get("/checkHeader")
.headers(new org.apache.http.message.BasicHeader("Foo", "baz"),new org.apache.http.message.BasicHeader("Baz", "quux"))
.run()
- .assertBody().equals("['bar','baz']");
+ .assertBody().is("['bar','baz']");
}
@Test
@@ -481,7 +481,7 @@ public class RestClientTest {
.get("/checkHeader")
.headers(OMap.of("Foo", "baz"))
.run()
- .assertBody().equals("['bar','baz']");
+ .assertBody().is("['bar','baz']");
}
@Test
@@ -495,7 +495,7 @@ public class RestClientTest {
.get("/checkHeader")
.headers(AMap.of("Foo", "baz"))
.run()
- .assertBody().equals("['bar','baz']");
+ .assertBody().is("['bar','baz']");
}
@Test
@@ -509,7 +509,7 @@ public class RestClientTest {
.get("/checkHeader")
.headers(NameValuePairs.of("Foo","baz"))
.run()
- .assertBody().equals("['bar','baz']");
+ .assertBody().is("['bar','baz']");
}
@Test
@@ -523,7 +523,7 @@ public class RestClientTest {
.get("/checkHeader")
.headers(new BasicNameValuePair("Foo","baz"))
.run()
- .assertBody().equals("['bar','baz']");
+ .assertBody().is("['bar','baz']");
}
@Test
@@ -537,7 +537,7 @@ public class RestClientTest {
.get("/checkHeader")
.headerPairs("Foo", "baz")
.run()
- .assertBody().equals("['bar','baz']");
+ .assertBody().is("['bar','baz']");
}
@Test
@@ -551,7 +551,7 @@ public class RestClientTest {
.get("/checkHeader")
.headers(new BasicObjectHeader("Foo", "baz"))
.run()
- .assertBody().equals("['bar','baz']");
+ .assertBody().is("['bar','baz']");
}
@Test
@@ -565,7 +565,7 @@ public class RestClientTest {
.get("/checkHeader")
.accept("text/plain")
.run()
- .assertBody().equals("['text/foo','text/plain']");
+ .assertBody().is("['text/foo','text/plain']");
}
@Test
@@ -578,7 +578,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['UTF-8']");
+ .assertBody().is("['UTF-8']");
}
@Test
@@ -591,7 +591,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['identity']");
+ .assertBody().is("['identity']");
}
@Test
@@ -604,7 +604,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['en']");
+ .assertBody().is("['en']");
}
@Test
@@ -617,7 +617,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -630,7 +630,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['none']");
+ .assertBody().is("['none']");
}
@Test
@@ -643,7 +643,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['1']");
+ .assertBody().is("['1']");
}
@Test
@@ -656,7 +656,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -669,7 +669,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['123']");
+ .assertBody().is("['123']");
}
@Test
@@ -682,7 +682,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -695,7 +695,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['123']");
+ .assertBody().is("['123']");
}
@Test
@@ -708,7 +708,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -721,7 +721,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -734,7 +734,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -747,7 +747,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -760,7 +760,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -773,7 +773,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -786,7 +786,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -799,7 +799,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -812,7 +812,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -825,7 +825,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['10']");
+ .assertBody().is("['10']");
}
@Test
@@ -838,7 +838,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['true']");
+ .assertBody().is("['true']");
}
@Test
@@ -851,7 +851,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -864,7 +864,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -877,7 +877,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -890,7 +890,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -903,7 +903,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -916,7 +916,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -929,7 +929,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -942,7 +942,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -955,7 +955,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -968,7 +968,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
//------------------------------------------------------------------------------------------------------------------
@@ -986,7 +986,7 @@ public class RestClientTest {
.get("/checkHeader")
.header(new Accept("text/plain"))
.run()
- .assertBody().equals("['text/foo','text/plain']");
+ .assertBody().is("['text/foo','text/plain']");
}
@Test
@@ -999,7 +999,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['UTF-8']");
+ .assertBody().is("['UTF-8']");
}
@Test
@@ -1012,7 +1012,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['identity']");
+ .assertBody().is("['identity']");
}
@Test
@@ -1025,7 +1025,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['en']");
+ .assertBody().is("['en']");
}
@Test
@@ -1038,7 +1038,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -1052,7 +1052,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['none']");
+ .assertBody().is("['none']");
}
@Test
@@ -1065,7 +1065,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['1']");
+ .assertBody().is("['1']");
}
@Test
@@ -1078,7 +1078,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -1091,7 +1091,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['123']");
+ .assertBody().is("['123']");
}
@Test
@@ -1104,7 +1104,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -1117,7 +1117,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['Sun, 31 Dec 2000 12:34:56 GMT']");
+ .assertBody().is("['Sun, 31 Dec 2000 12:34:56 GMT']");
}
@Test
@@ -1130,7 +1130,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['Sun, 31 Dec 2000 12:34:56 GMT']");
+ .assertBody().is("['Sun, 31 Dec 2000 12:34:56 GMT']");
}
@Test
@@ -1143,7 +1143,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -1156,7 +1156,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -1169,7 +1169,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -1182,7 +1182,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -1195,7 +1195,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['\"foo\"']");
+ .assertBody().is("['\"foo\"']");
}
@Test
@@ -1208,7 +1208,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['Sun, 31 Dec 2000 12:34:56 GMT']");
+ .assertBody().is("['Sun, 31 Dec 2000 12:34:56 GMT']");
}
@Test
@@ -1221,7 +1221,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['Sun, 31 Dec 2000 12:34:56 GMT']");
+ .assertBody().is("['Sun, 31 Dec 2000 12:34:56 GMT']");
}
@Test
@@ -1234,7 +1234,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['\"foo\"']");
+ .assertBody().is("['\"foo\"']");
}
@Test
@@ -1247,7 +1247,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -1260,7 +1260,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['Sun, 31 Dec 2000 12:34:56 GMT']");
+ .assertBody().is("['Sun, 31 Dec 2000 12:34:56 GMT']");
}
@Test
@@ -1273,7 +1273,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['Sun, 31 Dec 2000 12:34:56 GMT']");
+ .assertBody().is("['Sun, 31 Dec 2000 12:34:56 GMT']");
}
@Test
@@ -1286,7 +1286,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['10']");
+ .assertBody().is("['10']");
}
@Test
@@ -1299,7 +1299,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['true']");
+ .assertBody().is("['true']");
}
@Test
@@ -1312,7 +1312,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -1325,7 +1325,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -1338,7 +1338,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -1351,7 +1351,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -1364,7 +1364,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -1377,7 +1377,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -1390,7 +1390,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -1403,7 +1403,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -1416,7 +1416,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
@Test
@@ -1429,7 +1429,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['foo']");
+ .assertBody().is("['foo']");
}
//------------------------------------------------------------------------------------------------------------------
@@ -1448,7 +1448,7 @@ public class RestClientTest {
.get("/checkHeader")
.headerPairs("Foo","q1x","Foo","q2x")
.run()
- .assertBody().equals("['bar','baz','qux','q1x','q2x']");
+ .assertBody().is("['bar','baz','qux','q1x','q2x']");
}
@Test
@@ -1462,7 +1462,7 @@ public class RestClientTest {
.get("/checkHeader")
.header("Foo","qux")
.run()
- .assertBody().equals("['bar','baz','qux']");
+ .assertBody().is("['bar','baz','qux']");
}
@Test
@@ -1475,7 +1475,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['text/plain']");
+ .assertBody().is("['text/plain']");
}
@Test
@@ -1489,7 +1489,7 @@ public class RestClientTest {
.get("/checkHeader")
.header("Accept","text/plain")
.run()
- .assertBody().equals("['text/foo','text/plain']");
+ .assertBody().is("['text/foo','text/plain']");
}
@Test
@@ -1504,7 +1504,7 @@ public class RestClientTest {
req.setHeader("Accept","text/plain");
req
.run()
- .assertBody().equals("['text/plain']");
+ .assertBody().is("['text/plain']");
}
@Test
@@ -1517,7 +1517,7 @@ public class RestClientTest {
.build()
.get("/checkHeader")
.run()
- .assertBody().equals("['text/plain']");
+ .assertBody().is("['text/plain']");
}
@Test
@@ -1531,7 +1531,7 @@ public class RestClientTest {
.get("/checkHeader")
.header("Content-Type", "text/plain")
.run()
- .assertBody().equals("['text/foo','text/plain']");
+ .assertBody().is("['text/foo','text/plain']");
}
@Test
@@ -1545,7 +1545,7 @@ public class RestClientTest {
.get("/checkHeader")
.header(AddFlag.DEFAULT_FLAGS,"Foo",bean,new XPartSerializer().createPartSession(null),null)
.run()
- .assertBody().equals("['x{f:1}','x{f:1}']");
+ .assertBody().is("['x{f:1}','x{f:1}']");
}
//-----------------------------------------------------------------------------------------------------------------
@@ -1562,7 +1562,7 @@ public class RestClientTest {
.build()
.get("/checkQuery")
.run()
- .assertBody().equals("Foo=bar&Foo=baz");
+ .assertBody().is("Foo=bar&Foo=baz");
}
@Test
@@ -1578,7 +1578,7 @@ public class RestClientTest {
.build()
.get("/checkQuery")
.run()
- .assertBody().equals("Foo=f1&Foo=f2&Foo=f3&Foo=f4&Foo=f5&Foo=f6&Foo=f7");
+ .assertBody().is("Foo=f1&Foo=f2&Foo=f3&Foo=f4&Foo=f5&Foo=f6&Foo=f7");
}
//-----------------------------------------------------------------------------------------------------------------
@@ -1594,7 +1594,7 @@ public class RestClientTest {
.build()
.post("/checkFormData")
.run()
- .assertBody().equals("Foo=bar&Foo=baz");
+ .assertBody().is("Foo=bar&Foo=baz");
}
@Test
@@ -1610,7 +1610,7 @@ public class RestClientTest {
.build()
.post("/checkFormData")
.run()
- .assertBody().equals("Foo=f1&Foo=f2&Foo=f3&Foo=f4&Foo=f5&Foo=f6&Foo=f7");
+ .assertBody().is("Foo=f1&Foo=f2&Foo=f3&Foo=f4&Foo=f5&Foo=f6&Foo=f7");
}
//-----------------------------------------------------------------------------------------------------------------
@@ -1648,7 +1648,7 @@ public class RestClientTest {
.get("/checkHeader")
.header("Foo","f2")
.run()
- .assertBody().equals("['f1','f2','baz']");
+ .assertBody().is("['f1','f2','baz']");
}
@Test
@@ -1757,8 +1757,8 @@ public class RestClientTest {
.header("Check","foo")
.header("Foo","f3")
.run()
- .assertBody().equals("['f1','f2','f3']")
- .assertHeader("Bar").equals("b1");
+ .assertBody().is("['f1','f2','f3']")
+ .assertHeader("Bar").is("b1");
assertEquals(111, XRestCallInterceptor.x);
}
@@ -1774,8 +1774,8 @@ public class RestClientTest {
.header("Check","foo")
.header("Foo","f3")
.run()
- .assertBody().equals("['f1','f2','f3']")
- .assertHeader("Bar").equals("b1");
+ .assertBody().is("['f1','f2','f3']")
+ .assertHeader("Bar").is("b1");
assertEquals(111, XRestCallInterceptor.x);
}
@@ -1836,7 +1836,7 @@ public class RestClientTest {
.post("/echoBody", bean)
.run()
.cacheBody()
- .assertBody().equals("<object><f>1</f></object>")
+ .assertBody().is("<object><f>1</f></object>")
.getBody().as(Bean.class);
assertEqualObjects(b, bean);
@@ -1852,7 +1852,7 @@ public class RestClientTest {
rc
.post("/echoBody", bean)
.run()
- .assertBody().equals("{f:1}");
+ .assertBody().is("{f:1}");
Bean b = rc
.post("/echoBody", bean)
@@ -1860,7 +1860,7 @@ public class RestClientTest {
.contentType("text/xml")
.run()
.cacheBody()
- .assertBody().equals("<object><f>1</f></object>")
+ .assertBody().is("<object><f>1</f></object>")
.getBody().as(Bean.class);
assertEqualObjects(b, bean);
@@ -1870,7 +1870,7 @@ public class RestClientTest {
.contentType("text/json")
.run()
.cacheBody()
- .assertBody().equals("{\"f\":1}")
+ .assertBody().is("{\"f\":1}")
.getBody().as(Bean.class);
assertEqualObjects(b, bean);
}
@@ -1887,7 +1887,7 @@ public class RestClientTest {
.post("/echoBody", bean)
.run()
.cacheBody()
- .assertBody().equals("<object><f>1</f></object>")
+ .assertBody().is("<object><f>1</f></object>")
.getBody().as(Bean.class);
assertEqualObjects(b, bean);
@@ -1905,7 +1905,7 @@ public class RestClientTest {
.post("/echoBody", bean)
.run()
.cacheBody()
- .assertBody().equals("<object><f>1</f></object>")
+ .assertBody().is("<object><f>1</f></object>")
.getBody().as(Bean.class);
assertEqualObjects(b, bean);
@@ -1923,7 +1923,7 @@ public class RestClientTest {
rc
.post("/echoBody", bean)
.run()
- .assertBody().equals("{f:1}");
+ .assertBody().is("{f:1}");
Bean b = rc
.post("/echoBody", bean)
@@ -1931,7 +1931,7 @@ public class RestClientTest {
.contentType("text/xml")
.run()
.cacheBody()
- .assertBody().equals("<object><f>1</f></object>")
+ .assertBody().is("<object><f>1</f></object>")
.getBody().as(Bean.class);
assertEqualObjects(b, bean);
@@ -1941,7 +1941,7 @@ public class RestClientTest {
.contentType("text/json")
.run()
.cacheBody()
- .assertBody().equals("{\"f\":1}")
+ .assertBody().is("{\"f\":1}")
.getBody().as(Bean.class);
assertEqualObjects(b, bean);
}
@@ -1957,7 +1957,7 @@ public class RestClientTest {
rc
.post("/echoBody", bean)
.run()
- .assertBody().equals("{f:1}");
+ .assertBody().is("{f:1}");
Bean b = rc
.post("/echoBody", bean)
@@ -1965,7 +1965,7 @@ public class RestClientTest {
.contentType("text/xml")
.run()
.cacheBody()
- .assertBody().equals("<object><f>1</f></object>")
+ .assertBody().is("<object><f>1</f></object>")
.getBody().as(Bean.class);
assertEqualObjects(b, bean);
@@ -1975,7 +1975,7 @@ public class RestClientTest {
.contentType("text/json")
.run()
.cacheBody()
- .assertBody().equals("{\"f\":1}")
+ .assertBody().is("{\"f\":1}")
.getBody().as(Bean.class);
assertEqualObjects(b, bean);
}
@@ -2035,7 +2035,7 @@ public class RestClientTest {
.get("/")
.header("Foo",bean)
.run()
- .assertHeader("Foo").equals("x{f:1}")
+ .assertHeader("Foo").is("x{f:1}")
.getHeader("Foo").as(Bean.class);
assertEquals("{f:1}", b.toString());
}
@@ -2054,7 +2054,7 @@ public class RestClientTest {
.get("/")
.header("Foo",bean)
.run()
- .assertHeader("Foo").equals("x{f:1}")
+ .assertHeader("Foo").is("x{f:1}")
.getHeader("Foo").as(Bean.class);
assertEquals("{f:1}", b.toString());
}
@@ -2093,7 +2093,7 @@ public class RestClientTest {
.build()
.post("/echoBody", l1)
.run()
- .assertBody().equals("{f1:{_type:'L',f2:1}}");
+ .assertBody().is("{f1:{_type:'L',f2:1}}");
}
@Test
@@ -2108,7 +2108,7 @@ public class RestClientTest {
.build()
.post("/echoBody", l2)
.run()
- .assertBody().equals("{_type:'L',f2:1}");
+ .assertBody().is("{_type:'L',f2:1}");
}
@Test
@@ -2141,7 +2141,7 @@ public class RestClientTest {
.build()
.post("/echoBody", l1)
.run()
- .assertBody().equals("{}");
+ .assertBody().is("{}");
}
@Test
@@ -2154,7 +2154,7 @@ public class RestClientTest {
.build()
.post("/echoBody", bean)
.run()
- .assertBody().equals("\t\t{\n\t\t\tf: 1\n\t\t}");
+ .assertBody().is("\t\t{\n\t\t\tf: 1\n\t\t}");
}
public static class L10 extends SerializerListener {
@@ -2186,7 +2186,7 @@ public class RestClientTest {
.build()
.post("/echoBody", new L11().init())
.run()
- .assertBody().equals("{}");
+ .assertBody().is("{}");
}
@Test
@@ -2200,7 +2200,7 @@ public class RestClientTest {
.build()
.post("/echoBody", x)
.run()
- .assertBody().equals("['a','b','c']");
+ .assertBody().is("['a','b','c']");
}
@Test
@@ -2214,7 +2214,7 @@ public class RestClientTest {
.build()
.post("/echoBody", x)
.run()
- .assertBody().equals("{a:1,b:2,c:3}");
+ .assertBody().is("{a:1,b:2,c:3}");
}
public static class L16 {
@@ -2233,7 +2233,7 @@ public class RestClientTest {
.build()
.post("/echoBody", x)
.run()
- .assertBody().equals("{}");
+ .assertBody().is("{}");
}
public static class L18 {
@@ -2252,7 +2252,7 @@ public class RestClientTest {
.build()
.post("/echoBody", x)
.run()
- .assertBody().equals("{}");
+ .assertBody().is("{}");
}
public static class L20 {
@@ -2270,7 +2270,7 @@ public class RestClientTest {
.build()
.post("/echoBody", x)
.run()
- .assertBody().equals("{f:null}");
+ .assertBody().is("{f:null}");
}
public static class L21 {
@@ -2288,7 +2288,7 @@ public class RestClientTest {
.build()
.post("/echoBody", x)
.run()
- .assertBody().equals("{f:'foo'}");
+ .assertBody().is("{f:'foo'}");
}
public static class L23 {
@@ -2309,7 +2309,7 @@ public class RestClientTest {
.build()
.post("/echoBody", x)
.run()
- .assertBody().equals("{f:'http://localhost:80/context/resource/foo'}");
+ .assertBody().is("{f:'http://localhost:80/context/resource/foo'}");
MockRestClient
.create(A.class)
@@ -2320,7 +2320,7 @@ public class RestClientTest {
.build()
.post("/echoBody", x)
.run()
- .assertBody().equals("{f:'foo'}");
+ .assertBody().is("{f:'foo'}");
}
public static class L26 {
@@ -2350,7 +2350,7 @@ public class RestClientTest {
.build()
.post("/echoBody", x)
.run()
- .assertBody().equals("{\n\tf1: 1,\n\tf2: {\n\t\tf1: 2,\n\t\tf2: {f1:3}\n\t}\n}");
+ .assertBody().is("{\n\tf1: 1,\n\tf2: {\n\t\tf1: 2,\n\t\tf2: {f1:3}\n\t}\n}");
}
public static class L27 {
@@ -2368,7 +2368,7 @@ public class RestClientTest {
.build()
.post("/echoBody", x)
.run()
- .assertBody().equals("{'f1':'foo'}");
+ .assertBody().is("{'f1':'foo'}");
MockRestClient
.create(A.class)
@@ -2377,7 +2377,7 @@ public class RestClientTest {
.build()
.post("/echoBody", x)
.run()
- .assertBody().equals("{|f1|:|foo|}");
+ .assertBody().is("{|f1|:|foo|}");
MockRestClient
.create(A.class)
@@ -2386,7 +2386,7 @@ public class RestClientTest {
.build()
.post("/echoBody", x)
.run()
- .assertBody().equals("{f1:|foo|}");
+ .assertBody().is("{f1:|foo|}");
}
@Test
@@ -2400,7 +2400,7 @@ public class RestClientTest {
.build()
.post("/echoBody", x)
.run()
- .assertBody().equals("{'f1':'foo'}");
+ .assertBody().is("{'f1':'foo'}");
MockRestClient
.create(A.class)
@@ -2409,7 +2409,7 @@ public class RestClientTest {
.build()
.post("/echoBody", x)
.run()
- .assertBody().equals("{f1:'foo'}");
+ .assertBody().is("{f1:'foo'}");
}
@Test
@@ -2423,7 +2423,7 @@ public class RestClientTest {
.build()
.post("/echoBody", x)
.run()
- .assertBody().equals("{\n\tf1: 'foo'\n}");
+ .assertBody().is("{\n\tf1: 'foo'\n}");
}
//-----------------------------------------------------------------------------------------------------------------
@@ -2506,7 +2506,7 @@ public class RestClientTest {
.get("/checkQuery")
.query("Foo", "bar baz")
.run()
- .assertBody().equals("Foo=%27bar+baz%27");
+ .assertBody().is("Foo=%27bar+baz%27");
}
@Test
@@ -2519,19 +2519,19 @@ public class RestClientTest {
rc.get("/checkQuery")
.query("Foo", new String[]{"bar","baz"})
.run()
- .assertBody().equals("Foo=bar%7Cbaz");
+ .assertBody().is("Foo=bar%7Cbaz");
rc.post("/checkFormData")
.formData("Foo", new String[]{"bar","baz"})
.run()
- .assertBody().equals("Foo=bar%7Cbaz");
+ .assertBody().is("Foo=bar%7Cbaz");
rc.get("/checkHeader")
.header("Check", "Foo")
.header("Foo", new String[]{"bar","baz"})
.accept("text/json+simple")
.run()
- .assertBody().equals("['bar|baz']");
+ .assertBody().is("['bar|baz']");
}
//-----------------------------------------------------------------------------------------------------------------
@@ -2562,39 +2562,39 @@ public class RestClientTest {
rc1.post("/echoBody", new O1())
.run()
- .assertBody().equals("'O1'");
+ .assertBody().is("'O1'");
rc2.post("/echoBody", new O1())
.run()
- .assertBody().equals("{f:1}");
+ .assertBody().is("{f:1}");
rc1.get("/checkQuery")
.query("foo", new O1())
.run()
- .assertBody().equals("foo=O1");
+ .assertBody().is("foo=O1");
rc2.get("/checkQuery")
.query("foo", new O1())
.run()
- .assertBody().equals("foo=f%3D1");
+ .assertBody().is("foo=f%3D1");
rc1.formPost("/checkFormData")
.formData("foo", new O1())
.run()
- .assertBody().equals("foo=O1");
+ .assertBody().is("foo=O1");
rc2.formPost("/checkFormData")
.formData("foo", new O1())
.run()
- .assertBody().equals("foo=f%3D1");
+ .assertBody().is("foo=f%3D1");
rc1.get("/checkHeader")
.header("foo", new O1())
.header("Check", "foo")
.run()
- .assertBody().equals("['O1']");
+ .assertBody().is("['O1']");
rc2.get("/checkHeader")
.header("foo", new O1())
.header("Check", "foo")
.run()
- .assertBody().equals("['f=1']");
+ .assertBody().is("['f=1']");
}
public static class O2 {
@@ -2629,8 +2629,8 @@ public class RestClientTest {
.header("X", new O2(1))
.run()
.cacheBody()
- .assertBody().equals("1")
- .assertHeader("X").equals("1")
+ .assertBody().is("1")
+ .assertHeader("X").is("1")
;
assertEquals(1, rr.getBody().as(O2.class).f);
assertEquals(1, rr.getHeader("X").as(O2.class).f);
@@ -2664,8 +2664,8 @@ public class RestClientTest {
.header("X", new O9().init())
.run()
.cacheBody()
- .assertBody().equals("{f1:1,f2:2}")
- .assertHeader("X").equals("f1=1,f2=2")
+ .assertBody().is("{f1:1,f2:2}")
+ .assertHeader("X").is("f1=1,f2=2")
;
assertEquals(2, rr.getBody().as(O9.class).f2);
assertEquals(2, rr.getHeader("X").as(O9.class).f2);
@@ -2714,8 +2714,8 @@ public class RestClientTest {
.header("X", new O10().init())
.run()
.cacheBody()
- .assertBody().equals("{f1:1}")
- .assertHeader("X").equals("f1=1")
+ .assertBody().is("{f1:1}")
+ .assertHeader("X").is("f1=1")
;
assertEquals(0, rr.getBody().as(O10.class).f2);
assertEquals(0, rr.getHeader("X").as(O10.class).f2);
@@ -2729,8 +2729,8 @@ public class RestClientTest {
.header("X", new O10().init())
.run()
.cacheBody()
- .assertBody().equals("{f1:1}")
- .assertHeader("X").equals("f1=1")
+ .assertBody().is("{f1:1}")
+ .assertHeader("X").is("f1=1")
;
assertEquals(0, rr.getBody().as(O10.class).f2);
assertEquals(0, rr.getHeader("X").as(O10.class).f2);
@@ -2744,8 +2744,8 @@ public class RestClientTest {
.header("X", new O10().init())
.run()
.cacheBody()
- .assertBody().equals("{f1:1}")
- .assertHeader("X").equals("f1=1")
+ .assertBody().is("{f1:1}")
+ .assertHeader("X").is("f1=1")
;
assertEquals(0, rr.getBody().as(O10.class).f2);
assertEquals(0, rr.getHeader("X").as(O10.class).f2);
@@ -2759,8 +2759,8 @@ public class RestClientTest {
.header("X", new O10().init())
.run()
.cacheBody()
- .assertBody().equals("{f1:1}")
- .assertHeader("X").equals("f1=1")
+ .assertBody().is("{f1:1}")
+ .assertHeader("X").is("f1=1")
;
assertEquals(0, rr.getBody().as(O10.class).f2);
assertEquals(0, rr.getHeader("X").as(O10.class).f2);
@@ -2774,8 +2774,8 @@ public class RestClientTest {
.header("X", new O10().init())
.run()
.cacheBody()
- .assertBody().equals("{f3:3}")
- .assertHeader("X").equals("f3=3")
+ .assertBody().is("{f3:3}")
+ .assertHeader("X").is("f3=3")
;
assertEquals(3, rr.getBody().as(O10.class).f3);
assertEquals(3, rr.getHeader("X").as(O10.class).f3);
@@ -2820,8 +2820,8 @@ public class RestClientTest {
.header("X", new O18().init())
.run()
.cacheBody()
- .assertBody().equals("{f1:1,f2:2}")
- .assertHeader("X").equals("f1=1,f2=2")
+ .assertBody().is("{f1:1,f2:2}")
+ .assertHeader("X").is("f1=1,f2=2")
;
assertEquals(2, rr.getBody().as(O18.class).f2);
assertEquals(2, rr.getHeader("X").as(O18.class).f2);
@@ -2849,8 +2849,8 @@ public class RestClientTest {
.post("/test", new O21("1"))
.header("X", new O21("1"))
.run()
- .assertBody().equals("{f1:'1'}")
- .assertHeader("X").equals("f1=1")
+ .assertBody().is("{f1:'1'}")
+ .assertHeader("X").is("f1=1")
;
MockRestClient
.create(O2R.class)
@@ -2860,8 +2860,8 @@ public class RestClientTest {
.post("/test", new O21("1"))
.header("X", new O21("1"))
.run()
- .assertBody().equals("'1'")
- .assertHeader("X").equals("1")
+ .assertBody().is("'1'")
+ .assertHeader("X").is("1")
;
}
@@ -2874,8 +2874,8 @@ public class RestClientTest {
.post("/test", new O21("1"))
.header("X", new O21("1"))
.run()
- .assertBody().equals("{f1:'1'}")
- .assertHeader("X").equals("f1=1")
+ .assertBody().is("{f1:'1'}")
+ .assertHeader("X").is("f1=1")
;
MockRestClient
.create(O2R.class)
@@ -2885,8 +2885,8 @@ public class RestClientTest {
.post("/test", new O21("1"))
.header("X", new O21("1"))
.run()
- .assertBody().equals("'1'")
- .assertHeader("X").equals("1")
+ .assertBody().is("'1'")
+ .assertHeader("X").is("1")
;
}
@@ -2924,8 +2924,8 @@ public class RestClientTest {
.post("/test", new O25().init())
.header("X", new O25().init())
.run()
- .assertBody().equals("{f1:1,f2:2}")
- .assertHeader("X").equals("f1=1,f2=2")
+ .assertBody().is("{f1:1,f2:2}")
+ .assertHeader("X").is("f1=1,f2=2")
;
MockRestClient
.create(O2R.class)
@@ -2935,8 +2935,8 @@ public class RestClientTest {
.post("/test", new O25().init())
.header("X", new O25().init())
.run()
- .assertBody().equals("{f1:1}")
- .assertHeader("X").equals("f1=1")
+ .assertBody().is("{f1:1}")
+ .assertHeader("X").is("f1=1")
;
}
@@ -2950,8 +2950,8 @@ public class RestClientTest {
.post("/test", new O25().init())
.header("X", new O25().init())
.run()
- .assertBody().equals("{f2:2}")
- .assertHeader("X").equals("f2=2")
+ .assertBody().is("{f2:2}")
+ .assertHeader("X").is("f2=2")
;
MockRestClient
.create(O2R.class)
@@ -2961,8 +2961,8 @@ public class RestClientTest {
.post("/test", new O25().init())
.header("X", new O25().init())
.run()
- .assertBody().equals("{f2:2}")
- .assertHeader("X").equals("f2=2")
+ .assertBody().is("{f2:2}")
+ .assertHeader("X").is("f2=2")
;
MockRestClient
.create(O2R.class)
@@ -2972,8 +2972,8 @@ public class RestClientTest {
.post("/test", new O25().init())
.header("X", new O25().init())
.run()
- .assertBody().equals("{f2:2}")
- .assertHeader("X").equals("f2=2")
+ .assertBody().is("{f2:2}")
+ .assertHeader("X").is("f2=2")
;
MockRestClient
.create(O2R.class)
@@ -2983,8 +2983,8 @@ public class RestClientTest {
.post("/test", new O25().init())
.header("X", new O25().init())
.run()
- .assertBody().equals("{f2:2}")
- .assertHeader("X").equals("f2=2")
+ .assertBody().is("{f2:2}")
+ .assertHeader("X").is("f2=2")
;
}
@@ -3001,8 +3001,8 @@ public class RestClientTest {
.header("X", new O25().init())
.run()
.cacheBody()
- .assertBody().equals("{f1:1,f2:2}")
- .assertHeader("X").equals("f1=1,f2=2")
+ .assertBody().is("{f1:1,f2:2}")
+ .assertHeader("X").is("f1=1,f2=2")
;
assertEquals("1/0", rr.getBody().as(O25.class).toString());
assertEquals("1/0", rr.getHeader("X").as(O25.class).toString());
@@ -3016,8 +3016,8 @@ public class RestClientTest {
.header("X", new O25().init())
.run()
.cacheBody()
- .assertBody().equals("{f1:1,f2:2}")
- .assertHeader("X").equals("f1=1,f2=2")
+ .assertBody().is("{f1:1,f2:2}")
+ .assertHeader("X").is("f1=1,f2=2")
;
assertEquals("1/0", rr.getBody().as(O25.class).toString());
assertEquals("1/0", rr.getHeader("X").as(O25.class).toString());
@@ -3031,8 +3031,8 @@ public class RestClientTest {
.header("X", new O25().init())
.run()
.cacheBody()
- .assertBody().equals("{f1:1,f2:2}")
- .assertHeader("X").equals("f1=1,f2=2")
+ .assertBody().is("{f1:1,f2:2}")
+ .assertHeader("X").is("f1=1,f2=2")
;
assertEquals("1/0", rr.getBody().as(O25.class).toString());
assertEquals("1/0", rr.getHeader("X").as(O25.class).toString());
@@ -3051,8 +3051,8 @@ public class RestClientTest {
.header("X", new O25().init())
.run()
.cacheBody()
- .assertBody().equals("{f1:1}")
- .assertHeader("X").equals("f1=1")
+ .assertBody().is("{f1:1}")
+ .assertHeader("X").is("f1=1")
;
assertEquals("1/0", rr.getBody().as(O25.class).toString());
assertEquals("1/0", rr.getHeader("X").as(O25.class).toString());
@@ -3066,8 +3066,8 @@ public class RestClientTest {
.header("X", new O25().init())
.run()
.cacheBody()
- .assertBody().equals("{f1:1}")
- .assertHeader("X").equals("f1=1")
+ .assertBody().is("{f1:1}")
+ .assertHeader("X").is("f1=1")
;
assertEquals("1/0", rr.getBody().as(O25.class).toString());
assertEquals("1/0", rr.getHeader("X").as(O25.class).toString());
@@ -3081,8 +3081,8 @@ public class RestClientTest {
.header("X", new O25().init())
.run()
.cacheBody()
- .assertBody().equals("{f1:1}")
- .assertHeader("X").equals("f1=1")
+ .assertBody().is("{f1:1}")
+ .assertHeader("X").is("f1=1")
;
assertEquals("1/0", rr.getBody().as(O25.class).toString());
assertEquals("1/0", rr.getHeader("X").as(O25.class).toString());
@@ -3098,8 +3098,8 @@ public class RestClientTest {
.post("/test", new O25().init())
.header("X", new O25().init())
.run()
- .assertBody().equals("{f2:2}")
- .assertHeader("X").equals("f2=2")
+ .assertBody().is("{f2:2}")
+ .assertHeader("X").is("f2=2")
;
MockRestClient
.create(O2R.class)
@@ -3109,8 +3109,8 @@ public class RestClientTest {
.post("/test", new O25().init())
.header("X", new O25().init())
.run()
- .assertBody().equals("{f2:2}")
- .assertHeader("X").equals("f2=2")
+ .assertBody().is("{f2:2}")
+ .assertHeader("X").is("f2=2")
;
MockRestClient
.create(O2R.class)
@@ -3120,8 +3120,8 @@ public class RestClientTest {
.post("/test", new O25().init())
.header("X", new O25().init())
.run()
- .assertBody().equals("{f2:2}")
- .assertHeader("X").equals("f2=2")
+ .assertBody().is("{f2:2}")
+ .assertHeader("X").is("f2=2")
;
MockRestClient
.create(O2R.class)
@@ -3131,8 +3131,8 @@ public class RestClientTest {
.post("/test", new O25().init())
.header("X", new O25().init())
.run()
- .assertBody().equals("{f2:2}")
- .assertHeader("X").equals("f2=2")
+ .assertBody().is("{f2:2}")
+ .assertHeader("X").is("f2=2")
;
}
@@ -3216,7 +3216,7 @@ public class RestClientTest {
.post("/echoBody", m)
.run()
.cacheBody()
- .assertBody().equals("{x:{_type:'foo',foo:'1'},y:{_type:'bar',foo:'2'}}")
+ .assertBody().is("{x:{_type:'foo',foo:'1'},y:{_type:'bar',foo:'2'}}")
.getBody().as(OMap.class);
;
assertTrue(m.get("x") instanceof O33a);
@@ -3232,7 +3232,7 @@ public class RestClientTest {
.post("/echoBody", new O33c().init())
.run()
.cacheBody()
- .assertBody().equals("{foo:{_type:'foo',foo:'1'}}")
+ .assertBody().is("{foo:{_type:'foo',foo:'1'}}")
.getBody().as(O33c.class);
;
assertTrue(o33c.foo instanceof O33a);
@@ -3635,7 +3635,7 @@ public class RestClientTest {
.post("/echoBody", new O43().init())
.run()
.cacheBody()
- .assertBody().equals("{foo:1}")
+ .assertBody().is("{foo:1}")
.getBody().as(O43.class)
;
assertEquals(1, x.getFoo());
@@ -3647,7 +3647,7 @@ public class RestClientTest {
.build()
.post("/echoBody", new O43().init())
.run()
- .assertBody().equals("{foo:1}")
+ .assertBody().is("{foo:1}")
.getBody().as(O43.class)
;
assertEquals(1, x.getFoo());
@@ -3685,7 +3685,7 @@ public class RestClientTest {
.post("/echoBody", new O44().init())
.run()
.cacheBody()
- .assertBody().equals("{foo:1}")
+ .assertBody().is("{foo:1}")
.getBody().as(O44.class)
;
assertEquals(1, x.foo);
@@ -3715,7 +3715,7 @@ public class RestClientTest {
.post("/echoBody", new O44().init())
.run()
.cacheBody()
- .assertBody().equals("{foo:1}")
+ .assertBody().is("{foo:1}")
.getBody().as(O44.class)
;
assertEquals(1, x.foo);
@@ -3748,7 +3748,7 @@ public class RestClientTest {
.post("/echoBody", new O46().init())
.run()
.cacheBody()
- .assertBody().equals("'1'")
+ .assertBody().is("'1'")
.getBody().as(O46.class)
;
assertEquals(1, x.foo);
@@ -3764,7 +3764,7 @@ public class RestClientTest {
.post("/echoBody", new O46().init())
.run()
.cacheBody()
- .assertBody().equals("'1'")
+ .assertBody().is("'1'")
.getBody().as(O46.class)
;
assertEquals(1, x.foo);
@@ -3804,7 +3804,7 @@ public class RestClientTest {
.post("/echoBody", new O48().init())
.run()
.cacheBody()
- .assertBody().equals("{foo:1}")
+ .assertBody().is("{foo:1}")
.getBody().as(O48.class)
;
assertEquals(1, x.foo);
diff --git a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockHttpClientConnection.java b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockHttpClientConnection.java
index 77ef590..f6fffa9 100644
--- a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockHttpClientConnection.java
+++ b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockHttpClientConnection.java
@@ -94,7 +94,7 @@ public class MockHttpClientConnection implements HttpClientConnection {
@Override /* HttpClientConnection */
public HttpResponse receiveResponseHeader() throws HttpException, IOException {
try {
- res = req.execute();
+ res = req.run();
HttpResponse response = new BasicHttpResponse(new BasicStatusLine(HttpVersion.HTTP_1_1, res.getStatus(), res.getMessage()));
for (Map.Entry<String,String[]> e : res.getHeaders().entrySet())
for (String hv : e.getValue())
diff --git a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockHttpRequest.java b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockHttpRequest.java
index ab94b8c..b8d109c 100644
--- a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockHttpRequest.java
+++ b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockHttpRequest.java
@@ -60,6 +60,6 @@ public interface MockHttpRequest {
* @return The response for the request.
* @throws Exception
*/
- MockHttpResponse execute() throws Exception;
+ MockHttpResponse run() throws Exception;
}
diff --git a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockServletRequest.java b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockServletRequest.java
index be5692b..6199b39 100644
--- a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockServletRequest.java
+++ b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockServletRequest.java
@@ -279,7 +279,7 @@ public class MockServletRequest implements HttpServletRequest, MockHttpRequest {
* @throws ServletException Servlet exception occurred.
*/
@Override /* MockHttpRequest */
- public MockServletResponse execute() throws ServletException, IOException {
+ public MockServletResponse run() throws ServletException, IOException {
MockServletResponse res = MockServletResponse.create();
restContext.getCallHandler().execute(this, res);
diff --git a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockServletResponse.java b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockServletResponse.java
index 4759843..b2da99e 100644
--- a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockServletResponse.java
+++ b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockServletResponse.java
@@ -12,12 +12,8 @@
// ***************************************************************************************************************************
package org.apache.juneau.rest.mock2;
-import static org.apache.juneau.internal.StringUtils.*;
-
import java.io.*;
-import java.text.*;
import java.util.*;
-import java.util.regex.*;
import javax.servlet.*;
import javax.servlet.http.*;
@@ -349,144 +345,95 @@ public class MockServletResponse implements HttpServletResponse, MockHttpRespons
}
/**
- * Throws an {@link AssertionError} if the response status does not match the expected status.
+ * Returns the body of the request.
*
- * @param status The expected status.
- * @return This object (for method chaining).
- * @throws AssertionError Thrown if status does not match.
+ * @return The body of the request.
*/
- public MockServletResponse assertStatus(int status) throws AssertionError {
- if (getStatus() != status)
- throw new MockAssertionError("Response did not have the expected status.\n\tExpected=[{0}]\n\tActual=[{1}]", status, getStatus());
- return this;
+ @Override /* MockHttpResponse */
+ public byte[] getBody() {
+ return baos.toByteArray();
}
- /**
- * Throws an {@link AssertionError} if the response body does not contain the expected text.
- *
- * @param text The expected text of the body.
- * @return This object (for method chaining).
- * @throws AssertionError Thrown if the body does not contain the expected text.
- */
- public MockServletResponse assertBody(String text) throws AssertionError {
- if (! StringUtils.isEquals(text, getBodyAsString()))
- throw new MockAssertionError("Response did not have the expected text.\n\tExpected=[{0}]\n\tActual=[{1}]", text, getBodyAsString());
- return this;
+ @Override /* MockHttpResponse */
+ public Map<String,String[]> getHeaders() {
+ return headerMap;
}
- /**
- * Throws an {@link AssertionError} if the response body does not contain all of the expected substrings.
- *
- * @param substrings The expected substrings.
- * @return This object (for method chaining).
- * @throws AssertionError Thrown if the body does not contain one or more of the expected substrings.
- */
- public MockServletResponse assertBodyContains(String...substrings) throws AssertionError {
- String text = getBodyAsString();
- for (String substring : substrings)
- if (! contains(text, substring))
- throw new MockAssertionError("Response did not have the expected substring.\n\tExpected=[{0}]\n\tBody=[{1}]", substring, text);
- return this;
- }
+ //------------------------------------------------------------------------------------------------------------------
+ // Assertions
+ //------------------------------------------------------------------------------------------------------------------
/**
- * Throws an {@link AssertionError} if the response body does not match the specified pattern.
+ * Used for fluent assertion calls against the response status code.
*
- * <p>
- * A pattern is a simple string containing <js>"*"</js> to represent zero or more arbitrary characters.
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode w800'>
+ * <jc>// Validates the response status code is 200 or 404.</jc>
+ * mockClient
+ * .get(<jsf>URL</jsf>)
+ * .run()
+ * .assertStatus().isOneOf(200,404);
+ * </p>
*
- * @param pattern The pattern to match against.
- * @return This object (for method chaining).
- * @throws AssertionError Thrown if the body does not match the specified pattern.
+ * @return A new fluent-style assertion object.
*/
- public MockServletResponse assertBodyMatches(String pattern) throws AssertionError {
- String text = getBodyAsString();
- if (! getMatchPattern(pattern).matcher(text).matches())
- throw new MockAssertionError("Response did not match expected pattern.\n\tPattern=[{0}]\n\tBody=[{1}]", pattern, text);
- return this;
+ public MockServletResponseStatusCodeAssertion assertStatus() {
+ return new MockServletResponseStatusCodeAssertion(getStatus(), this);
}
/**
- * Throws an {@link AssertionError} if the response body does not match the specified regular expression.
+ * Used for fluent assertion calls against the response body.
*
- * <p>
- * A pattern is a simple string containing <js>"*"</js> to represent zero or more arbitrary characters.
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode w800'>
+ * <jc>// Validates the response body has the text "OK".</jc>
+ * mockClient
+ * .get(<jsf>URL</jsf>)
+ * .run()
+ * .assertBody().equals(<js>"OK"</js>);
+ * </p>
*
- * @param regExp The regular expression to match against.
- * @return This object (for method chaining).
- * @throws AssertionError Thrown if the body does not match the specified regular expression.
+ * @return A new fluent-style assertion object.
*/
- public MockServletResponse assertBodyMatchesRE(String regExp) throws AssertionError {
- String text = getBodyAsString();
- if (! Pattern.compile(regExp).matcher(text).matches())
- throw new MockAssertionError("Response did not match expected regular expression.\n\tRegExp=[{0}]\n\tBody=[{1}]", regExp, text);
- return this;
+ public MockServletResponseBodyAssertion assertBody() {
+ return new MockServletResponseBodyAssertion(getBodyAsString(), this);
}
/**
- * Throws an {@link AssertionError} if the response does not contain the expected character encoding.
+ * Used for fluent assertion calls against response headers.
*
- * @param value The expected character encoding.
- * @return This object (for method chaining).
- * @throws AssertionError Thrown if the response does not contain the expected character encoding.
- */
- public MockServletResponse assertCharset(String value) {
- if (! StringUtils.isEquals(value, getCharacterEncoding()))
- throw new MockAssertionError("Response did not have the expected character encoding.\n\tExpected=[{0}]\n\tActual=[{1}]", value, getBodyAsString());
- return this;
- }
-
- /**
- * Throws an {@link AssertionError} if the response does not contain the expected header value.
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode w800'>
+ * <jc>// Validates the response has the header Foo and contains "bar".</jc>
+ * mockClient
+ * .get(<jsf>URL</jsf>)
+ * .run()
+ * .assertHeader(<js>"Foo"</js>).exists()
+ * .assertHeader(<js>"Foo"</js>).contains(<js>"bar"</js>);
+ * </p>
*
* @param name The header name.
- * @param value The expected header value.
- * @return This object (for method chaining).
- * @throws AssertionError Thrown if the response does not contain the expected header value.
+ * @return A new fluent-style assertion object.
*/
- public MockServletResponse assertHeader(String name, String value) {
- if (! StringUtils.isEquals(value, getHeader(name)))
- throw new MockAssertionError("Response did not have the expected value for header {0}.\n\tExpected=[{1}]\n\tActual=[{2}]", name, value, getHeader(name));
- return this;
+ public MockServletResponseHeaderAssertion assertHeader(String name) {
+ return new MockServletResponseHeaderAssertion(getHeader(name), this);
}
/**
- * Throws an {@link AssertionError} if the response header does not contain all of the expected substrings.
+ * Used for fluent assertion calls against the response charset.
*
- * @param name The header name.
- * @param substrings The expected substrings.
- * @return This object (for method chaining).
- * @throws AssertionError Thrown if the header does not contain one or more of the expected substrings.
- */
- public MockServletResponse assertHeaderContains(String name, String...substrings) {
- String text = getHeader(name);
- for (String substring : substrings)
- if (! contains(text, substring))
- throw new MockAssertionError("Response did not have the expected substring in header {0}.\n\tExpected=[{1}]\n\tHeader=[{2}]", name, substring, text);
- return this;
- }
-
- /**
- * Returns the body of the request.
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode w800'>
+ * <jc>// Validates the response has the header Foo and contains "bar".</jc>
+ * mockClient
+ * .get(<jsf>URL</jsf>)
+ * .run()
+ * .assertCharset().equals("utf-8");
+ * </p>
*
- * @return The body of the request.
+ * @return A new fluent-style assertion object.
*/
- @Override /* MockHttpResponse */
- public byte[] getBody() {
- return baos.toByteArray();
- }
-
- @Override /* MockHttpResponse */
- public Map<String,String[]> getHeaders() {
- return headerMap;
- }
-
- private static class MockAssertionError extends AssertionError {
- private static final long serialVersionUID = 1L;
-
- MockAssertionError(String msg, Object...args) {
- super(MessageFormat.format(msg, args));
- System.err.println(getMessage()); // NOT DEBUG
- }
+ public MockServletResponseHeaderAssertion assertCharset() {
+ return new MockServletResponseHeaderAssertion(getCharacterEncoding(), this);
}
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseStatusAnnotationTest.java b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockServletResponseBodyAssertion.java
similarity index 64%
copy from juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseStatusAnnotationTest.java
copy to juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockServletResponseBodyAssertion.java
index 7aea20e..73d0a49 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseStatusAnnotationTest.java
+++ b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockServletResponseBodyAssertion.java
@@ -10,34 +10,22 @@
// * "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.annotation;
+package org.apache.juneau.rest.mock2;
-import static org.junit.runners.MethodSorters.*;
+import org.apache.juneau.utils.*;
-import org.apache.juneau.*;
-import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.rest.mock2.*;
-import org.junit.*;
+/**
+ * Allows for fluent-style assertions on the HTTP response body.
+ */
+public class MockServletResponseBodyAssertion extends FluentStringAssertion<MockServletResponse> {
-@FixMethodOrder(NAME_ASCENDING)
-public class ResponseStatusAnnotationTest {
-
- //=================================================================================================================
- // Test on parameter
- //=================================================================================================================
-
- @Rest
- public static class A {
- @RestMethod
- public void a01(@ResponseStatus Value<Integer> status) {
- status.set(100);
- }
- }
-
- static MockRest a = MockRest.build(A.class);
-
- @Test
- public void a01() throws Exception {
- a.get("/a01").execute().assertStatus(100);
+ /**
+ * Constructor
+ *
+ * @param text The body text.
+ * @param returns The fluent return object.
+ */
+ public MockServletResponseBodyAssertion(String text, MockServletResponse returns) {
+ super(text, returns);
}
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseStatusAnnotationTest.java b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockServletResponseHeaderAssertion.java
similarity index 64%
copy from juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseStatusAnnotationTest.java
copy to juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockServletResponseHeaderAssertion.java
index 7aea20e..669eb73 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseStatusAnnotationTest.java
+++ b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockServletResponseHeaderAssertion.java
@@ -10,34 +10,22 @@
// * "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.annotation;
+package org.apache.juneau.rest.mock2;
-import static org.junit.runners.MethodSorters.*;
+import org.apache.juneau.utils.*;
-import org.apache.juneau.*;
-import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.rest.mock2.*;
-import org.junit.*;
+/**
+ * Allows for fluent-style assertions on the HTTP response header.
+ */
+public class MockServletResponseHeaderAssertion extends FluentStringAssertion<MockServletResponse> {
-@FixMethodOrder(NAME_ASCENDING)
-public class ResponseStatusAnnotationTest {
-
- //=================================================================================================================
- // Test on parameter
- //=================================================================================================================
-
- @Rest
- public static class A {
- @RestMethod
- public void a01(@ResponseStatus Value<Integer> status) {
- status.set(100);
- }
- }
-
- static MockRest a = MockRest.build(A.class);
-
- @Test
- public void a01() throws Exception {
- a.get("/a01").execute().assertStatus(100);
+ /**
+ * Constructor
+ *
+ * @param text The HTTP header value, or <jk>null</jk> if header not found.
+ * @param returns The fluent return object.
+ */
+ public MockServletResponseHeaderAssertion(String text, MockServletResponse returns) {
+ super(text, returns);
}
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseStatusAnnotationTest.java b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockServletResponseStatusCodeAssertion.java
similarity index 64%
copy from juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseStatusAnnotationTest.java
copy to juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockServletResponseStatusCodeAssertion.java
index 7aea20e..9da68a6 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseStatusAnnotationTest.java
+++ b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockServletResponseStatusCodeAssertion.java
@@ -10,34 +10,22 @@
// * "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.annotation;
+package org.apache.juneau.rest.mock2;
-import static org.junit.runners.MethodSorters.*;
+import org.apache.juneau.utils.*;
-import org.apache.juneau.*;
-import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.rest.mock2.*;
-import org.junit.*;
+/**
+ * Allows for fluent-style assertions on the HTTP response status code.
+ */
+public class MockServletResponseStatusCodeAssertion extends FluentIntAssertion<MockServletResponse> {
-@FixMethodOrder(NAME_ASCENDING)
-public class ResponseStatusAnnotationTest {
-
- //=================================================================================================================
- // Test on parameter
- //=================================================================================================================
-
- @Rest
- public static class A {
- @RestMethod
- public void a01(@ResponseStatus Value<Integer> status) {
- status.set(100);
- }
- }
-
- static MockRest a = MockRest.build(A.class);
-
- @Test
- public void a01() throws Exception {
- a.get("/a01").execute().assertStatus(100);
+ /**
+ * Constructor.
+ *
+ * @param value Status code.
+ * @param returns Fluent-style return object.
+ */
+ public MockServletResponseStatusCodeAssertion(int value, MockServletResponse returns) {
+ super(value, returns);
}
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/BasicRestInfoProviderTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/BasicRestInfoProviderTest.java
index b797113..7eafc9e 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/BasicRestInfoProviderTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/BasicRestInfoProviderTest.java
@@ -2341,7 +2341,7 @@ public class BasicRestInfoProviderTest {
@Test
public void p01_bodyWithReadOnlyProperty() throws Exception {
- Swagger s = JsonParser.DEFAULT.parse(p.options("/").accept("application/json").execute().getBodyAsString(), Swagger.class);
+ Swagger s = JsonParser.DEFAULT.parse(p.options("/").accept("application/json").run().getBodyAsString(), Swagger.class);
Operation o = s.getOperation("/", "get");
ParameterInfo pi = o.getParameter("body", null);
assertEquals("{\n\tf1: 1,\n\tf2: 2\n}", pi.getExamples().get("application/json+simple"));
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/BeanContextPropertiesTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/BeanContextPropertiesTest.java
index ed95d3a..6bd1faf 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/BeanContextPropertiesTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/BeanContextPropertiesTest.java
@@ -48,7 +48,7 @@ public class BeanContextPropertiesTest {
@Test
public void a01_testClassTransforms() throws Exception {
- a.get("/2001-07-04T15:30:45Z?d2=2001-07-05T15:30:45Z").header("X-D3", "2001-07-06T15:30:45Z").execute()
- .assertBody("d1=2001-07-04T15:30:45Z,d2=2001-07-05T15:30:45Z,d3=2001-07-06T15:30:45Z");
+ a.get("/2001-07-04T15:30:45Z?d2=2001-07-05T15:30:45Z").header("X-D3", "2001-07-06T15:30:45Z").run()
+ .assertBody().is("d1=2001-07-04T15:30:45Z,d2=2001-07-05T15:30:45Z,d3=2001-07-06T15:30:45Z");
}
}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/DebugModeTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/DebugModeTest.java
index b4e17f4..a4e2070 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/DebugModeTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/DebugModeTest.java
@@ -119,39 +119,39 @@ public class DebugModeTest {
@Test
public void a01_debugDefault() throws Exception {
- assertEquals("false", a1.get("/a01").execute().getBodyAsString());
+ assertEquals("false", a1.get("/a01").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", a1d.get("/a01").execute().getBodyAsString());
+ assertEquals("false", a1d.get("/a01").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", a1.get("/a02").execute().getBodyAsString());
+ assertEquals("false", a1.get("/a02").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", a1d.get("/a02").execute().getBodyAsString());
+ assertEquals("false", a1d.get("/a02").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", a1.get("/a03").execute().getBodyAsString());
+ assertEquals("true", a1.get("/a03").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /a03");
- assertEquals("true", a1d.get("/a03").execute().getBodyAsString());
+ assertEquals("true", a1d.get("/a03").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /a03");
- assertEquals("false", a1.get("/a04").execute().getBodyAsString());
+ assertEquals("false", a1.get("/a04").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", a1d.get("/a04").execute().getBodyAsString());
+ assertEquals("true", a1d.get("/a04").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /a04");
- assertEquals("false", a1.get("/a05").execute().getBodyAsString());
+ assertEquals("false", a1.get("/a05").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", a1d.get("/a05").execute().getBodyAsString());
+ assertEquals("false", a1d.get("/a05").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", a1.get("/a06").execute().getBodyAsString());
+ assertEquals("true", a1.get("/a06").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", a1d.get("/a06").execute().getBodyAsString());
+ assertEquals("true", a1d.get("/a06").run().getBodyAsString());
assertLogged(true);
- assertEquals("false", a1.get("/a07").execute().getBodyAsString());
+ assertEquals("false", a1.get("/a07").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", a1d.get("/a07").execute().getBodyAsString());
+ assertEquals("false", a1d.get("/a07").run().getBodyAsString());
assertLogged(false);
}
@@ -194,39 +194,39 @@ public class DebugModeTest {
@Test
public void a01a_debugDefault() throws Exception {
- assertEquals("false", a1a.get("/a01").execute().getBodyAsString());
+ assertEquals("false", a1a.get("/a01").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", a1ad.get("/a01").execute().getBodyAsString());
+ assertEquals("false", a1ad.get("/a01").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", a1a.get("/a02").execute().getBodyAsString());
+ assertEquals("false", a1a.get("/a02").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", a1ad.get("/a02").execute().getBodyAsString());
+ assertEquals("false", a1ad.get("/a02").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", a1a.get("/a03").execute().getBodyAsString());
+ assertEquals("true", a1a.get("/a03").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /a03");
- assertEquals("true", a1ad.get("/a03").execute().getBodyAsString());
+ assertEquals("true", a1ad.get("/a03").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /a03");
- assertEquals("false", a1a.get("/a04").execute().getBodyAsString());
+ assertEquals("false", a1a.get("/a04").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", a1ad.get("/a04").execute().getBodyAsString());
+ assertEquals("true", a1ad.get("/a04").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /a04");
- assertEquals("false", a1a.get("/a05").execute().getBodyAsString());
+ assertEquals("false", a1a.get("/a05").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", a1ad.get("/a05").execute().getBodyAsString());
+ assertEquals("false", a1ad.get("/a05").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", a1a.get("/a06").execute().getBodyAsString());
+ assertEquals("true", a1a.get("/a06").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", a1ad.get("/a06").execute().getBodyAsString());
+ assertEquals("true", a1ad.get("/a06").run().getBodyAsString());
assertLogged(true);
- assertEquals("false", a1a.get("/a07").execute().getBodyAsString());
+ assertEquals("false", a1a.get("/a07").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", a1ad.get("/a07").execute().getBodyAsString());
+ assertEquals("false", a1ad.get("/a07").run().getBodyAsString());
assertLogged(false);
}
@@ -273,39 +273,39 @@ public class DebugModeTest {
@Test
public void a02_debugTrue() throws Exception {
- assertEquals("true", a2.get("/a01").execute().getBodyAsString());
+ assertEquals("true", a2.get("/a01").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", a2d.get("/a01").execute().getBodyAsString());
+ assertEquals("true", a2d.get("/a01").run().getBodyAsString());
assertLogged(true);
- assertEquals("false", a2.get("/a02").execute().getBodyAsString());
+ assertEquals("false", a2.get("/a02").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", a2d.get("/a02").execute().getBodyAsString());
+ assertEquals("false", a2d.get("/a02").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", a2.get("/a03").execute().getBodyAsString());
+ assertEquals("true", a2.get("/a03").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", a2d.get("/a03").execute().getBodyAsString());
+ assertEquals("true", a2d.get("/a03").run().getBodyAsString());
assertLogged(true);
- assertEquals("false", a2.get("/a04").execute().getBodyAsString());
+ assertEquals("false", a2.get("/a04").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", a2d.get("/a04").execute().getBodyAsString());
+ assertEquals("true", a2d.get("/a04").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", a2.get("/a05").execute().getBodyAsString());
+ assertEquals("true", a2.get("/a05").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", a2d.get("/a05").execute().getBodyAsString());
+ assertEquals("true", a2d.get("/a05").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", a2.get("/a06").execute().getBodyAsString());
+ assertEquals("true", a2.get("/a06").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", a2d.get("/a06").execute().getBodyAsString());
+ assertEquals("true", a2d.get("/a06").run().getBodyAsString());
assertLogged(true);
- assertEquals("false", a2.get("/a07").execute().getBodyAsString());
+ assertEquals("false", a2.get("/a07").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", a2d.get("/a07").execute().getBodyAsString());
+ assertEquals("false", a2d.get("/a07").run().getBodyAsString());
assertLogged(false);
}
@@ -352,39 +352,39 @@ public class DebugModeTest {
@Test
public void a03_restDebugFalse() throws Exception {
- assertEquals("false", a3.get("/a01").execute().getBodyAsString());
+ assertEquals("false", a3.get("/a01").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", a3d.get("/a01").execute().getBodyAsString());
+ assertEquals("false", a3d.get("/a01").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", a3.get("/a02").execute().getBodyAsString());
+ assertEquals("false", a3.get("/a02").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", a3d.get("/a02").execute().getBodyAsString());
+ assertEquals("false", a3d.get("/a02").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", a3.get("/a03").execute().getBodyAsString());
+ assertEquals("true", a3.get("/a03").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /a03");
- assertEquals("true", a3d.get("/a03").execute().getBodyAsString());
+ assertEquals("true", a3d.get("/a03").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /a03");
- assertEquals("false", a3.get("/a04").execute().getBodyAsString());
+ assertEquals("false", a3.get("/a04").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", a3d.get("/a04").execute().getBodyAsString());
+ assertEquals("true", a3d.get("/a04").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /a04");
- assertEquals("false", a3.get("/a05").execute().getBodyAsString());
+ assertEquals("false", a3.get("/a05").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", a3d.get("/a05").execute().getBodyAsString());
+ assertEquals("false", a3d.get("/a05").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", a3.get("/a06").execute().getBodyAsString());
+ assertEquals("true", a3.get("/a06").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", a3d.get("/a06").execute().getBodyAsString());
+ assertEquals("true", a3d.get("/a06").run().getBodyAsString());
assertLogged(true);
- assertEquals("false", a3.get("/a07").execute().getBodyAsString());
+ assertEquals("false", a3.get("/a07").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", a3d.get("/a07").execute().getBodyAsString());
+ assertEquals("false", a3d.get("/a07").run().getBodyAsString());
assertLogged(false);
}
@@ -431,39 +431,39 @@ public class DebugModeTest {
@Test
public void a04_debugPerRequest() throws Exception {
- assertEquals("false", a4.get("/a01").execute().getBodyAsString());
+ assertEquals("false", a4.get("/a01").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", a4d.get("/a01").execute().getBodyAsString());
+ assertEquals("true", a4d.get("/a01").run().getBodyAsString());
assertLogged(true);
- assertEquals("false", a4.get("/a02").execute().getBodyAsString());
+ assertEquals("false", a4.get("/a02").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", a4d.get("/a02").execute().getBodyAsString());
+ assertEquals("false", a4d.get("/a02").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", a4.get("/a03").execute().getBodyAsString());
+ assertEquals("true", a4.get("/a03").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /a03");
- assertEquals("true", a4d.get("/a03").execute().getBodyAsString());
+ assertEquals("true", a4d.get("/a03").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /a03");
- assertEquals("false", a4.get("/a04").execute().getBodyAsString());
+ assertEquals("false", a4.get("/a04").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", a4d.get("/a04").execute().getBodyAsString());
+ assertEquals("true", a4d.get("/a04").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /a04");
- assertEquals("false", a4.get("/a05").execute().getBodyAsString());
+ assertEquals("false", a4.get("/a05").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", a4d.get("/a05").execute().getBodyAsString());
+ assertEquals("true", a4d.get("/a05").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", a4.get("/a06").execute().getBodyAsString());
+ assertEquals("true", a4.get("/a06").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", a4d.get("/a06").execute().getBodyAsString());
+ assertEquals("true", a4d.get("/a06").run().getBodyAsString());
assertLogged(true);
- assertEquals("false", a4.get("/a07").execute().getBodyAsString());
+ assertEquals("false", a4.get("/a07").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", a4d.get("/a07").execute().getBodyAsString());
+ assertEquals("false", a4d.get("/a07").run().getBodyAsString());
assertLogged(false);
}
@@ -491,9 +491,9 @@ public class DebugModeTest {
@Test
public void b01_debugDefault() throws Exception {
- assertEquals("false", b1.get("/b01").execute().getBodyAsString());
+ assertEquals("false", b1.get("/b01").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", b1.get("/b02").execute().getBodyAsString());
+ assertEquals("true", b1.get("/b02").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /b02");
}
@@ -517,9 +517,9 @@ public class DebugModeTest {
@Test
public void b02_debugDefault() throws Exception {
- assertEquals("false", b2.get("/b01").execute().getBodyAsString());
+ assertEquals("false", b2.get("/b01").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", b2.get("/b02").execute().getBodyAsString());
+ assertEquals("true", b2.get("/b02").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /b02");
}
@@ -706,155 +706,155 @@ public class DebugModeTest {
@Test
public void c01_debugDefault() throws Exception {
- assertEquals("false", c1.get("/c01a").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c01a").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1d.get("/c01a").execute().getBodyAsString());
+ assertEquals("false", c1d.get("/c01a").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1.get("/c01b").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c01b").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1d.get("/c01b").execute().getBodyAsString());
+ assertEquals("false", c1d.get("/c01b").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", c1.get("/c01c").execute().getBodyAsString());
+ assertEquals("true", c1.get("/c01c").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c1d.get("/c01c").execute().getBodyAsString());
+ assertEquals("true", c1d.get("/c01c").run().getBodyAsString());
assertLogged(true);
- assertEquals("false", c1.get("/c01d").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c01d").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", c1d.get("/c01d").execute().getBodyAsString());
+ assertEquals("true", c1d.get("/c01d").run().getBodyAsString());
assertLogged(true);
- assertEquals("false", c1.get("/c02a").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c02a").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1d.get("/c02a").execute().getBodyAsString());
+ assertEquals("false", c1d.get("/c02a").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1.get("/c02b").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c02b").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1d.get("/c02b").execute().getBodyAsString());
+ assertEquals("false", c1d.get("/c02b").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1.get("/c02c").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c02c").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1d.get("/c02c").execute().getBodyAsString());
+ assertEquals("false", c1d.get("/c02c").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1.get("/c02d").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c02d").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1d.get("/c02d").execute().getBodyAsString());
+ assertEquals("false", c1d.get("/c02d").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1.get("/c02e").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c02e").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1d.get("/c02e").execute().getBodyAsString());
+ assertEquals("false", c1d.get("/c02e").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1.get("/c02f").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c02f").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1d.get("/c02f").execute().getBodyAsString());
+ assertEquals("false", c1d.get("/c02f").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", c1.get("/c03a").execute().getBodyAsString());
+ assertEquals("true", c1.get("/c03a").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03a");
- assertEquals("true", c1d.get("/c03a").execute().getBodyAsString());
+ assertEquals("true", c1d.get("/c03a").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03a");
- assertEquals("true", c1.get("/c03b").execute().getBodyAsString());
+ assertEquals("true", c1.get("/c03b").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03b");
- assertEquals("true", c1d.get("/c03b").execute().getBodyAsString());
+ assertEquals("true", c1d.get("/c03b").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03b");
- assertEquals("true", c1.get("/c03c").execute().getBodyAsString());
+ assertEquals("true", c1.get("/c03c").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03c");
- assertEquals("true", c1d.get("/c03c").execute().getBodyAsString());
+ assertEquals("true", c1d.get("/c03c").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03c");
- assertEquals("true", c1.get("/c03d").execute().getBodyAsString());
+ assertEquals("true", c1.get("/c03d").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03d");
- assertEquals("true", c1d.get("/c03d").execute().getBodyAsString());
+ assertEquals("true", c1d.get("/c03d").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03d");
- assertEquals("true", c1.get("/c03e").execute().getBodyAsString());
+ assertEquals("true", c1.get("/c03e").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03e");
- assertEquals("true", c1d.get("/c03e").execute().getBodyAsString());
+ assertEquals("true", c1d.get("/c03e").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03e");
- assertEquals("true", c1.get("/c03f").execute().getBodyAsString());
+ assertEquals("true", c1.get("/c03f").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03f");
- assertEquals("true", c1d.get("/c03f").execute().getBodyAsString());
+ assertEquals("true", c1d.get("/c03f").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03f");
- assertEquals("false", c1.get("/c04a").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c04a").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", c1d.get("/c04a").execute().getBodyAsString());
+ assertEquals("true", c1d.get("/c04a").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c04a");
- assertEquals("false", c1.get("/c04b").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c04b").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", c1d.get("/c04b").execute().getBodyAsString());
+ assertEquals("true", c1d.get("/c04b").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c04b");
- assertEquals("false", c1.get("/c04c").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c04c").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", c1d.get("/c04c").execute().getBodyAsString());
+ assertEquals("true", c1d.get("/c04c").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c04c");
- assertEquals("false", c1.get("/c04d").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c04d").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", c1d.get("/c04d").execute().getBodyAsString());
+ assertEquals("true", c1d.get("/c04d").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c04d");
- assertEquals("false", c1.get("/c04e").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c04e").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", c1d.get("/c04e").execute().getBodyAsString());
+ assertEquals("true", c1d.get("/c04e").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c04e");
- assertEquals("false", c1.get("/c04f").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c04f").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", c1d.get("/c04f").execute().getBodyAsString());
+ assertEquals("true", c1d.get("/c04f").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c04f");
- assertEquals("false", c1.get("/c05a").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c05a").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1d.get("/c05a").execute().getBodyAsString());
+ assertEquals("false", c1d.get("/c05a").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1.get("/c05b").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c05b").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1d.get("/c05b").execute().getBodyAsString());
+ assertEquals("false", c1d.get("/c05b").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1.get("/c05c").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c05c").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1d.get("/c05c").execute().getBodyAsString());
+ assertEquals("false", c1d.get("/c05c").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1.get("/c05d").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c05d").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1d.get("/c05d").execute().getBodyAsString());
+ assertEquals("false", c1d.get("/c05d").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1.get("/c05e").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c05e").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1d.get("/c05e").execute().getBodyAsString());
+ assertEquals("false", c1d.get("/c05e").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1.get("/c05f").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c05f").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1d.get("/c05f").execute().getBodyAsString());
+ assertEquals("false", c1d.get("/c05f").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", c1.get("/c06a").execute().getBodyAsString());
+ assertEquals("true", c1.get("/c06a").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c1d.get("/c06a").execute().getBodyAsString());
+ assertEquals("true", c1d.get("/c06a").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c1.get("/c06b").execute().getBodyAsString());
+ assertEquals("true", c1.get("/c06b").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c1d.get("/c06b").execute().getBodyAsString());
+ assertEquals("true", c1d.get("/c06b").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c1.get("/c06c").execute().getBodyAsString());
+ assertEquals("true", c1.get("/c06c").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c1d.get("/c06c").execute().getBodyAsString());
+ assertEquals("true", c1d.get("/c06c").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c1.get("/c06d").execute().getBodyAsString());
+ assertEquals("true", c1.get("/c06d").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c1d.get("/c06d").execute().getBodyAsString());
+ assertEquals("true", c1d.get("/c06d").run().getBodyAsString());
assertLogged(true);
- assertEquals("false", c1.get("/c07a").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c07a").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1d.get("/c07a").execute().getBodyAsString());
+ assertEquals("false", c1d.get("/c07a").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1.get("/c07b").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c07b").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1d.get("/c07b").execute().getBodyAsString());
+ assertEquals("false", c1d.get("/c07b").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1.get("/c07c").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c07c").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1d.get("/c07c").execute().getBodyAsString());
+ assertEquals("false", c1d.get("/c07c").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1.get("/c07d").execute().getBodyAsString());
+ assertEquals("false", c1.get("/c07d").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c1d.get("/c07d").execute().getBodyAsString());
+ assertEquals("false", c1d.get("/c07d").run().getBodyAsString());
assertLogged(false);
}
@@ -1040,155 +1040,155 @@ public class DebugModeTest {
@Test
public void c02_debugTrue() throws Exception {
- assertEquals("true", c2.get("/c01a").execute().getBodyAsString());
+ assertEquals("true", c2.get("/c01a").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2d.get("/c01a").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c01a").run().getBodyAsString());
assertLogged(true);
- assertEquals("false", c2.get("/c01b").execute().getBodyAsString());
+ assertEquals("false", c2.get("/c01b").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c2d.get("/c01b").execute().getBodyAsString());
+ assertEquals("false", c2d.get("/c01b").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", c2.get("/c01c").execute().getBodyAsString());
+ assertEquals("true", c2.get("/c01c").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2d.get("/c01c").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c01c").run().getBodyAsString());
assertLogged(true);
- assertEquals("false", c2.get("/c01d").execute().getBodyAsString());
+ assertEquals("false", c2.get("/c01d").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", c2d.get("/c01d").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c01d").run().getBodyAsString());
assertLogged(true);
- assertEquals("false", c2.get("/c02a").execute().getBodyAsString());
+ assertEquals("false", c2.get("/c02a").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c2d.get("/c02a").execute().getBodyAsString());
+ assertEquals("false", c2d.get("/c02a").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c2.get("/c02b").execute().getBodyAsString());
+ assertEquals("false", c2.get("/c02b").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c2d.get("/c02b").execute().getBodyAsString());
+ assertEquals("false", c2d.get("/c02b").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c2.get("/c02c").execute().getBodyAsString());
+ assertEquals("false", c2.get("/c02c").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c2d.get("/c02c").execute().getBodyAsString());
+ assertEquals("false", c2d.get("/c02c").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c2.get("/c02d").execute().getBodyAsString());
+ assertEquals("false", c2.get("/c02d").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c2d.get("/c02d").execute().getBodyAsString());
+ assertEquals("false", c2d.get("/c02d").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c2.get("/c02e").execute().getBodyAsString());
+ assertEquals("false", c2.get("/c02e").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c2d.get("/c02e").execute().getBodyAsString());
+ assertEquals("false", c2d.get("/c02e").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c2.get("/c02f").execute().getBodyAsString());
+ assertEquals("false", c2.get("/c02f").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c2d.get("/c02f").execute().getBodyAsString());
+ assertEquals("false", c2d.get("/c02f").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", c2.get("/c03a").execute().getBodyAsString());
+ assertEquals("true", c2.get("/c03a").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03a");
- assertEquals("true", c2d.get("/c03a").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c03a").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03a");
- assertEquals("true", c2.get("/c03b").execute().getBodyAsString());
+ assertEquals("true", c2.get("/c03b").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03b");
- assertEquals("true", c2d.get("/c03b").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c03b").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03b");
- assertEquals("true", c2.get("/c03c").execute().getBodyAsString());
+ assertEquals("true", c2.get("/c03c").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03c");
- assertEquals("true", c2d.get("/c03c").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c03c").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03c");
- assertEquals("true", c2.get("/c03d").execute().getBodyAsString());
+ assertEquals("true", c2.get("/c03d").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03d");
- assertEquals("true", c2d.get("/c03d").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c03d").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03d");
- assertEquals("true", c2.get("/c03e").execute().getBodyAsString());
+ assertEquals("true", c2.get("/c03e").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03e");
- assertEquals("true", c2d.get("/c03e").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c03e").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03e");
- assertEquals("true", c2.get("/c03f").execute().getBodyAsString());
+ assertEquals("true", c2.get("/c03f").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03f");
- assertEquals("true", c2d.get("/c03f").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c03f").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c03f");
- assertEquals("false", c2.get("/c04a").execute().getBodyAsString());
+ assertEquals("false", c2.get("/c04a").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", c2d.get("/c04a").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c04a").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c04a");
- assertEquals("false", c2.get("/c04b").execute().getBodyAsString());
+ assertEquals("false", c2.get("/c04b").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", c2d.get("/c04b").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c04b").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c04b");
- assertEquals("false", c2.get("/c04c").execute().getBodyAsString());
+ assertEquals("false", c2.get("/c04c").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", c2d.get("/c04c").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c04c").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c04c");
- assertEquals("false", c2.get("/c04d").execute().getBodyAsString());
+ assertEquals("false", c2.get("/c04d").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", c2d.get("/c04d").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c04d").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c04d");
- assertEquals("false", c2.get("/c04e").execute().getBodyAsString());
+ assertEquals("false", c2.get("/c04e").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", c2d.get("/c04e").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c04e").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c04e");
- assertEquals("false", c2.get("/c04f").execute().getBodyAsString());
+ assertEquals("false", c2.get("/c04f").run().getBodyAsString());
assertLogged(false);
- assertEquals("true", c2d.get("/c04f").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c04f").run().getBodyAsString());
assertLoggedContains("[200] HTTP GET /c04f");
- assertEquals("true", c2.get("/c05a").execute().getBodyAsString());
+ assertEquals("true", c2.get("/c05a").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2d.get("/c05a").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c05a").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2.get("/c05b").execute().getBodyAsString());
+ assertEquals("true", c2.get("/c05b").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2d.get("/c05b").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c05b").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2.get("/c05c").execute().getBodyAsString());
+ assertEquals("true", c2.get("/c05c").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2d.get("/c05c").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c05c").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2.get("/c05d").execute().getBodyAsString());
+ assertEquals("true", c2.get("/c05d").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2d.get("/c05d").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c05d").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2.get("/c05e").execute().getBodyAsString());
+ assertEquals("true", c2.get("/c05e").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2d.get("/c05e").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c05e").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2.get("/c05f").execute().getBodyAsString());
+ assertEquals("true", c2.get("/c05f").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2d.get("/c05f").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c05f").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2.get("/c06a").execute().getBodyAsString());
+ assertEquals("true", c2.get("/c06a").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2d.get("/c06a").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c06a").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2.get("/c06b").execute().getBodyAsString());
+ assertEquals("true", c2.get("/c06b").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2d.get("/c06b").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c06b").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2.get("/c06c").execute().getBodyAsString());
+ assertEquals("true", c2.get("/c06c").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2d.get("/c06c").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c06c").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2.get("/c06d").execute().getBodyAsString());
+ assertEquals("true", c2.get("/c06d").run().getBodyAsString());
assertLogged(true);
- assertEquals("true", c2d.get("/c06d").execute().getBodyAsString());
+ assertEquals("true", c2d.get("/c06d").run().getBodyAsString());
assertLogged(true);
- assertEquals("false", c2.get("/c07a").execute().getBodyAsString());
+ assertEquals("false", c2.get("/c07a").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c2d.get("/c07a").execute().getBodyAsString());
+ assertEquals("false", c2d.get("/c07a").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c2.get("/c07b").execute().getBodyAsString());
+ assertEquals("false", c2.get("/c07b").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c2d.get("/c07b").execute().getBodyAsString());
+ assertEquals("false", c2d.get("/c07b").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c2.get("/c07c").execute().getBodyAsString());
+ assertEquals("false", c2.get("/c07c").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c2d.get("/c07c").execute().getBodyAsString());
+ assertEquals("false", c2d.get("/c07c").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c2.get("/c07d").execute().getBodyAsString());
+ assertEquals("false", c2.get("/c07d").run().getBodyAsString());
assertLogged(false);
- assertEquals("false", c2d.get("/c07d").execute().getBodyAsString());
+ assertEquals("false", c2d.get("/c07d").run().getBodyAsString());
assertLogged(false);
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/NlsTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/NlsTest.java
index a4dc93c..fc7b05d 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/NlsTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/NlsTest.java
@@ -66,12 +66,12 @@ public class NlsTest {
@Test
public void a01_fromClass() throws Exception {
- a.get("/a01").execute().assertBody("value1");
+ a.get("/a01").run().assertBody().is("value1");
}
@Test
public void a02_fromMethod() throws Exception {
- a.get("/a02").execute().assertBody("value2");
+ a.get("/a02").run().assertBody().is("value2");
}
//=================================================================================================================
@@ -90,7 +90,7 @@ public class NlsTest {
@Test
public void b01_optionsPageWithoutNls() throws Exception {
- b.options("/").execute().assertBodyContains("foo");
+ b.options("/").run().assertBody().contains("foo");
}
//=================================================================================================================
@@ -109,6 +109,6 @@ public class NlsTest {
@Test
public void c01_missingResourceBundle() throws Exception {
- c.get("/test").execute().assertBody("{!!bad}");
+ c.get("/test").run().assertBody().is("{!!bad}");
}
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/PathsTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/PathsTest.java
index 4a81686..2f1bf7d 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/PathsTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/PathsTest.java
@@ -56,137 +56,137 @@ public class PathsTest {
@Test
public void a01() throws Exception {
- a.get("http://localhost/cp/sp").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:null")
- .assertBodyContains("pathRemainder:null")
- .assertBodyContains("pathRemainderUndecoded:null")
- .assertBodyContains("pathRemainder2:null")
- .assertBodyContains("requestURI:'/cp/sp'")
- .assertBodyContains("requestParentURI:'/cp'")
- .assertBodyContains("requestURL:'http://localhost/cp/sp'")
- .assertBodyContains("servletPath:'/sp'")
- .assertBodyContains("servletURI:'/cp/sp'")
- .assertBodyContains("method:1")
+ a.get("http://localhost/cp/sp").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:null")
+ .assertBody().contains("pathRemainder:null")
+ .assertBody().contains("pathRemainderUndecoded:null")
+ .assertBody().contains("pathRemainder2:null")
+ .assertBody().contains("requestURI:'/cp/sp'")
+ .assertBody().contains("requestParentURI:'/cp'")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp'")
+ .assertBody().contains("servletPath:'/sp'")
+ .assertBody().contains("servletURI:'/cp/sp'")
+ .assertBody().contains("method:1")
;
}
@Test
public void a02() throws Exception {
- a.get("http://localhost/cp/sp/").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/'")
- .assertBodyContains("pathRemainder:''")
- .assertBodyContains("pathRemainderUndecoded:''")
- .assertBodyContains("pathRemainder2:''")
- .assertBodyContains("requestURI:'/cp/sp/'")
- .assertBodyContains("requestParentURI:'/cp'")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/'")
- .assertBodyContains("servletPath:'/sp'")
- .assertBodyContains("servletURI:'/cp/sp'")
- .assertBodyContains("method:1")
+ a.get("http://localhost/cp/sp/").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/'")
+ .assertBody().contains("pathRemainder:''")
+ .assertBody().contains("pathRemainderUndecoded:''")
+ .assertBody().contains("pathRemainder2:''")
+ .assertBody().contains("requestURI:'/cp/sp/'")
+ .assertBody().contains("requestParentURI:'/cp'")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/'")
+ .assertBody().contains("servletPath:'/sp'")
+ .assertBody().contains("servletURI:'/cp/sp'")
+ .assertBody().contains("method:1")
;
}
@Test
public void a03() throws Exception {
- a.get("http://localhost/cp/sp//").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'//'")
- .assertBodyContains("pathRemainder:'/'")
- .assertBodyContains("pathRemainderUndecoded:'/'")
- .assertBodyContains("pathRemainder2:'/'")
- .assertBodyContains("requestURI:'/cp/sp//'")
- .assertBodyContains("requestParentURI:'/cp'")
- .assertBodyContains("requestURL:'http://localhost/cp/sp//'")
- .assertBodyContains("servletPath:'/sp'")
- .assertBodyContains("servletURI:'/cp/sp'")
- .assertBodyContains("method:1")
+ a.get("http://localhost/cp/sp//").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'//'")
+ .assertBody().contains("pathRemainder:'/'")
+ .assertBody().contains("pathRemainderUndecoded:'/'")
+ .assertBody().contains("pathRemainder2:'/'")
+ .assertBody().contains("requestURI:'/cp/sp//'")
+ .assertBody().contains("requestParentURI:'/cp'")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp//'")
+ .assertBody().contains("servletPath:'/sp'")
+ .assertBody().contains("servletURI:'/cp/sp'")
+ .assertBody().contains("method:1")
;
}
@Test
public void a04() throws Exception {
- a.get("http://localhost/cp/sp///").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'///'")
- .assertBodyContains("pathRemainder:'//'")
- .assertBodyContains("pathRemainderUndecoded:'//'")
- .assertBodyContains("pathRemainder2:'//'")
- .assertBodyContains("requestURI:'/cp/sp///'")
- .assertBodyContains("requestParentURI:'/cp'")
- .assertBodyContains("requestURL:'http://localhost/cp/sp///'")
- .assertBodyContains("servletPath:'/sp'")
- .assertBodyContains("servletURI:'/cp/sp'")
- .assertBodyContains("method:1")
+ a.get("http://localhost/cp/sp///").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'///'")
+ .assertBody().contains("pathRemainder:'//'")
+ .assertBody().contains("pathRemainderUndecoded:'//'")
+ .assertBody().contains("pathRemainder2:'//'")
+ .assertBody().contains("requestURI:'/cp/sp///'")
+ .assertBody().contains("requestParentURI:'/cp'")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp///'")
+ .assertBody().contains("servletPath:'/sp'")
+ .assertBody().contains("servletURI:'/cp/sp'")
+ .assertBody().contains("method:1")
;
}
@Test
public void a05() throws Exception {
- a.get("http://localhost/cp/sp/foo/bar").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/foo/bar'")
- .assertBodyContains("pathRemainder:'foo/bar'")
- .assertBodyContains("pathRemainderUndecoded:'foo/bar'")
- .assertBodyContains("pathRemainder2:'foo/bar'")
- .assertBodyContains("requestURI:'/cp/sp/foo/bar'")
- .assertBodyContains("requestParentURI:'/cp/sp/foo'")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/foo/bar'")
- .assertBodyContains("servletPath:'/sp'")
- .assertBodyContains("servletURI:'/cp/sp'")
- .assertBodyContains("method:1")
+ a.get("http://localhost/cp/sp/foo/bar").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/foo/bar'")
+ .assertBody().contains("pathRemainder:'foo/bar'")
+ .assertBody().contains("pathRemainderUndecoded:'foo/bar'")
+ .assertBody().contains("pathRemainder2:'foo/bar'")
+ .assertBody().contains("requestURI:'/cp/sp/foo/bar'")
+ .assertBody().contains("requestParentURI:'/cp/sp/foo'")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/foo/bar'")
+ .assertBody().contains("servletPath:'/sp'")
+ .assertBody().contains("servletURI:'/cp/sp'")
+ .assertBody().contains("method:1")
;
}
@Test
public void a06() throws Exception {
- a.get("http://localhost/cp/sp/foo/bar/").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/foo/bar/'")
- .assertBodyContains("pathRemainder:'foo/bar/'")
- .assertBodyContains("pathRemainderUndecoded:'foo/bar/'")
- .assertBodyContains("pathRemainder2:'foo/bar/'")
- .assertBodyContains("requestURI:'/cp/sp/foo/bar/'")
- .assertBodyContains("requestParentURI:'/cp/sp/foo'")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/foo/bar/'")
- .assertBodyContains("servletPath:'/sp'")
- .assertBodyContains("servletURI:'/cp/sp'")
- .assertBodyContains("method:1")
+ a.get("http://localhost/cp/sp/foo/bar/").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/foo/bar/'")
+ .assertBody().contains("pathRemainder:'foo/bar/'")
+ .assertBody().contains("pathRemainderUndecoded:'foo/bar/'")
+ .assertBody().contains("pathRemainder2:'foo/bar/'")
+ .assertBody().contains("requestURI:'/cp/sp/foo/bar/'")
+ .assertBody().contains("requestParentURI:'/cp/sp/foo'")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/foo/bar/'")
+ .assertBody().contains("servletPath:'/sp'")
+ .assertBody().contains("servletURI:'/cp/sp'")
+ .assertBody().contains("method:1")
;
}
@Test
public void a07() throws Exception {
- a.get("http://localhost/cp/sp//foo//bar//").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'//foo//bar//'")
- .assertBodyContains("pathRemainder:'/foo//bar//'")
- .assertBodyContains("pathRemainderUndecoded:'/foo//bar//'")
- .assertBodyContains("pathRemainder2:'/foo//bar//'")
- .assertBodyContains("requestURI:'/cp/sp//foo//bar//'")
- .assertBodyContains("requestParentURI:'/cp/sp/foo/'")
- .assertBodyContains("requestURL:'http://localhost/cp/sp//foo//bar//'")
- .assertBodyContains("servletPath:'/sp'")
- .assertBodyContains("servletURI:'/cp/sp'")
- .assertBodyContains("method:1")
+ a.get("http://localhost/cp/sp//foo//bar//").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'//foo//bar//'")
+ .assertBody().contains("pathRemainder:'/foo//bar//'")
+ .assertBody().contains("pathRemainderUndecoded:'/foo//bar//'")
+ .assertBody().contains("pathRemainder2:'/foo//bar//'")
+ .assertBody().contains("requestURI:'/cp/sp//foo//bar//'")
+ .assertBody().contains("requestParentURI:'/cp/sp/foo/'")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp//foo//bar//'")
+ .assertBody().contains("servletPath:'/sp'")
+ .assertBody().contains("servletURI:'/cp/sp'")
+ .assertBody().contains("method:1")
;
}
@Test
public void a08() throws Exception {
- a.get("http://localhost/cp/sp/%20").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/ '")
- .assertBodyContains("pathRemainder:' '")
- .assertBodyContains("pathRemainderUndecoded:'%20'")
- .assertBodyContains("pathRemainder2:' '")
- .assertBodyContains("requestURI:'/cp/sp/%20'")
- .assertBodyContains("requestParentURI:'/cp/sp")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/%20'")
- .assertBodyContains("servletPath:'/sp'")
- .assertBodyContains("servletURI:'/cp/sp'")
- .assertBodyContains("method:1")
+ a.get("http://localhost/cp/sp/%20").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/ '")
+ .assertBody().contains("pathRemainder:' '")
+ .assertBody().contains("pathRemainderUndecoded:'%20'")
+ .assertBody().contains("pathRemainder2:' '")
+ .assertBody().contains("requestURI:'/cp/sp/%20'")
+ .assertBody().contains("requestParentURI:'/cp/sp")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/%20'")
+ .assertBody().contains("servletPath:'/sp'")
+ .assertBody().contains("servletURI:'/cp/sp'")
+ .assertBody().contains("method:1")
;
}
@Test
public void a09() throws Exception {
- a.get("http://localhost/cp/sp/+").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/ '")
- .assertBodyContains("pathRemainder:' '")
- .assertBodyContains("pathRemainderUndecoded:'+'")
- .assertBodyContains("pathRemainder2:' '")
- .assertBodyContains("requestURI:'/cp/sp/+'")
- .assertBodyContains("requestParentURI:'/cp/sp")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/+'")
- .assertBodyContains("servletPath:'/sp'")
- .assertBodyContains("servletURI:'/cp/sp'")
- .assertBodyContains("method:1")
+ a.get("http://localhost/cp/sp/+").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/ '")
+ .assertBody().contains("pathRemainder:' '")
+ .assertBody().contains("pathRemainderUndecoded:'+'")
+ .assertBody().contains("pathRemainder2:' '")
+ .assertBody().contains("requestURI:'/cp/sp/+'")
+ .assertBody().contains("requestParentURI:'/cp/sp")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/+'")
+ .assertBody().contains("servletPath:'/sp'")
+ .assertBody().contains("servletURI:'/cp/sp'")
+ .assertBody().contains("method:1")
;
}
@@ -204,137 +204,137 @@ public class PathsTest {
@Test
public void b01() throws Exception {
- b.get("http://localhost/cp/sp/subpath").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/subpath'")
- .assertBodyContains("pathRemainder:null")
- .assertBodyContains("pathRemainderUndecoded:null")
- .assertBodyContains("pathRemainder2:null")
- .assertBodyContains("requestURI:'/cp/sp/subpath'")
- .assertBodyContains("requestParentURI:'/cp/sp'")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/subpath'")
- .assertBodyContains("servletPath:'/sp'")
- .assertBodyContains("servletURI:'/cp/sp'")
- .assertBodyContains("method:2")
+ b.get("http://localhost/cp/sp/subpath").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/subpath'")
+ .assertBody().contains("pathRemainder:null")
+ .assertBody().contains("pathRemainderUndecoded:null")
+ .assertBody().contains("pathRemainder2:null")
+ .assertBody().contains("requestURI:'/cp/sp/subpath'")
+ .assertBody().contains("requestParentURI:'/cp/sp'")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/subpath'")
+ .assertBody().contains("servletPath:'/sp'")
+ .assertBody().contains("servletURI:'/cp/sp'")
+ .assertBody().contains("method:2")
;
}
@Test
public void b02() throws Exception {
- b.get("http://localhost/cp/sp/subpath/").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/subpath/'")
- .assertBodyContains("pathRemainder:''")
- .assertBodyContains("pathRemainderUndecoded:''")
- .assertBodyContains("pathRemainder2:''")
- .assertBodyContains("requestURI:'/cp/sp/subpath/'")
- .assertBodyContains("requestParentURI:'/cp/sp'")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/subpath/'")
- .assertBodyContains("servletPath:'/sp'")
- .assertBodyContains("servletURI:'/cp/sp'")
- .assertBodyContains("method:2")
+ b.get("http://localhost/cp/sp/subpath/").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/subpath/'")
+ .assertBody().contains("pathRemainder:''")
+ .assertBody().contains("pathRemainderUndecoded:''")
+ .assertBody().contains("pathRemainder2:''")
+ .assertBody().contains("requestURI:'/cp/sp/subpath/'")
+ .assertBody().contains("requestParentURI:'/cp/sp'")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/subpath/'")
+ .assertBody().contains("servletPath:'/sp'")
+ .assertBody().contains("servletURI:'/cp/sp'")
+ .assertBody().contains("method:2")
;
}
@Test
public void b03() throws Exception {
- b.get("http://localhost/cp/sp/subpath//").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/subpath//'")
- .assertBodyContains("pathRemainder:'/'")
- .assertBodyContains("pathRemainderUndecoded:'/'")
- .assertBodyContains("pathRemainder2:'/'")
- .assertBodyContains("requestURI:'/cp/sp/subpath//'")
- .assertBodyContains("requestParentURI:'/cp/sp'")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/subpath//'")
- .assertBodyContains("servletPath:'/sp'")
- .assertBodyContains("servletURI:'/cp/sp'")
- .assertBodyContains("method:2")
+ b.get("http://localhost/cp/sp/subpath//").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/subpath//'")
+ .assertBody().contains("pathRemainder:'/'")
+ .assertBody().contains("pathRemainderUndecoded:'/'")
+ .assertBody().contains("pathRemainder2:'/'")
+ .assertBody().contains("requestURI:'/cp/sp/subpath//'")
+ .assertBody().contains("requestParentURI:'/cp/sp'")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/subpath//'")
+ .assertBody().contains("servletPath:'/sp'")
+ .assertBody().contains("servletURI:'/cp/sp'")
+ .assertBody().contains("method:2")
;
}
@Test
public void b04() throws Exception {
- b.get("http://localhost/cp/sp/subpath///").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/subpath///'")
- .assertBodyContains("pathRemainder:'//'")
- .assertBodyContains("pathRemainderUndecoded:'//'")
- .assertBodyContains("pathRemainder2:'//'")
- .assertBodyContains("requestURI:'/cp/sp/subpath///'")
- .assertBodyContains("requestParentURI:'/cp/sp'")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/subpath///'")
- .assertBodyContains("servletPath:'/sp'")
- .assertBodyContains("servletURI:'/cp/sp'")
- .assertBodyContains("method:2")
+ b.get("http://localhost/cp/sp/subpath///").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/subpath///'")
+ .assertBody().contains("pathRemainder:'//'")
+ .assertBody().contains("pathRemainderUndecoded:'//'")
+ .assertBody().contains("pathRemainder2:'//'")
+ .assertBody().contains("requestURI:'/cp/sp/subpath///'")
+ .assertBody().contains("requestParentURI:'/cp/sp'")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/subpath///'")
+ .assertBody().contains("servletPath:'/sp'")
+ .assertBody().contains("servletURI:'/cp/sp'")
+ .assertBody().contains("method:2")
;
}
@Test
public void b05() throws Exception {
- b.get("http://localhost/cp/sp/subpath/foo/bar").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/subpath/foo/bar'")
- .assertBodyContains("pathRemainder:'foo/bar'")
- .assertBodyContains("pathRemainderUndecoded:'foo/bar'")
- .assertBodyContains("pathRemainder2:'foo/bar'")
- .assertBodyContains("requestURI:'/cp/sp/subpath/foo/bar'")
- .assertBodyContains("requestParentURI:'/cp/sp/subpath/foo'")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/subpath/foo/bar'")
- .assertBodyContains("servletPath:'/sp'")
- .assertBodyContains("servletURI:'/cp/sp'")
- .assertBodyContains("method:2")
+ b.get("http://localhost/cp/sp/subpath/foo/bar").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/subpath/foo/bar'")
+ .assertBody().contains("pathRemainder:'foo/bar'")
+ .assertBody().contains("pathRemainderUndecoded:'foo/bar'")
+ .assertBody().contains("pathRemainder2:'foo/bar'")
+ .assertBody().contains("requestURI:'/cp/sp/subpath/foo/bar'")
+ .assertBody().contains("requestParentURI:'/cp/sp/subpath/foo'")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/subpath/foo/bar'")
+ .assertBody().contains("servletPath:'/sp'")
+ .assertBody().contains("servletURI:'/cp/sp'")
+ .assertBody().contains("method:2")
;
}
@Test
public void b06() throws Exception {
- b.get("http://localhost/cp/sp/subpath/foo/bar/").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/subpath/foo/bar/'")
- .assertBodyContains("pathRemainder:'foo/bar/'")
- .assertBodyContains("pathRemainderUndecoded:'foo/bar/'")
- .assertBodyContains("pathRemainder2:'foo/bar/'")
- .assertBodyContains("requestURI:'/cp/sp/subpath/foo/bar/'")
- .assertBodyContains("requestParentURI:'/cp/sp/subpath/foo'")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/subpath/foo/bar/'")
- .assertBodyContains("servletPath:'/sp'")
- .assertBodyContains("servletURI:'/cp/sp'")
- .assertBodyContains("method:2")
+ b.get("http://localhost/cp/sp/subpath/foo/bar/").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/subpath/foo/bar/'")
+ .assertBody().contains("pathRemainder:'foo/bar/'")
+ .assertBody().contains("pathRemainderUndecoded:'foo/bar/'")
+ .assertBody().contains("pathRemainder2:'foo/bar/'")
+ .assertBody().contains("requestURI:'/cp/sp/subpath/foo/bar/'")
+ .assertBody().contains("requestParentURI:'/cp/sp/subpath/foo'")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/subpath/foo/bar/'")
+ .assertBody().contains("servletPath:'/sp'")
+ .assertBody().contains("servletURI:'/cp/sp'")
+ .assertBody().contains("method:2")
;
}
@Test
public void b07() throws Exception {
- b.get("http://localhost/cp/sp/subpath//foo//bar//").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/subpath//foo//bar//'")
- .assertBodyContains("pathRemainder:'/foo//bar//'")
- .assertBodyContains("pathRemainderUndecoded:'/foo//bar//'")
- .assertBodyContains("pathRemainder2:'/foo//bar//'")
- .assertBodyContains("requestURI:'/cp/sp/subpath//foo//bar//'")
- .assertBodyContains("requestParentURI:'/cp/sp/subpath//foo/'")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/subpath//foo//bar//'")
- .assertBodyContains("servletPath:'/sp'")
- .assertBodyContains("servletURI:'/cp/sp'")
- .assertBodyContains("method:2")
+ b.get("http://localhost/cp/sp/subpath//foo//bar//").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/subpath//foo//bar//'")
+ .assertBody().contains("pathRemainder:'/foo//bar//'")
+ .assertBody().contains("pathRemainderUndecoded:'/foo//bar//'")
+ .assertBody().contains("pathRemainder2:'/foo//bar//'")
+ .assertBody().contains("requestURI:'/cp/sp/subpath//foo//bar//'")
+ .assertBody().contains("requestParentURI:'/cp/sp/subpath//foo/'")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/subpath//foo//bar//'")
+ .assertBody().contains("servletPath:'/sp'")
+ .assertBody().contains("servletURI:'/cp/sp'")
+ .assertBody().contains("method:2")
;
}
@Test
public void b08() throws Exception {
- b.get("http://localhost/cp/sp/subpath/%20").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/subpath/ '")
- .assertBodyContains("pathRemainder:' '")
- .assertBodyContains("pathRemainderUndecoded:'%20'")
- .assertBodyContains("pathRemainder2:' '")
- .assertBodyContains("requestURI:'/cp/sp/subpath/%20'")
- .assertBodyContains("requestParentURI:'/cp/sp/subpath")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/subpath/%20'")
- .assertBodyContains("servletPath:'/sp'")
- .assertBodyContains("servletURI:'/cp/sp'")
- .assertBodyContains("method:2")
+ b.get("http://localhost/cp/sp/subpath/%20").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/subpath/ '")
+ .assertBody().contains("pathRemainder:' '")
+ .assertBody().contains("pathRemainderUndecoded:'%20'")
+ .assertBody().contains("pathRemainder2:' '")
+ .assertBody().contains("requestURI:'/cp/sp/subpath/%20'")
+ .assertBody().contains("requestParentURI:'/cp/sp/subpath")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/subpath/%20'")
+ .assertBody().contains("servletPath:'/sp'")
+ .assertBody().contains("servletURI:'/cp/sp'")
+ .assertBody().contains("method:2")
;
}
@Test
public void b09() throws Exception {
- b.get("http://localhost/cp/sp/subpath/+").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/subpath/ '")
- .assertBodyContains("pathRemainder:' '")
- .assertBodyContains("pathRemainderUndecoded:'+'")
- .assertBodyContains("pathRemainder2:' '")
- .assertBodyContains("requestURI:'/cp/sp/subpath/+'")
- .assertBodyContains("requestParentURI:'/cp/sp/subpath")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/subpath/+'")
- .assertBodyContains("servletPath:'/sp'")
- .assertBodyContains("servletURI:'/cp/sp'")
- .assertBodyContains("method:2")
+ b.get("http://localhost/cp/sp/subpath/+").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/subpath/ '")
+ .assertBody().contains("pathRemainder:' '")
+ .assertBody().contains("pathRemainderUndecoded:'+'")
+ .assertBody().contains("pathRemainder2:' '")
+ .assertBody().contains("requestURI:'/cp/sp/subpath/+'")
+ .assertBody().contains("requestParentURI:'/cp/sp/subpath")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/subpath/+'")
+ .assertBody().contains("servletPath:'/sp'")
+ .assertBody().contains("servletURI:'/cp/sp'")
+ .assertBody().contains("method:2")
;
}
@@ -356,137 +356,137 @@ public class PathsTest {
@Test
public void c01() throws Exception {
- c.get("http://localhost/cp/sp/a").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:null")
- .assertBodyContains("pathRemainder:null")
- .assertBodyContains("pathRemainderUndecoded:null")
- .assertBodyContains("pathRemainder2:null")
- .assertBodyContains("requestURI:'/cp/sp/a'")
- .assertBodyContains("requestParentURI:'/cp/sp")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/a'")
- .assertBodyContains("servletPath:'/sp/a'")
- .assertBodyContains("servletURI:'/cp/sp/a'")
- .assertBodyContains("method:3")
+ c.get("http://localhost/cp/sp/a").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:null")
+ .assertBody().contains("pathRemainder:null")
+ .assertBody().contains("pathRemainderUndecoded:null")
+ .assertBody().contains("pathRemainder2:null")
+ .assertBody().contains("requestURI:'/cp/sp/a'")
+ .assertBody().contains("requestParentURI:'/cp/sp")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/a'")
+ .assertBody().contains("servletPath:'/sp/a'")
+ .assertBody().contains("servletURI:'/cp/sp/a'")
+ .assertBody().contains("method:3")
;
}
@Test
public void c02() throws Exception {
- c.get("http://localhost/cp/sp/a/").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/'")
- .assertBodyContains("pathRemainder:''")
- .assertBodyContains("pathRemainderUndecoded:''")
- .assertBodyContains("pathRemainder2:''")
- .assertBodyContains("requestURI:'/cp/sp/a/'")
- .assertBodyContains("requestParentURI:'/cp/sp")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/a/'")
- .assertBodyContains("servletPath:'/sp/a'")
- .assertBodyContains("servletURI:'/cp/sp/a'")
- .assertBodyContains("method:3")
+ c.get("http://localhost/cp/sp/a/").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/'")
+ .assertBody().contains("pathRemainder:''")
+ .assertBody().contains("pathRemainderUndecoded:''")
+ .assertBody().contains("pathRemainder2:''")
+ .assertBody().contains("requestURI:'/cp/sp/a/'")
+ .assertBody().contains("requestParentURI:'/cp/sp")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/a/'")
+ .assertBody().contains("servletPath:'/sp/a'")
+ .assertBody().contains("servletURI:'/cp/sp/a'")
+ .assertBody().contains("method:3")
;
}
@Test
public void c03() throws Exception {
- c.get("http://localhost/cp/sp/a//").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'//'")
- .assertBodyContains("pathRemainder:'/'")
- .assertBodyContains("pathRemainderUndecoded:'/'")
- .assertBodyContains("pathRemainder2:'/'")
- .assertBodyContains("requestURI:'/cp/sp/a//'")
- .assertBodyContains("requestParentURI:'/cp/sp")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/a//'")
- .assertBodyContains("servletPath:'/sp/a'")
- .assertBodyContains("servletURI:'/cp/sp/a'")
- .assertBodyContains("method:3")
+ c.get("http://localhost/cp/sp/a//").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'//'")
+ .assertBody().contains("pathRemainder:'/'")
+ .assertBody().contains("pathRemainderUndecoded:'/'")
+ .assertBody().contains("pathRemainder2:'/'")
+ .assertBody().contains("requestURI:'/cp/sp/a//'")
+ .assertBody().contains("requestParentURI:'/cp/sp")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/a//'")
+ .assertBody().contains("servletPath:'/sp/a'")
+ .assertBody().contains("servletURI:'/cp/sp/a'")
+ .assertBody().contains("method:3")
;
}
@Test
public void c04() throws Exception {
- c.get("http://localhost/cp/sp/a///").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'///'")
- .assertBodyContains("pathRemainder:'//'")
- .assertBodyContains("pathRemainderUndecoded:'//'")
- .assertBodyContains("pathRemainder2:'//'")
- .assertBodyContains("requestURI:'/cp/sp/a///'")
- .assertBodyContains("requestParentURI:'/cp/sp")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/a///'")
- .assertBodyContains("servletPath:'/sp/a'")
- .assertBodyContains("servletURI:'/cp/sp/a'")
- .assertBodyContains("method:3")
+ c.get("http://localhost/cp/sp/a///").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'///'")
+ .assertBody().contains("pathRemainder:'//'")
+ .assertBody().contains("pathRemainderUndecoded:'//'")
+ .assertBody().contains("pathRemainder2:'//'")
+ .assertBody().contains("requestURI:'/cp/sp/a///'")
+ .assertBody().contains("requestParentURI:'/cp/sp")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/a///'")
+ .assertBody().contains("servletPath:'/sp/a'")
+ .assertBody().contains("servletURI:'/cp/sp/a'")
+ .assertBody().contains("method:3")
;
}
@Test
public void c05() throws Exception {
- c.get("http://localhost/cp/sp/a/foo/bar").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/foo/bar'")
- .assertBodyContains("pathRemainder:'foo/bar'")
- .assertBodyContains("pathRemainderUndecoded:'foo/bar'")
- .assertBodyContains("pathRemainder2:'foo/bar'")
- .assertBodyContains("requestURI:'/cp/sp/a/foo/bar'")
- .assertBodyContains("requestParentURI:'/cp/sp/a/foo")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/a/foo/bar'")
- .assertBodyContains("servletPath:'/sp/a'")
- .assertBodyContains("servletURI:'/cp/sp/a'")
- .assertBodyContains("method:3")
+ c.get("http://localhost/cp/sp/a/foo/bar").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/foo/bar'")
+ .assertBody().contains("pathRemainder:'foo/bar'")
+ .assertBody().contains("pathRemainderUndecoded:'foo/bar'")
+ .assertBody().contains("pathRemainder2:'foo/bar'")
+ .assertBody().contains("requestURI:'/cp/sp/a/foo/bar'")
+ .assertBody().contains("requestParentURI:'/cp/sp/a/foo")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/a/foo/bar'")
+ .assertBody().contains("servletPath:'/sp/a'")
+ .assertBody().contains("servletURI:'/cp/sp/a'")
+ .assertBody().contains("method:3")
;
}
@Test
public void c06() throws Exception {
- c.get("http://localhost/cp/sp/a/foo/bar/").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/foo/bar/'")
- .assertBodyContains("pathRemainder:'foo/bar/'")
- .assertBodyContains("pathRemainderUndecoded:'foo/bar/'")
- .assertBodyContains("pathRemainder2:'foo/bar/'")
- .assertBodyContains("requestURI:'/cp/sp/a/foo/bar/'")
- .assertBodyContains("requestParentURI:'/cp/sp/a/foo")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/a/foo/bar/'")
- .assertBodyContains("servletPath:'/sp/a'")
- .assertBodyContains("servletURI:'/cp/sp/a'")
- .assertBodyContains("method:3")
+ c.get("http://localhost/cp/sp/a/foo/bar/").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/foo/bar/'")
+ .assertBody().contains("pathRemainder:'foo/bar/'")
+ .assertBody().contains("pathRemainderUndecoded:'foo/bar/'")
+ .assertBody().contains("pathRemainder2:'foo/bar/'")
+ .assertBody().contains("requestURI:'/cp/sp/a/foo/bar/'")
+ .assertBody().contains("requestParentURI:'/cp/sp/a/foo")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/a/foo/bar/'")
+ .assertBody().contains("servletPath:'/sp/a'")
+ .assertBody().contains("servletURI:'/cp/sp/a'")
+ .assertBody().contains("method:3")
;
}
@Test
public void c07() throws Exception {
- c.get("http://localhost/cp/sp/a//foo//bar//").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'//foo//bar//'")
- .assertBodyContains("pathRemainder:'/foo//bar//'")
- .assertBodyContains("pathRemainderUndecoded:'/foo//bar//'")
- .assertBodyContains("pathRemainder2:'/foo//bar//'")
- .assertBodyContains("requestURI:'/cp/sp/a//foo//bar//'")
- .assertBodyContains("requestParentURI:'/cp/sp/a/foo/")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/a//foo//bar//'")
- .assertBodyContains("servletPath:'/sp/a'")
- .assertBodyContains("servletURI:'/cp/sp/a'")
- .assertBodyContains("method:3")
+ c.get("http://localhost/cp/sp/a//foo//bar//").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'//foo//bar//'")
+ .assertBody().contains("pathRemainder:'/foo//bar//'")
+ .assertBody().contains("pathRemainderUndecoded:'/foo//bar//'")
+ .assertBody().contains("pathRemainder2:'/foo//bar//'")
+ .assertBody().contains("requestURI:'/cp/sp/a//foo//bar//'")
+ .assertBody().contains("requestParentURI:'/cp/sp/a/foo/")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/a//foo//bar//'")
+ .assertBody().contains("servletPath:'/sp/a'")
+ .assertBody().contains("servletURI:'/cp/sp/a'")
+ .assertBody().contains("method:3")
;
}
@Test
public void c08() throws Exception {
- c.get("http://localhost/cp/sp/a/%20").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/ '")
- .assertBodyContains("pathRemainder:' '")
- .assertBodyContains("pathRemainderUndecoded:'%20'")
- .assertBodyContains("pathRemainder2:' '")
- .assertBodyContains("requestURI:'/cp/sp/a/%20'")
- .assertBodyContains("requestParentURI:'/cp/sp/a")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/a/%20'")
- .assertBodyContains("servletPath:'/sp/a'")
- .assertBodyContains("servletURI:'/cp/sp/a'")
- .assertBodyContains("method:3")
+ c.get("http://localhost/cp/sp/a/%20").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/ '")
+ .assertBody().contains("pathRemainder:' '")
+ .assertBody().contains("pathRemainderUndecoded:'%20'")
+ .assertBody().contains("pathRemainder2:' '")
+ .assertBody().contains("requestURI:'/cp/sp/a/%20'")
+ .assertBody().contains("requestParentURI:'/cp/sp/a")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/a/%20'")
+ .assertBody().contains("servletPath:'/sp/a'")
+ .assertBody().contains("servletURI:'/cp/sp/a'")
+ .assertBody().contains("method:3")
;
}
@Test
public void c09() throws Exception {
- c.get("http://localhost/cp/sp/a/+").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/ '")
- .assertBodyContains("pathRemainder:' '")
- .assertBodyContains("pathRemainderUndecoded:'+'")
- .assertBodyContains("pathRemainder2:' '")
- .assertBodyContains("requestURI:'/cp/sp/a/+'")
- .assertBodyContains("requestParentURI:'/cp/sp/a")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/a/+'")
- .assertBodyContains("servletPath:'/sp/a'")
- .assertBodyContains("servletURI:'/cp/sp/a'")
- .assertBodyContains("method:3")
+ c.get("http://localhost/cp/sp/a/+").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/ '")
+ .assertBody().contains("pathRemainder:' '")
+ .assertBody().contains("pathRemainderUndecoded:'+'")
+ .assertBody().contains("pathRemainder2:' '")
+ .assertBody().contains("requestURI:'/cp/sp/a/+'")
+ .assertBody().contains("requestParentURI:'/cp/sp/a")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/a/+'")
+ .assertBody().contains("servletPath:'/sp/a'")
+ .assertBody().contains("servletURI:'/cp/sp/a'")
+ .assertBody().contains("method:3")
;
}
@@ -508,137 +508,137 @@ public class PathsTest {
@Test
public void d01() throws Exception {
- d.get("http://localhost/cp/sp/a/subpath").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/subpath'")
- .assertBodyContains("pathRemainder:null")
- .assertBodyContains("pathRemainderUndecoded:null")
- .assertBodyContains("pathRemainder2:null")
- .assertBodyContains("requestURI:'/cp/sp/a/subpath'")
- .assertBodyContains("requestParentURI:'/cp/sp/a")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/a/subpath'")
- .assertBodyContains("servletPath:'/sp/a'")
- .assertBodyContains("servletURI:'/cp/sp/a'")
- .assertBodyContains("method:4")
+ d.get("http://localhost/cp/sp/a/subpath").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/subpath'")
+ .assertBody().contains("pathRemainder:null")
+ .assertBody().contains("pathRemainderUndecoded:null")
+ .assertBody().contains("pathRemainder2:null")
+ .assertBody().contains("requestURI:'/cp/sp/a/subpath'")
+ .assertBody().contains("requestParentURI:'/cp/sp/a")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/a/subpath'")
+ .assertBody().contains("servletPath:'/sp/a'")
+ .assertBody().contains("servletURI:'/cp/sp/a'")
+ .assertBody().contains("method:4")
;
}
@Test
public void d02() throws Exception {
- d.get("http://localhost/cp/sp/a/subpath/").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/subpath/'")
- .assertBodyContains("pathRemainder:''")
- .assertBodyContains("pathRemainderUndecoded:''")
- .assertBodyContains("pathRemainder2:''")
- .assertBodyContains("requestURI:'/cp/sp/a/subpath/'")
- .assertBodyContains("requestParentURI:'/cp/sp/a")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/a/subpath/'")
- .assertBodyContains("servletPath:'/sp/a'")
- .assertBodyContains("servletURI:'/cp/sp/a'")
- .assertBodyContains("method:4")
+ d.get("http://localhost/cp/sp/a/subpath/").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/subpath/'")
+ .assertBody().contains("pathRemainder:''")
+ .assertBody().contains("pathRemainderUndecoded:''")
+ .assertBody().contains("pathRemainder2:''")
+ .assertBody().contains("requestURI:'/cp/sp/a/subpath/'")
+ .assertBody().contains("requestParentURI:'/cp/sp/a")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/a/subpath/'")
+ .assertBody().contains("servletPath:'/sp/a'")
+ .assertBody().contains("servletURI:'/cp/sp/a'")
+ .assertBody().contains("method:4")
;
}
@Test
public void d03() throws Exception {
- d.get("http://localhost/cp/sp/a/subpath//").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/subpath//'")
- .assertBodyContains("pathRemainder:'/'")
- .assertBodyContains("pathRemainderUndecoded:'/'")
- .assertBodyContains("pathRemainder2:'/'")
- .assertBodyContains("requestURI:'/cp/sp/a/subpath//'")
- .assertBodyContains("requestParentURI:'/cp/sp/a")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/a/subpath//'")
- .assertBodyContains("servletPath:'/sp/a'")
- .assertBodyContains("servletURI:'/cp/sp/a'")
- .assertBodyContains("method:4")
+ d.get("http://localhost/cp/sp/a/subpath//").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/subpath//'")
+ .assertBody().contains("pathRemainder:'/'")
+ .assertBody().contains("pathRemainderUndecoded:'/'")
+ .assertBody().contains("pathRemainder2:'/'")
+ .assertBody().contains("requestURI:'/cp/sp/a/subpath//'")
+ .assertBody().contains("requestParentURI:'/cp/sp/a")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/a/subpath//'")
+ .assertBody().contains("servletPath:'/sp/a'")
+ .assertBody().contains("servletURI:'/cp/sp/a'")
+ .assertBody().contains("method:4")
;
}
@Test
public void d04() throws Exception {
- d.get("http://localhost/cp/sp/a/subpath///").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/subpath///'")
- .assertBodyContains("pathRemainder:'//'")
- .assertBodyContains("pathRemainderUndecoded:'//'")
- .assertBodyContains("pathRemainder2:'//'")
- .assertBodyContains("requestURI:'/cp/sp/a/subpath///'")
- .assertBodyContains("requestParentURI:'/cp/sp/a")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/a/subpath///'")
- .assertBodyContains("servletPath:'/sp/a'")
- .assertBodyContains("servletURI:'/cp/sp/a'")
- .assertBodyContains("method:4")
+ d.get("http://localhost/cp/sp/a/subpath///").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/subpath///'")
+ .assertBody().contains("pathRemainder:'//'")
+ .assertBody().contains("pathRemainderUndecoded:'//'")
+ .assertBody().contains("pathRemainder2:'//'")
+ .assertBody().contains("requestURI:'/cp/sp/a/subpath///'")
+ .assertBody().contains("requestParentURI:'/cp/sp/a")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/a/subpath///'")
+ .assertBody().contains("servletPath:'/sp/a'")
+ .assertBody().contains("servletURI:'/cp/sp/a'")
+ .assertBody().contains("method:4")
;
}
@Test
public void d05() throws Exception {
- d.get("http://localhost/cp/sp/a/subpath/foo/bar").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/subpath/foo/bar'")
- .assertBodyContains("pathRemainder:'foo/bar'")
- .assertBodyContains("pathRemainderUndecoded:'foo/bar'")
- .assertBodyContains("pathRemainder2:'foo/bar'")
- .assertBodyContains("requestURI:'/cp/sp/a/subpath/foo/bar'")
- .assertBodyContains("requestParentURI:'/cp/sp/a/subpath/foo")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/a/subpath/foo/bar'")
- .assertBodyContains("servletPath:'/sp/a'")
- .assertBodyContains("servletURI:'/cp/sp/a'")
- .assertBodyContains("method:4")
+ d.get("http://localhost/cp/sp/a/subpath/foo/bar").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/subpath/foo/bar'")
+ .assertBody().contains("pathRemainder:'foo/bar'")
+ .assertBody().contains("pathRemainderUndecoded:'foo/bar'")
+ .assertBody().contains("pathRemainder2:'foo/bar'")
+ .assertBody().contains("requestURI:'/cp/sp/a/subpath/foo/bar'")
+ .assertBody().contains("requestParentURI:'/cp/sp/a/subpath/foo")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/a/subpath/foo/bar'")
+ .assertBody().contains("servletPath:'/sp/a'")
+ .assertBody().contains("servletURI:'/cp/sp/a'")
+ .assertBody().contains("method:4")
;
}
@Test
public void d06() throws Exception {
- d.get("http://localhost/cp/sp/a/subpath/foo/bar/").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/subpath/foo/bar/'")
- .assertBodyContains("pathRemainder:'foo/bar/'")
- .assertBodyContains("pathRemainderUndecoded:'foo/bar/'")
- .assertBodyContains("pathRemainder2:'foo/bar/'")
- .assertBodyContains("requestURI:'/cp/sp/a/subpath/foo/bar/'")
- .assertBodyContains("requestParentURI:'/cp/sp/a/subpath/foo")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/a/subpath/foo/bar/'")
- .assertBodyContains("servletPath:'/sp/a'")
- .assertBodyContains("servletURI:'/cp/sp/a'")
- .assertBodyContains("method:4")
+ d.get("http://localhost/cp/sp/a/subpath/foo/bar/").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/subpath/foo/bar/'")
+ .assertBody().contains("pathRemainder:'foo/bar/'")
+ .assertBody().contains("pathRemainderUndecoded:'foo/bar/'")
+ .assertBody().contains("pathRemainder2:'foo/bar/'")
+ .assertBody().contains("requestURI:'/cp/sp/a/subpath/foo/bar/'")
+ .assertBody().contains("requestParentURI:'/cp/sp/a/subpath/foo")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/a/subpath/foo/bar/'")
+ .assertBody().contains("servletPath:'/sp/a'")
+ .assertBody().contains("servletURI:'/cp/sp/a'")
+ .assertBody().contains("method:4")
;
}
@Test
public void d07() throws Exception {
- d.get("http://localhost/cp/sp/a/subpath//foo//bar//").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/subpath//foo//bar//'")
- .assertBodyContains("pathRemainder:'/foo//bar//'")
- .assertBodyContains("pathRemainderUndecoded:'/foo//bar//'")
- .assertBodyContains("pathRemainder2:'/foo//bar//'")
- .assertBodyContains("requestURI:'/cp/sp/a/subpath//foo//bar//'")
- .assertBodyContains("requestParentURI:'/cp/sp/a/subpath//foo/")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/a/subpath//foo//bar//'")
- .assertBodyContains("servletPath:'/sp/a'")
- .assertBodyContains("servletURI:'/cp/sp/a'")
- .assertBodyContains("method:4")
+ d.get("http://localhost/cp/sp/a/subpath//foo//bar//").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/subpath//foo//bar//'")
+ .assertBody().contains("pathRemainder:'/foo//bar//'")
+ .assertBody().contains("pathRemainderUndecoded:'/foo//bar//'")
+ .assertBody().contains("pathRemainder2:'/foo//bar//'")
+ .assertBody().contains("requestURI:'/cp/sp/a/subpath//foo//bar//'")
+ .assertBody().contains("requestParentURI:'/cp/sp/a/subpath//foo/")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/a/subpath//foo//bar//'")
+ .assertBody().contains("servletPath:'/sp/a'")
+ .assertBody().contains("servletURI:'/cp/sp/a'")
+ .assertBody().contains("method:4")
;
}
@Test
public void d08() throws Exception {
- d.get("http://localhost/cp/sp/a/subpath/%20").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/subpath/ '")
- .assertBodyContains("pathRemainder:' '")
- .assertBodyContains("pathRemainderUndecoded:'%20'")
- .assertBodyContains("pathRemainder2:' '")
- .assertBodyContains("requestURI:'/cp/sp/a/subpath/%20'")
- .assertBodyContains("requestParentURI:'/cp/sp/a/subpath")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/a/subpath/%20'")
- .assertBodyContains("servletPath:'/sp/a'")
- .assertBodyContains("servletURI:'/cp/sp/a'")
- .assertBodyContains("method:4")
+ d.get("http://localhost/cp/sp/a/subpath/%20").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/subpath/ '")
+ .assertBody().contains("pathRemainder:' '")
+ .assertBody().contains("pathRemainderUndecoded:'%20'")
+ .assertBody().contains("pathRemainder2:' '")
+ .assertBody().contains("requestURI:'/cp/sp/a/subpath/%20'")
+ .assertBody().contains("requestParentURI:'/cp/sp/a/subpath")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/a/subpath/%20'")
+ .assertBody().contains("servletPath:'/sp/a'")
+ .assertBody().contains("servletURI:'/cp/sp/a'")
+ .assertBody().contains("method:4")
;
}
@Test
public void d09() throws Exception {
- d.get("http://localhost/cp/sp/a/subpath/+").contextPath("/cp").servletPath("/sp").execute()
- .assertBodyContains("pathInfo:'/subpath/ '")
- .assertBodyContains("pathRemainder:' '")
- .assertBodyContains("pathRemainderUndecoded:'+'")
- .assertBodyContains("pathRemainder2:' '")
- .assertBodyContains("requestURI:'/cp/sp/a/subpath/+'")
- .assertBodyContains("requestParentURI:'/cp/sp/a/subpath")
- .assertBodyContains("requestURL:'http://localhost/cp/sp/a/subpath/+'")
- .assertBodyContains("servletPath:'/sp/a'")
- .assertBodyContains("servletURI:'/cp/sp/a'")
- .assertBodyContains("method:4")
+ d.get("http://localhost/cp/sp/a/subpath/+").contextPath("/cp").servletPath("/sp").run()
+ .assertBody().contains("pathInfo:'/subpath/ '")
+ .assertBody().contains("pathRemainder:' '")
+ .assertBody().contains("pathRemainderUndecoded:'+'")
+ .assertBody().contains("pathRemainder2:' '")
+ .assertBody().contains("requestURI:'/cp/sp/a/subpath/+'")
+ .assertBody().contains("requestParentURI:'/cp/sp/a/subpath")
+ .assertBody().contains("requestURL:'http://localhost/cp/sp/a/subpath/+'")
+ .assertBody().contains("servletPath:'/sp/a'")
+ .assertBody().contains("servletURI:'/cp/sp/a'")
+ .assertBody().contains("method:4")
;
}
}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/RestParamsTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/RestParamsTest.java
index 484075e..410105e 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/RestParamsTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/RestParamsTest.java
@@ -126,85 +126,85 @@ public class RestParamsTest {
@Test
public void a01_ResourceBundle() throws Exception {
- a.get("/a01").acceptLanguage("en-US").execute().assertBody("bar");
- a.get("/a01").acceptLanguage("ja-JP").execute().assertBody("baz");
+ a.get("/a01").acceptLanguage("en-US").run().assertBody().is("bar");
+ a.get("/a01").acceptLanguage("ja-JP").run().assertBody().is("baz");
}
@Test
public void a02_MessageBundle() throws Exception {
- a.get("/a02").acceptLanguage("en-US").execute().assertBody("bar");
- a.get("/a02").acceptLanguage("ja-JP").execute().assertBody("baz");
+ a.get("/a02").acceptLanguage("en-US").run().assertBody().is("bar");
+ a.get("/a02").acceptLanguage("ja-JP").run().assertBody().is("baz");
}
@Test
public void a03_InputStream() throws Exception {
- a.post("/a03", "foo").execute().assertBody("foo");
+ a.post("/a03", "foo").run().assertBody().is("foo");
}
@Test
public void a04_ServletInputStream() throws Exception {
- a.post("/a04", "foo").execute().assertBody("foo");
+ a.post("/a04", "foo").run().assertBody().is("foo");
}
@Test
public void a05_Reader() throws Exception {
- a.post("/a05", "foo").execute().assertBody("foo");
+ a.post("/a05", "foo").run().assertBody().is("foo");
}
@Test
public void a06_OutputStream() throws Exception {
- a.get("/a06").execute().assertBody("OK");
+ a.get("/a06").run().assertBody().is("OK");
}
@Test
public void a07_ServletOutputStream() throws Exception {
- a.get("/a07").execute().assertBody("OK");
+ a.get("/a07").run().assertBody().is("OK");
}
@Test
public void a08_Writer() throws Exception {
- a.get("/a08").execute().assertBody("OK");
+ a.get("/a08").run().assertBody().is("OK");
}
@Test
public void a09_RequestHeaders() throws Exception {
- a.get("/a09").execute().assertBody("true");
+ a.get("/a09").run().assertBody().is("true");
}
@Test
public void a10_RequestQuery() throws Exception {
- a.get("/a10").execute().assertBody("true");
+ a.get("/a10").run().assertBody().is("true");
}
@Test
public void a11_RequestFormData() throws Exception {
- a.get("/a11").execute().assertBody("true");
+ a.get("/a11").run().assertBody().is("true");
}
@Test
public void a12_HttpMethod() throws Exception {
- a.get("/a12").execute().assertBody("GET");
+ a.get("/a12").run().assertBody().is("GET");
}
@Test
public void a13_RestLogger() throws Exception {
- a.get("/a13").execute().assertBody("true");
+ a.get("/a13").run().assertBody().is("true");
}
@Test
public void a14_RestContext() throws Exception {
- a.get("/a14").execute().assertBody("true");
+ a.get("/a14").run().assertBody().is("true");
}
@Test
public void a15_Parser() throws Exception {
- a.get("/a15").contentType("application/json").execute().assertBody("org.apache.juneau.json.JsonParser");
+ a.get("/a15").contentType("application/json").run().assertBody().is("org.apache.juneau.json.JsonParser");
}
@Test
public void a16_Locale() throws Exception {
- a.get("/a16").acceptLanguage("en-US").execute().assertBody("en_US");
- a.get("/a16").acceptLanguage("ja-JP").execute().assertBody("ja_JP");
+ a.get("/a16").acceptLanguage("en-US").run().assertBody().is("en_US");
+ a.get("/a16").acceptLanguage("ja-JP").run().assertBody().is("ja_JP");
}
@Test
public void a17_Swagger() throws Exception {
- a.get("/a17").execute().assertBody("true");
+ a.get("/a17").run().assertBody().is("true");
}
@Test
public void a18_RequestPathMatch() throws Exception {
- a.get("/a18").execute().assertBody("true");
+ a.get("/a18").run().assertBody().is("true");
}
@Test
public void a19_RequestBody() throws Exception {
- a.get("/a19").execute().assertBody("true");
+ a.get("/a19").run().assertBody().is("true");
}
@Test
public void a20_Config() throws Exception {
- a.get("/a20").execute().assertBody("true");
+ a.get("/a20").run().assertBody().is("true");
}
}
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 752befe..32830d0 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
@@ -43,7 +43,7 @@ public class StatusCodesTest {
@Test
public void a01a_OK() throws Exception {
- a.put("/a01", "foo").execute().assertStatus(200);
+ a.put("/a01", "foo").run().assertStatus().equals(200);
}
//=================================================================================================================
@@ -108,81 +108,81 @@ public class StatusCodesTest {
@Test
public void b01a_nonExistentBeanProperties() throws Exception {
- b.put("/nonExistentBeanProperties?noTrace=true", "{f2:'foo'}").json().execute()
- .assertStatus(400)
- .assertBodyContains(
+ b.put("/nonExistentBeanProperties?noTrace=true", "{f2:'foo'}").json().run()
+ .assertStatus().equals(400)
+ .assertBody().contains(
"Unknown property 'f2' encountered while trying to parse into class 'org.apache.juneau.rest.StatusCodesTest$B$B01'"
);
}
@Test
public void b01b_nonExistentBeanProperties() throws Exception {
- b.put("/nonExistentBeanProperties?noTrace=true", "{f1:'foo', f2:'foo'}").json().execute()
- .assertStatus(400)
- .assertBodyContains(
+ b.put("/nonExistentBeanProperties?noTrace=true", "{f1:'foo', f2:'foo'}").json().run()
+ .assertStatus().equals(400)
+ .assertBody().contains(
"Unknown property 'f2' encountered while trying to parse into class 'org.apache.juneau.rest.StatusCodesTest$B$B01'"
);
}
@Test
public void b02_wrongDataType() throws Exception {
- b.put("/wrongDataType?noTrace=true", "{f1:'foo'}").json().execute()
- .assertStatus(400)
- .assertBodyContains(
+ b.put("/wrongDataType?noTrace=true", "{f1:'foo'}").json().run()
+ .assertStatus().equals(400)
+ .assertBody().contains(
"Invalid number"
);
}
@Test
public void b03_parseIntoNonConstructableBean() throws Exception {
- b.put("/parseIntoNonConstructableBean?noTrace=true", "{f1:1}").json().execute()
- .assertStatus(400)
- .assertBodyContains(
+ b.put("/parseIntoNonConstructableBean?noTrace=true", "{f1:1}").json().run()
+ .assertStatus().equals(400)
+ .assertBody().contains(
"could not be instantiated"
);
}
@Test
public void b04_parseIntoNonStaticInnerClass() throws Exception {
- b.put("/parseIntoNonStaticInnerClass?noTrace=true", "{f1:1}").json().execute()
- .assertStatus(400)
- .assertBodyContains(
+ b.put("/parseIntoNonStaticInnerClass?noTrace=true", "{f1:1}").json().run()
+ .assertStatus().equals(400)
+ .assertBody().contains(
"could not be instantiated"
);
}
@Test
public void b05_parseIntoNonStaticInnerClass() throws Exception {
- b.put("/parseIntoNonPublicInnerClass?noTrace=true", "{f1:1}").json().execute()
- .assertStatus(400)
- .assertBodyContains(
+ b.put("/parseIntoNonPublicInnerClass?noTrace=true", "{f1:1}").json().run()
+ .assertStatus().equals(400)
+ .assertBody().contains(
"Class is not public"
);
}
@Test
public void b06_thrownConstructorException() throws Exception {
- b.put("/thrownConstructorException?noTrace=true", "'foo'").json().execute()
- .assertStatus(400)
- .assertBodyContains(
+ b.put("/thrownConstructorException?noTrace=true", "'foo'").json().run()
+ .assertStatus().equals(400)
+ .assertBody().contains(
"Test error"
);
}
@Test
public void b07a_setParameterToInvalidTypes_Query() throws Exception {
- b.put("/setParameterToInvalidTypes/123?noTrace=true&p1=foo", "'foo'").json().execute()
- .assertStatus(400)
- .assertBodyContains(
+ b.put("/setParameterToInvalidTypes/123?noTrace=true&p1=foo", "'foo'").json().run()
+ .assertStatus().equals(400)
+ .assertBody().contains(
"Could not parse query parameter 'p1'."
);
}
@Test
public void b07a_setParameterToInvalidTypes_Path() throws Exception {
- b.put("/setParameterToInvalidTypes/foo?noTrace=true&p1=1", "'foo'").json().execute()
- .assertStatus(400)
- .assertBodyContains(
+ b.put("/setParameterToInvalidTypes/foo?noTrace=true&p1=1", "'foo'").json().run()
+ .assertStatus().equals(400)
+ .assertBody().contains(
"Could not parse path parameter 'a1'."
);
}
@Test
public void b07a_setParameterToInvalidTypes_Header() throws Exception {
- b.put("/setParameterToInvalidTypes/123?noTrace=true&p1=1", "'foo'").header("h1", "foo").json().execute()
- .assertStatus(400)
- .assertBodyContains(
+ b.put("/setParameterToInvalidTypes/123?noTrace=true&p1=1", "'foo'").header("h1", "foo").json().run()
+ .assertStatus().equals(400)
+ .assertBody().contains(
"Could not parse header 'h1'."
);
}
@@ -202,16 +202,16 @@ public class StatusCodesTest {
@Test
public void c01_badPath() throws Exception {
- c.get("/bad?noTrace=true").execute()
- .assertStatus(404)
- .assertBodyContains(
+ c.get("/bad?noTrace=true").run()
+ .assertStatus().equals(404)
+ .assertBody().contains(
"Method 'GET' not found on resource with matching pattern on path '/bad'"
);
}
public void c02_badMethod() throws Exception {
- c.put("?noTrace=true", null).execute()
- .assertStatus(405)
- .assertBodyContains(
+ c.put("?noTrace=true", null).run()
+ .assertStatus().equals(405)
+ .assertBody().contains(
"Method 'PUT' not found on resource."
);
}
@@ -237,9 +237,9 @@ public class StatusCodesTest {
@Test
public void d01() throws Exception {
- d.get("/d?noTrace=true").execute()
- .assertStatus(412)
- .assertBodyContains(
+ d.get("/d?noTrace=true").run()
+ .assertStatus().equals(412)
+ .assertBody().contains(
"Method 'GET' not found on resource on path '/d' with matching matcher."
);
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/ThreadLocalObjectsTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/ThreadLocalObjectsTest.java
index 6d83642..83e7e0f 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/ThreadLocalObjectsTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/ThreadLocalObjectsTest.java
@@ -44,8 +44,8 @@ public class ThreadLocalObjectsTest {
@Test
public void a01() throws Exception {
- a.get("/a01?foo=bar").execute()
- .assertBodyContains("bar")
+ a.get("/a01?foo=bar").run()
+ .assertBody().contains("bar")
;
}
@@ -70,8 +70,8 @@ public class ThreadLocalObjectsTest {
@Test
public void b01() throws Exception {
- b.get("/a/a01?foo=bar").execute()
- .assertBodyContains("bar")
+ b.get("/a/a01?foo=bar").run()
+ .assertBody().contains("bar")
;
}
}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocAsideTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocAsideTest.java
index 6aa5fe5..1adf127 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocAsideTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocAsideTest.java
@@ -53,23 +53,23 @@ public class HtmlDocAsideTest {
@Test
public void a01() throws Exception {
- a.get("/a01").accept("text/html").execute().assertBodyContains("<aside>a01a a01b</aside>");
+ a.get("/a01").accept("text/html").run().assertBody().contains("<aside>a01a a01b</aside>");
}
@Test
public void a02() throws Exception {
- a.get("/a02").accept("text/html").execute().assertBodyContains("<aside>a02a a02b</aside>");
+ a.get("/a02").accept("text/html").run().assertBody().contains("<aside>a02a a02b</aside>");
}
@Test
public void a03() throws Exception {
- a.get("/a03").accept("text/html").execute().assertBodyContains("<aside>a01a a01b a03a a03b</aside>");
+ a.get("/a03").accept("text/html").run().assertBody().contains("<aside>a01a a01b a03a a03b</aside>");
}
@Test
public void a04() throws Exception {
- a.get("/a04").accept("text/html").execute().assertBodyContains("<aside>a04a a01a a01b a04b</aside>");
+ a.get("/a04").accept("text/html").run().assertBody().contains("<aside>a04a a01a a01b a04b</aside>");
}
@Test
public void a05() throws Exception {
- a.get("/a05").accept("text/html").execute().assertBodyContains("<aside>a05a a05b a01a a01b</aside>");
+ a.get("/a05").accept("text/html").run().assertBody().contains("<aside>a05a a05b a01a a01b</aside>");
}
//=================================================================================================================
@@ -103,22 +103,22 @@ public class HtmlDocAsideTest {
@Test
public void b01() throws Exception {
- b.get("/b01").accept("text/html").execute().assertBodyContains("<aside>a01a a01b b01a b01b</aside>");
+ b.get("/b01").accept("text/html").run().assertBody().contains("<aside>a01a a01b b01a b01b</aside>");
}
@Test
public void b02() throws Exception {
- b.get("/b02").accept("text/html").execute().assertBodyContains("<aside>b02a b02b</aside>");
+ b.get("/b02").accept("text/html").run().assertBody().contains("<aside>b02a b02b</aside>");
}
@Test
public void b03() throws Exception {
- b.get("/b03").accept("text/html").execute().assertBodyContains("<aside>a01a a01b b01a b01b b03a b03b</aside>");
+ b.get("/b03").accept("text/html").run().assertBody().contains("<aside>a01a a01b b01a b01b b03a b03b</aside>");
}
@Test
public void b04() throws Exception {
- b.get("/b04").accept("text/html").execute().assertBodyContains("<aside>b04a a01a a01b b01a b01b b04b</aside>");
+ b.get("/b04").accept("text/html").run().assertBody().contains("<aside>b04a a01a a01b b01a b01b b04b</aside>");
}
@Test
public void b05() throws Exception {
- b.get("/b05").accept("text/html").execute().assertBodyContains("<aside>b05a b05b a01a a01b b01a b01b</aside>");
+ b.get("/b05").accept("text/html").run().assertBody().contains("<aside>b05a b05b a01a a01b b01a b01b</aside>");
}
}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigAsideTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigAsideTest.java
index 815e33b..fe96ec4 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigAsideTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigAsideTest.java
@@ -59,23 +59,23 @@ public class HtmlDocConfigAsideTest {
@Test
public void a01() throws Exception {
- a.get("/a01").accept("text/html").execute().assertBodyContains("<aside>a01a a01b</aside>");
+ a.get("/a01").accept("text/html").run().assertBody().contains("<aside>a01a a01b</aside>");
}
@Test
public void a02() throws Exception {
- a.get("/a02").accept("text/html").execute().assertBodyContains("<aside>a02a a02b</aside>");
+ a.get("/a02").accept("text/html").run().assertBody().contains("<aside>a02a a02b</aside>");
}
@Test
public void a03() throws Exception {
- a.get("/a03").accept("text/html").execute().assertBodyContains("<aside>a01a a01b a03a a03b</aside>");
+ a.get("/a03").accept("text/html").run().assertBody().contains("<aside>a01a a01b a03a a03b</aside>");
}
@Test
public void a04() throws Exception {
- a.get("/a04").accept("text/html").execute().assertBodyContains("<aside>a04a a01a a01b a04b</aside>");
+ a.get("/a04").accept("text/html").run().assertBody().contains("<aside>a04a a01a a01b a04b</aside>");
}
@Test
public void a05() throws Exception {
- a.get("/a05").accept("text/html").execute().assertBodyContains("<aside>a05a a05b a01a a01b</aside>");
+ a.get("/a05").accept("text/html").run().assertBody().contains("<aside>a05a a05b a01a a01b</aside>");
}
//=================================================================================================================
@@ -114,22 +114,22 @@ public class HtmlDocConfigAsideTest {
@Test
public void b01() throws Exception {
- b.get("/b01").accept("text/html").execute().assertBodyContains("<aside>a01a a01b b01a b01b</aside>");
+ b.get("/b01").accept("text/html").run().assertBody().contains("<aside>a01a a01b b01a b01b</aside>");
}
@Test
public void b02() throws Exception {
- b.get("/b02").accept("text/html").execute().assertBodyContains("<aside>b02a b02b</aside>");
+ b.get("/b02").accept("text/html").run().assertBody().contains("<aside>b02a b02b</aside>");
}
@Test
public void b03() throws Exception {
- b.get("/b03").accept("text/html").execute().assertBodyContains("<aside>a01a a01b b01a b01b b03a b03b</aside>");
+ b.get("/b03").accept("text/html").run().assertBody().contains("<aside>a01a a01b b01a b01b b03a b03b</aside>");
}
@Test
public void b04() throws Exception {
- b.get("/b04").accept("text/html").execute().assertBodyContains("<aside>b04a a01a a01b b01a b01b b04b</aside>");
+ b.get("/b04").accept("text/html").run().assertBody().contains("<aside>b04a a01a a01b b01a b01b b04b</aside>");
}
@Test
public void b05() throws Exception {
- b.get("/b05").accept("text/html").execute().assertBodyContains("<aside>b05a b05b a01a a01b b01a b01b</aside>");
+ b.get("/b05").accept("text/html").run().assertBody().contains("<aside>b05a b05b a01a a01b b01a b01b</aside>");
}
}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigFooterTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigFooterTest.java
index 1d49a34..99e8046 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigFooterTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigFooterTest.java
@@ -59,23 +59,23 @@ public class HtmlDocConfigFooterTest {
@Test
public void a01() throws Exception {
- a.get("/a01").accept("text/html").execute().assertBodyContains("<footer>a01a a01b</footer>");
+ a.get("/a01").accept("text/html").run().assertBody().contains("<footer>a01a a01b</footer>");
}
@Test
public void a02() throws Exception {
- a.get("/a02").accept("text/html").execute().assertBodyContains("<footer>a02a a02b</footer>");
+ a.get("/a02").accept("text/html").run().assertBody().contains("<footer>a02a a02b</footer>");
}
@Test
public void a03() throws Exception {
- a.get("/a03").accept("text/html").execute().assertBodyContains("<footer>a01a a01b a03a a03b</footer>");
+ a.get("/a03").accept("text/html").run().assertBody().contains("<footer>a01a a01b a03a a03b</footer>");
}
@Test
public void a04() throws Exception {
- a.get("/a04").accept("text/html").execute().assertBodyContains("<footer>a04a a01a a01b a04b</footer>");
+ a.get("/a04").accept("text/html").run().assertBody().contains("<footer>a04a a01a a01b a04b</footer>");
}
@Test
public void a05() throws Exception {
- a.get("/a05").accept("text/html").execute().assertBodyContains("<footer>a05a a05b a01a a01b</footer>");
+ a.get("/a05").accept("text/html").run().assertBody().contains("<footer>a05a a05b a01a a01b</footer>");
}
//=================================================================================================================
@@ -114,22 +114,22 @@ public class HtmlDocConfigFooterTest {
@Test
public void b01() throws Exception {
- b.get("/b01").accept("text/html").execute().assertBodyContains("<footer>b01a a01a a01b b01b</footer>");
+ b.get("/b01").accept("text/html").run().assertBody().contains("<footer>b01a a01a a01b b01b</footer>");
}
@Test
public void b02() throws Exception {
- b.get("/b02").accept("text/html").execute().assertBodyContains("<footer>b02a b02b</footer>");
+ b.get("/b02").accept("text/html").run().assertBody().contains("<footer>b02a b02b</footer>");
}
@Test
public void b03() throws Exception {
- b.get("/b03").accept("text/html").execute().assertBodyContains("<footer>b01a a01a a01b b01b b03a b03b</footer>");
+ b.get("/b03").accept("text/html").run().assertBody().contains("<footer>b01a a01a a01b b01b b03a b03b</footer>");
}
@Test
public void b04() throws Exception {
- b.get("/b04").accept("text/html").execute().assertBodyContains("<footer>b04a b01a a01a a01b b01b b04b</footer>");
+ b.get("/b04").accept("text/html").run().assertBody().contains("<footer>b04a b01a a01a a01b b01b b04b</footer>");
}
@Test
public void b05() throws Exception {
- b.get("/b05").accept("text/html").execute().assertBodyContains("<footer>b05a b05b b01a a01a a01b b01b</footer>");
+ b.get("/b05").accept("text/html").run().assertBody().contains("<footer>b05a b05b b01a a01a a01b b01b</footer>");
}
}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigHeaderTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigHeaderTest.java
index eb7eb21..07291e2 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigHeaderTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigHeaderTest.java
@@ -59,23 +59,23 @@ public class HtmlDocConfigHeaderTest {
@Test
public void a01() throws Exception {
- a.get("/a01").accept("text/html").execute().assertBodyContains("<header>a01a a01b</header>");
+ a.get("/a01").accept("text/html").run().assertBody().contains("<header>a01a a01b</header>");
}
@Test
public void a02() throws Exception {
- a.get("/a02").accept("text/html").execute().assertBodyContains("<header>a02a a02b</header>");
+ a.get("/a02").accept("text/html").run().assertBody().contains("<header>a02a a02b</header>");
}
@Test
public void a03() throws Exception {
- a.get("/a03").accept("text/html").execute().assertBodyContains("<header>a01a a01b a03a a03b</header>");
+ a.get("/a03").accept("text/html").run().assertBody().contains("<header>a01a a01b a03a a03b</header>");
}
@Test
public void a04() throws Exception {
- a.get("/a04").accept("text/html").execute().assertBodyContains("<header>a04a a01a a01b a04b</header>");
+ a.get("/a04").accept("text/html").run().assertBody().contains("<header>a04a a01a a01b a04b</header>");
}
@Test
public void a05() throws Exception {
- a.get("/a05").accept("text/html").execute().assertBodyContains("<header>a05a a05b a01a a01b</header>");
+ a.get("/a05").accept("text/html").run().assertBody().contains("<header>a05a a05b a01a a01b</header>");
}
//=================================================================================================================
@@ -114,22 +114,22 @@ public class HtmlDocConfigHeaderTest {
@Test
public void b01() throws Exception {
- b.get("/b01").accept("text/html").execute().assertBodyContains("<header>b01a b01b a01a a01b</header>");
+ b.get("/b01").accept("text/html").run().assertBody().contains("<header>b01a b01b a01a a01b</header>");
}
@Test
public void b02() throws Exception {
- b.get("/b02").accept("text/html").execute().assertBodyContains("<header>b02a b02b</header>");
+ b.get("/b02").accept("text/html").run().assertBody().contains("<header>b02a b02b</header>");
}
@Test
public void b03() throws Exception {
- b.get("/b03").accept("text/html").execute().assertBodyContains("<header>b01a b01b a01a a01b b03a b03b</header>");
+ b.get("/b03").accept("text/html").run().assertBody().contains("<header>b01a b01b a01a a01b b03a b03b</header>");
}
@Test
public void b04() throws Exception {
- b.get("/b04").accept("text/html").execute().assertBodyContains("<header>b04a b01a b01b a01a a01b b04b</header>");
+ b.get("/b04").accept("text/html").run().assertBody().contains("<header>b04a b01a b01b a01a a01b b04b</header>");
}
@Test
public void b05() throws Exception {
- b.get("/b05").accept("text/html").execute().assertBodyContains("<header>b05a b05b b01a b01b a01a a01b</header>");
+ b.get("/b05").accept("text/html").run().assertBody().contains("<header>b05a b05b b01a b01b a01a a01b</header>");
}
}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigNavTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigNavTest.java
index 57a6103..bb1cb8b 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigNavTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigNavTest.java
@@ -59,23 +59,23 @@ public class HtmlDocConfigNavTest {
@Test
public void a01() throws Exception {
- a.get("/a01").accept("text/html").execute().assertBodyContains("<nav>a01a a01b</nav>");
+ a.get("/a01").accept("text/html").run().assertBody().contains("<nav>a01a a01b</nav>");
}
@Test
public void a02() throws Exception {
- a.get("/a02").accept("text/html").execute().assertBodyContains("<nav>a02a a02b</nav>");
+ a.get("/a02").accept("text/html").run().assertBody().contains("<nav>a02a a02b</nav>");
}
@Test
public void a03() throws Exception {
- a.get("/a03").accept("text/html").execute().assertBodyContains("<nav>a01a a01b a03a a03b</nav>");
+ a.get("/a03").accept("text/html").run().assertBody().contains("<nav>a01a a01b a03a a03b</nav>");
}
@Test
public void a04() throws Exception {
- a.get("/a04").accept("text/html").execute().assertBodyContains("<nav>a04a a01a a01b a04b</nav>");
+ a.get("/a04").accept("text/html").run().assertBody().contains("<nav>a04a a01a a01b a04b</nav>");
}
@Test
public void a05() throws Exception {
- a.get("/a05").accept("text/html").execute().assertBodyContains("<nav>a05a a05b a01a a01b</nav>");
+ a.get("/a05").accept("text/html").run().assertBody().contains("<nav>a05a a05b a01a a01b</nav>");
}
//=================================================================================================================
@@ -114,22 +114,22 @@ public class HtmlDocConfigNavTest {
@Test
public void b01() throws Exception {
- b.get("/b01").accept("text/html").execute().assertBodyContains("<nav>a01a a01b b01a b01b</nav>");
+ b.get("/b01").accept("text/html").run().assertBody().contains("<nav>a01a a01b b01a b01b</nav>");
}
@Test
public void b02() throws Exception {
- b.get("/b02").accept("text/html").execute().assertBodyContains("<nav>b02a b02b</nav>");
+ b.get("/b02").accept("text/html").run().assertBody().contains("<nav>b02a b02b</nav>");
}
@Test
public void b03() throws Exception {
- b.get("/b03").accept("text/html").execute().assertBodyContains("<nav>a01a a01b b01a b01b b03a b03b</nav>");
+ b.get("/b03").accept("text/html").run().assertBody().contains("<nav>a01a a01b b01a b01b b03a b03b</nav>");
}
@Test
public void b04() throws Exception {
- b.get("/b04").accept("text/html").execute().assertBodyContains("<nav>b04a a01a a01b b01a b01b b04b</nav>");
+ b.get("/b04").accept("text/html").run().assertBody().contains("<nav>b04a a01a a01b b01a b01b b04b</nav>");
}
@Test
public void b05() throws Exception {
- b.get("/b05").accept("text/html").execute().assertBodyContains("<nav>b05a b05b a01a a01b b01a b01b</nav>");
+ b.get("/b05").accept("text/html").run().assertBody().contains("<nav>b05a b05b a01a a01b b01a b01b</nav>");
}
}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigNavlinksTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigNavlinksTest.java
index 5b993fd..4dfe28d 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigNavlinksTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigNavlinksTest.java
@@ -90,47 +90,47 @@ public class HtmlDocConfigNavlinksTest {
@Test
public void a01() throws Exception {
- a.get("/a01").accept("text/html").execute().assertBodyContains("<nav><ol><li>a01a</li><li>a01b</li></ol></nav>");
+ a.get("/a01").accept("text/html").run().assertBody().contains("<nav><ol><li>a01a</li><li>a01b</li></ol></nav>");
}
@Test
public void a02() throws Exception {
- a.get("/a02").accept("text/html").execute().assertBodyContains("<nav><ol><li>a02a</li><li>a02b</li></ol></nav>");
+ a.get("/a02").accept("text/html").run().assertBody().contains("<nav><ol><li>a02a</li><li>a02b</li></ol></nav>");
}
@Test
public void a03() throws Exception {
- a.get("/a03").accept("text/html").execute().assertBodyContains("<nav><ol><li>a01a</li><li>a01b</li><li>a03a</li><li>a03b</li></ol></nav>");
+ a.get("/a03").accept("text/html").run().assertBody().contains("<nav><ol><li>a01a</li><li>a01b</li><li>a03a</li><li>a03b</li></ol></nav>");
}
@Test
public void a04() throws Exception {
- a.get("/a04").accept("text/html").execute().assertBodyContains("<nav><ol><li>a04a</li><li>a01a</li><li>a01b</li><li>a04b</li></ol></nav>");
+ a.get("/a04").accept("text/html").run().assertBody().contains("<nav><ol><li>a04a</li><li>a01a</li><li>a01b</li><li>a04b</li></ol></nav>");
}
@Test
public void a05() throws Exception {
- a.get("/a05").accept("text/html").execute().assertBodyContains("<nav><ol><li>a05a</li><li>a05b</li><li>a01a</li><li>a01b</li></ol></nav>");
+ a.get("/a05").accept("text/html").run().assertBody().contains("<nav><ol><li>a05a</li><li>a05b</li><li>a01a</li><li>a01b</li></ol></nav>");
}
@Test
public void a06() throws Exception {
- a.get("/a06").accept("text/html").execute().assertBodyContains("<nav><ol><li>a06a</li><li>a01a</li><li>a01b</li><li>a06b</li></ol></nav>");
+ a.get("/a06").accept("text/html").run().assertBody().contains("<nav><ol><li>a06a</li><li>a01a</li><li>a01b</li><li>a06b</li></ol></nav>");
}
@Test
public void a07() throws Exception {
- a.get("/a07").accept("text/html").execute().assertBodyContains("<nav><ol><li>a07a</li><li>a07b</li><li>a01a</li><li>a01b</li></ol></nav>");
+ a.get("/a07").accept("text/html").run().assertBody().contains("<nav><ol><li>a07a</li><li>a07b</li><li>a01a</li><li>a01b</li></ol></nav>");
}
@Test
public void a08() throws Exception {
- a.get("/a08").accept("text/html").execute().assertBodyContains("<nav><ol><li>a08b</li><li>a08a</li></ol></nav>");
+ a.get("/a08").accept("text/html").run().assertBody().contains("<nav><ol><li>a08b</li><li>a08a</li></ol></nav>");
}
@Test
public void a09() throws Exception {
- a.get("/a09").accept("text/html").execute().assertBodyContains("<nav><ol><li><a href=\"/a09a\">foo</a></li><li>a01a</li><li>a01b</li><li><a href=\"/a09b\">bar</a></li></ol></nav>");
+ a.get("/a09").accept("text/html").run().assertBody().contains("<nav><ol><li><a href=\"/a09a\">foo</a></li><li>a01a</li><li>a01b</li><li><a href=\"/a09b\">bar</a></li></ol></nav>");
}
@Test
public void a10() throws Exception {
- a.get("/a10").accept("text/html").execute().assertBodyContains("<nav><ol><li><a href=\"/a10a\">foo</a></li><li><a href=\"/a10b\">bar</a></li><li>a01a</li><li>a01b</li></ol></nav>");
+ a.get("/a10").accept("text/html").run().assertBody().contains("<nav><ol><li><a href=\"/a10a\">foo</a></li><li><a href=\"/a10b\">bar</a></li><li>a01a</li><li>a01b</li></ol></nav>");
}
@Test
public void a11() throws Exception {
- a.get("/a11").accept("text/html").execute().assertBodyContains("<nav><ol><li><a href=\"/a11b\">bar</a></li><li><a href=\"/a11a\">foo</a></li></ol></nav>");
+ a.get("/a11").accept("text/html").run().assertBody().contains("<nav><ol><li><a href=\"/a11b\">bar</a></li><li><a href=\"/a11a\">foo</a></li></ol></nav>");
}
//=================================================================================================================
@@ -200,46 +200,46 @@ public class HtmlDocConfigNavlinksTest {
@Test
public void b01() throws Exception {
- b.get("/b01").accept("text/html").execute().assertBodyContains("<nav><ol><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li></ol></nav>");
+ b.get("/b01").accept("text/html").run().assertBody().contains("<nav><ol><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li></ol></nav>");
}
@Test
public void b02() throws Exception {
- b.get("/b02").accept("text/html").execute().assertBodyContains("<nav><ol><li>b02a</li><li>b02b</li></ol></nav>");
+ b.get("/b02").accept("text/html").run().assertBody().contains("<nav><ol><li>b02a</li><li>b02b</li></ol></nav>");
}
@Test
public void b03() throws Exception {
- b.get("/b03").accept("text/html").execute().assertBodyContains("<nav><ol><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li><li>b03a</li><li>b03b</li></ol></nav>");
+ b.get("/b03").accept("text/html").run().assertBody().contains("<nav><ol><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li><li>b03a</li><li>b03b</li></ol></nav>");
}
@Test
public void b04() throws Exception {
- b.get("/b04").accept("text/html").execute().assertBodyContains("<nav><ol><li>b04a</li><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li><li>b04b</li></ol></nav>");
+ b.get("/b04").accept("text/html").run().assertBody().contains("<nav><ol><li>b04a</li><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li><li>b04b</li></ol></nav>");
}
@Test
public void b05() throws Exception {
- b.get("/b05").accept("text/html").execute().assertBodyContains("<nav><ol><li>b05a</li><li>b05b</li><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li></ol></nav>");
+ b.get("/b05").accept("text/html").run().assertBody().contains("<nav><ol><li>b05a</li><li>b05b</li><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li></ol></nav>");
}
@Test
public void b06() throws Exception {
- b.get("/b06").accept("text/html").execute().assertBodyContains("<nav><ol><li>b06a</li><li>a01a</li><li>a01b</li><li>b06b</li><li>b01a</li><li>b01b</li></ol></nav>");
+ b.get("/b06").accept("text/html").run().assertBody().contains("<nav><ol><li>b06a</li><li>a01a</li><li>a01b</li><li>b06b</li><li>b01a</li><li>b01b</li></ol></nav>");
}
@Test
public void b07() throws Exception {
- b.get("/b07").accept("text/html").execute().assertBodyContains("<nav><ol><li>b07a</li><li>b07b</li><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li></ol></nav>");
+ b.get("/b07").accept("text/html").run().assertBody().contains("<nav><ol><li>b07a</li><li>b07b</li><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li></ol></nav>");
}
@Test
public void b08() throws Exception {
- b.get("/b08").accept("text/html").execute().assertBodyContains("<nav><ol><li>b08b</li><li>b08a</li></ol></nav>");
+ b.get("/b08").accept("text/html").run().assertBody().contains("<nav><ol><li>b08b</li><li>b08a</li></ol></nav>");
}
@Test
public void b09() throws Exception {
- b.get("/b09").accept("text/html").execute().assertBodyContains("<nav><ol><li><a href=\"/b09a\">foo</a></li><li>a01a</li><li>a01b</li><li><a href=\"/b09b\">bar</a></li><li>b01a</li><li>b01b</li></ol></nav>");
+ b.get("/b09").accept("text/html").run().assertBody().contains("<nav><ol><li><a href=\"/b09a\">foo</a></li><li>a01a</li><li>a01b</li><li><a href=\"/b09b\">bar</a></li><li>b01a</li><li>b01b</li></ol></nav>");
}
@Test
public void b10() throws Exception {
- b.get("/b10").accept("text/html").execute().assertBodyContains("<nav><ol><li><a href=\"/b10a\">foo</a></li><li><a href=\"/b10b\">bar</a></li><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li></ol></nav>");
+ b.get("/b10").accept("text/html").run().assertBody().contains("<nav><ol><li><a href=\"/b10a\">foo</a></li><li><a href=\"/b10b\">bar</a></li><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li></ol></nav>");
}
@Test
public void b11() throws Exception {
- b.get("/b11").accept("text/html").execute().assertBodyContains("<nav><ol><li><a href=\"/b11b\">bar</a></li><li><a href=\"/b11a\">foo</a></li></ol></nav>");
+ b.get("/b11").accept("text/html").run().assertBody().contains("<nav><ol><li><a href=\"/b11b\">bar</a></li><li><a href=\"/b11a\">foo</a></li></ol></nav>");
}
}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigScriptTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigScriptTest.java
index 6547c0c..6369851 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigScriptTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigScriptTest.java
@@ -59,23 +59,23 @@ public class HtmlDocConfigScriptTest {
@Test
public void a01() throws Exception {
- a.get("/a01").accept("text/html").execute().assertBodyContains("<script>a01a\n a01b\n</script>");
+ a.get("/a01").accept("text/html").run().assertBody().contains("<script>a01a\n a01b\n</script>");
}
@Test
public void a02() throws Exception {
- a.get("/a02").accept("text/html").execute().assertBodyContains("<script>a02a\n a02b\n</script>");
+ a.get("/a02").accept("text/html").run().assertBody().contains("<script>a02a\n a02b\n</script>");
}
@Test
public void a03() throws Exception {
- a.get("/a03").accept("text/html").execute().assertBodyContains("<script>a01a\n a01b\n a03a\n a03b\n</script>");
+ a.get("/a03").accept("text/html").run().assertBody().contains("<script>a01a\n a01b\n a03a\n a03b\n</script>");
}
@Test
public void a04() throws Exception {
- a.get("/a04").accept("text/html").execute().assertBodyContains("<script>a04a\n a01a\n a01b\n a04b\n</script>");
+ a.get("/a04").accept("text/html").run().assertBody().contains("<script>a04a\n a01a\n a01b\n a04b\n</script>");
}
@Test
public void a05() throws Exception {
- a.get("/a05").accept("text/html").execute().assertBodyContains("<script>a05a\n a05b\n a01a\n a01b\n</script>");
+ a.get("/a05").accept("text/html").run().assertBody().contains("<script>a05a\n a05b\n a01a\n a01b\n</script>");
}
//=================================================================================================================
@@ -114,22 +114,22 @@ public class HtmlDocConfigScriptTest {
@Test
public void b01() throws Exception {
- b.get("/b01").accept("text/html").execute().assertBodyContains("<script>b01a\n b01b\n</script>");
+ b.get("/b01").accept("text/html").run().assertBody().contains("<script>b01a\n b01b\n</script>");
}
@Test
public void b02() throws Exception {
- b.get("/b02").accept("text/html").execute().assertBodyContains("<script>b02a\n b02b\n</script>");
+ b.get("/b02").accept("text/html").run().assertBody().contains("<script>b02a\n b02b\n</script>");
}
@Test
public void b03() throws Exception {
- b.get("/b03").accept("text/html").execute().assertBodyContains("<script>b01a\n b01b\n b03a\n b03b\n</script>");
+ b.get("/b03").accept("text/html").run().assertBody().contains("<script>b01a\n b01b\n b03a\n b03b\n</script>");
}
@Test
public void b04() throws Exception {
- b.get("/b04").accept("text/html").execute().assertBodyContains("<script>b04a\n b01a\n b01b\n b04b\n</script>");
+ b.get("/b04").accept("text/html").run().assertBody().contains("<script>b04a\n b01a\n b01b\n b04b\n</script>");
}
@Test
public void b05() throws Exception {
- b.get("/b05").accept("text/html").execute().assertBodyContains("<script>b05a\n b05b\n b01a\n b01b\n</script>");
+ b.get("/b05").accept("text/html").run().assertBody().contains("<script>b05a\n b05b\n b01a\n b01b\n</script>");
}
}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigStyleTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigStyleTest.java
index 80cc352..ed0c8b4 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigStyleTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocConfigStyleTest.java
@@ -59,23 +59,23 @@ public class HtmlDocConfigStyleTest {
@Test
public void a01() throws Exception {
- a.get("/a01").accept("text/html").execute().assertBodyContains("<style>@import \"/a01s\"; a01a a01b</style>");
+ a.get("/a01").accept("text/html").run().assertBody().contains("<style>@import \"/a01s\"; a01a a01b</style>");
}
@Test
public void a02() throws Exception {
- a.get("/a02").accept("text/html").execute().assertBodyContains("<style>@import \"/a02s\"; a02a a02b</style>");
+ a.get("/a02").accept("text/html").run().assertBody().contains("<style>@import \"/a02s\"; a02a a02b</style>");
}
@Test
public void a03() throws Exception {
- a.get("/a03").accept("text/html").execute().assertBodyContains("<style>@import \"/a01s\"; a01a a01b a03a a03b</style>");
+ a.get("/a03").accept("text/html").run().assertBody().contains("<style>@import \"/a01s\"; a01a a01b a03a a03b</style>");
}
@Test
public void a04() throws Exception {
- a.get("/a04").accept("text/html").execute().assertBodyContains("<style>@import \"/a01s\"; a04a a01a a01b a04b</style>");
+ a.get("/a04").accept("text/html").run().assertBody().contains("<style>@import \"/a01s\"; a04a a01a a01b a04b</style>");
}
@Test
public void a05() throws Exception {
- a.get("/a05").accept("text/html").execute().assertBodyContains("<style>@import \"/a01s\"; a05a a05b a01a a01b</style>");
+ a.get("/a05").accept("text/html").run().assertBody().contains("<style>@import \"/a01s\"; a05a a05b a01a a01b</style>");
}
//=================================================================================================================
@@ -114,22 +114,22 @@ public class HtmlDocConfigStyleTest {
@Test
public void b01() throws Exception {
- b.get("/b01").accept("text/html").execute().assertBodyContains("<style>@import \"/b01s\"; b01a b01b</style>");
+ b.get("/b01").accept("text/html").run().assertBody().contains("<style>@import \"/b01s\"; b01a b01b</style>");
}
@Test
public void b02() throws Exception {
- b.get("/b02").accept("text/html").execute().assertBodyContains("<style>@import \"/b02s\"; b02a b02b</style>");
+ b.get("/b02").accept("text/html").run().assertBody().contains("<style>@import \"/b02s\"; b02a b02b</style>");
}
@Test
public void b03() throws Exception {
- b.get("/b03").accept("text/html").execute().assertBodyContains("<style>@import \"/b01s\"; b01a b01b b03a b03b</style>");
+ b.get("/b03").accept("text/html").run().assertBody().contains("<style>@import \"/b01s\"; b01a b01b b03a b03b</style>");
}
@Test
public void b04() throws Exception {
- b.get("/b04").accept("text/html").execute().assertBodyContains("<style>@import \"/b01s\"; b04a b01a b01b b04b</style>");
+ b.get("/b04").accept("text/html").run().assertBody().contains("<style>@import \"/b01s\"; b04a b01a b01b b04b</style>");
}
@Test
public void b05() throws Exception {
- b.get("/b05").accept("text/html").execute().assertBodyContains("<style>@import \"/b01s\"; b05a b05b b01a b01b</style>");
+ b.get("/b05").accept("text/html").run().assertBody().contains("<style>@import \"/b01s\"; b05a b05b b01a b01b</style>");
}
}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocFooterTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocFooterTest.java
index 653bb91..2df2c24 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocFooterTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocFooterTest.java
@@ -53,23 +53,23 @@ public class HtmlDocFooterTest {
@Test
public void a01() throws Exception {
- a.get("/a01").accept("text/html").execute().assertBodyContains("<footer>a01a a01b</footer>");
+ a.get("/a01").accept("text/html").run().assertBody().contains("<footer>a01a a01b</footer>");
}
@Test
public void a02() throws Exception {
- a.get("/a02").accept("text/html").execute().assertBodyContains("<footer>a02a a02b</footer>");
+ a.get("/a02").accept("text/html").run().assertBody().contains("<footer>a02a a02b</footer>");
}
@Test
public void a03() throws Exception {
- a.get("/a03").accept("text/html").execute().assertBodyContains("<footer>a01a a01b a03a a03b</footer>");
+ a.get("/a03").accept("text/html").run().assertBody().contains("<footer>a01a a01b a03a a03b</footer>");
}
@Test
public void a04() throws Exception {
- a.get("/a04").accept("text/html").execute().assertBodyContains("<footer>a04a a01a a01b a04b</footer>");
+ a.get("/a04").accept("text/html").run().assertBody().contains("<footer>a04a a01a a01b a04b</footer>");
}
@Test
public void a05() throws Exception {
- a.get("/a05").accept("text/html").execute().assertBodyContains("<footer>a05a a05b a01a a01b</footer>");
+ a.get("/a05").accept("text/html").run().assertBody().contains("<footer>a05a a05b a01a a01b</footer>");
}
//=================================================================================================================
@@ -103,22 +103,22 @@ public class HtmlDocFooterTest {
@Test
public void b01() throws Exception {
- b.get("/b01").accept("text/html").execute().assertBodyContains("<footer>b01a a01a a01b b01b</footer>");
+ b.get("/b01").accept("text/html").run().assertBody().contains("<footer>b01a a01a a01b b01b</footer>");
}
@Test
public void b02() throws Exception {
- b.get("/b02").accept("text/html").execute().assertBodyContains("<footer>b02a b02b</footer>");
+ b.get("/b02").accept("text/html").run().assertBody().contains("<footer>b02a b02b</footer>");
}
@Test
public void b03() throws Exception {
- b.get("/b03").accept("text/html").execute().assertBodyContains("<footer>b01a a01a a01b b01b b03a b03b</footer>");
+ b.get("/b03").accept("text/html").run().assertBody().contains("<footer>b01a a01a a01b b01b b03a b03b</footer>");
}
@Test
public void b04() throws Exception {
- b.get("/b04").accept("text/html").execute().assertBodyContains("<footer>b04a b01a a01a a01b b01b b04b</footer>");
+ b.get("/b04").accept("text/html").run().assertBody().contains("<footer>b04a b01a a01a a01b b01b b04b</footer>");
}
@Test
public void b05() throws Exception {
- b.get("/b05").accept("text/html").execute().assertBodyContains("<footer>b05a b05b b01a a01a a01b b01b</footer>");
+ b.get("/b05").accept("text/html").run().assertBody().contains("<footer>b05a b05b b01a a01a a01b b01b</footer>");
}
}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocHeaderTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocHeaderTest.java
index cde5a60..868e900 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocHeaderTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocHeaderTest.java
@@ -53,23 +53,23 @@ public class HtmlDocHeaderTest {
@Test
public void a01() throws Exception {
- a.get("/a01").accept("text/html").execute().assertBodyContains("<header>a01a a01b</header>");
+ a.get("/a01").accept("text/html").run().assertBody().contains("<header>a01a a01b</header>");
}
@Test
public void a02() throws Exception {
- a.get("/a02").accept("text/html").execute().assertBodyContains("<header>a02a a02b</header>");
+ a.get("/a02").accept("text/html").run().assertBody().contains("<header>a02a a02b</header>");
}
@Test
public void a03() throws Exception {
- a.get("/a03").accept("text/html").execute().assertBodyContains("<header>a01a a01b a03a a03b</header>");
+ a.get("/a03").accept("text/html").run().assertBody().contains("<header>a01a a01b a03a a03b</header>");
}
@Test
public void a04() throws Exception {
- a.get("/a04").accept("text/html").execute().assertBodyContains("<header>a04a a01a a01b a04b</header>");
+ a.get("/a04").accept("text/html").run().assertBody().contains("<header>a04a a01a a01b a04b</header>");
}
@Test
public void a05() throws Exception {
- a.get("/a05").accept("text/html").execute().assertBodyContains("<header>a05a a05b a01a a01b</header>");
+ a.get("/a05").accept("text/html").run().assertBody().contains("<header>a05a a05b a01a a01b</header>");
}
//=================================================================================================================
@@ -103,22 +103,22 @@ public class HtmlDocHeaderTest {
@Test
public void b01() throws Exception {
- b.get("/b01").accept("text/html").execute().assertBodyContains("<header>b01a b01b a01a a01b</header>");
+ b.get("/b01").accept("text/html").run().assertBody().contains("<header>b01a b01b a01a a01b</header>");
}
@Test
public void b02() throws Exception {
- b.get("/b02").accept("text/html").execute().assertBodyContains("<header>b02a b02b</header>");
+ b.get("/b02").accept("text/html").run().assertBody().contains("<header>b02a b02b</header>");
}
@Test
public void b03() throws Exception {
- b.get("/b03").accept("text/html").execute().assertBodyContains("<header>b01a b01b a01a a01b b03a b03b</header>");
+ b.get("/b03").accept("text/html").run().assertBody().contains("<header>b01a b01b a01a a01b b03a b03b</header>");
}
@Test
public void b04() throws Exception {
- b.get("/b04").accept("text/html").execute().assertBodyContains("<header>b04a b01a b01b a01a a01b b04b</header>");
+ b.get("/b04").accept("text/html").run().assertBody().contains("<header>b04a b01a b01b a01a a01b b04b</header>");
}
@Test
public void b05() throws Exception {
- b.get("/b05").accept("text/html").execute().assertBodyContains("<header>b05a b05b b01a b01b a01a a01b</header>");
+ b.get("/b05").accept("text/html").run().assertBody().contains("<header>b05a b05b b01a b01b a01a a01b</header>");
}
}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocNavTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocNavTest.java
index 17859d4..ede4a5c 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocNavTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocNavTest.java
@@ -53,23 +53,23 @@ public class HtmlDocNavTest {
@Test
public void a01() throws Exception {
- a.get("/a01").accept("text/html").execute().assertBodyContains("<nav>a01a a01b</nav>");
+ a.get("/a01").accept("text/html").run().assertBody().contains("<nav>a01a a01b</nav>");
}
@Test
public void a02() throws Exception {
- a.get("/a02").accept("text/html").execute().assertBodyContains("<nav>a02a a02b</nav>");
+ a.get("/a02").accept("text/html").run().assertBody().contains("<nav>a02a a02b</nav>");
}
@Test
public void a03() throws Exception {
- a.get("/a03").accept("text/html").execute().assertBodyContains("<nav>a01a a01b a03a a03b</nav>");
+ a.get("/a03").accept("text/html").run().assertBody().contains("<nav>a01a a01b a03a a03b</nav>");
}
@Test
public void a04() throws Exception {
- a.get("/a04").accept("text/html").execute().assertBodyContains("<nav>a04a a01a a01b a04b</nav>");
+ a.get("/a04").accept("text/html").run().assertBody().contains("<nav>a04a a01a a01b a04b</nav>");
}
@Test
public void a05() throws Exception {
- a.get("/a05").accept("text/html").execute().assertBodyContains("<nav>a05a a05b a01a a01b</nav>");
+ a.get("/a05").accept("text/html").run().assertBody().contains("<nav>a05a a05b a01a a01b</nav>");
}
//=================================================================================================================
@@ -103,22 +103,22 @@ public class HtmlDocNavTest {
@Test
public void b01() throws Exception {
- b.get("/b01").accept("text/html").execute().assertBodyContains("<nav>a01a a01b b01a b01b</nav>");
+ b.get("/b01").accept("text/html").run().assertBody().contains("<nav>a01a a01b b01a b01b</nav>");
}
@Test
public void b02() throws Exception {
- b.get("/b02").accept("text/html").execute().assertBodyContains("<nav>b02a b02b</nav>");
+ b.get("/b02").accept("text/html").run().assertBody().contains("<nav>b02a b02b</nav>");
}
@Test
public void b03() throws Exception {
- b.get("/b03").accept("text/html").execute().assertBodyContains("<nav>a01a a01b b01a b01b b03a b03b</nav>");
+ b.get("/b03").accept("text/html").run().assertBody().contains("<nav>a01a a01b b01a b01b b03a b03b</nav>");
}
@Test
public void b04() throws Exception {
- b.get("/b04").accept("text/html").execute().assertBodyContains("<nav>b04a a01a a01b b01a b01b b04b</nav>");
+ b.get("/b04").accept("text/html").run().assertBody().contains("<nav>b04a a01a a01b b01a b01b b04b</nav>");
}
@Test
public void b05() throws Exception {
- b.get("/b05").accept("text/html").execute().assertBodyContains("<nav>b05a b05b a01a a01b b01a b01b</nav>");
+ b.get("/b05").accept("text/html").run().assertBody().contains("<nav>b05a b05b a01a a01b b01a b01b</nav>");
}
}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocNavlinksTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocNavlinksTest.java
index fe60527..0fd5d1f 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocNavlinksTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocNavlinksTest.java
@@ -78,47 +78,47 @@ public class HtmlDocNavlinksTest {
@Test
public void a01() throws Exception {
- a.get("/a01").accept("text/html").execute().assertBodyContains("<nav><ol><li>a01a</li><li>a01b</li></ol></nav>");
+ a.get("/a01").accept("text/html").run().assertBody().contains("<nav><ol><li>a01a</li><li>a01b</li></ol></nav>");
}
@Test
public void a02() throws Exception {
- a.get("/a02").accept("text/html").execute().assertBodyContains("<nav><ol><li>a02a</li><li>a02b</li></ol></nav>");
+ a.get("/a02").accept("text/html").run().assertBody().contains("<nav><ol><li>a02a</li><li>a02b</li></ol></nav>");
}
@Test
public void a03() throws Exception {
- a.get("/a03").accept("text/html").execute().assertBodyContains("<nav><ol><li>a01a</li><li>a01b</li><li>a03a</li><li>a03b</li></ol></nav>");
+ a.get("/a03").accept("text/html").run().assertBody().contains("<nav><ol><li>a01a</li><li>a01b</li><li>a03a</li><li>a03b</li></ol></nav>");
}
@Test
public void a04() throws Exception {
- a.get("/a04").accept("text/html").execute().assertBodyContains("<nav><ol><li>a04a</li><li>a01a</li><li>a01b</li><li>a04b</li></ol></nav>");
+ a.get("/a04").accept("text/html").run().assertBody().contains("<nav><ol><li>a04a</li><li>a01a</li><li>a01b</li><li>a04b</li></ol></nav>");
}
@Test
public void a05() throws Exception {
- a.get("/a05").accept("text/html").execute().assertBodyContains("<nav><ol><li>a05a</li><li>a05b</li><li>a01a</li><li>a01b</li></ol></nav>");
+ a.get("/a05").accept("text/html").run().assertBody().contains("<nav><ol><li>a05a</li><li>a05b</li><li>a01a</li><li>a01b</li></ol></nav>");
}
@Test
public void a06() throws Exception {
- a.get("/a06").accept("text/html").execute().assertBodyContains("<nav><ol><li>a06a</li><li>a01a</li><li>a01b</li><li>a06b</li></ol></nav>");
+ a.get("/a06").accept("text/html").run().assertBody().contains("<nav><ol><li>a06a</li><li>a01a</li><li>a01b</li><li>a06b</li></ol></nav>");
}
@Test
public void a07() throws Exception {
- a.get("/a07").accept("text/html").execute().assertBodyContains("<nav><ol><li>a07a</li><li>a07b</li><li>a01a</li><li>a01b</li></ol></nav>");
+ a.get("/a07").accept("text/html").run().assertBody().contains("<nav><ol><li>a07a</li><li>a07b</li><li>a01a</li><li>a01b</li></ol></nav>");
}
@Test
public void a08() throws Exception {
- a.get("/a08").accept("text/html").execute().assertBodyContains("<nav><ol><li>a08b</li><li>a08a</li></ol></nav>");
+ a.get("/a08").accept("text/html").run().assertBody().contains("<nav><ol><li>a08b</li><li>a08a</li></ol></nav>");
}
@Test
public void a09() throws Exception {
- a.get("/a09").accept("text/html").execute().assertBodyContains("<nav><ol><li><a href=\"/a09a\">foo</a></li><li>a01a</li><li>a01b</li><li><a href=\"/a09b\">bar</a></li></ol></nav>");
+ a.get("/a09").accept("text/html").run().assertBody().contains("<nav><ol><li><a href=\"/a09a\">foo</a></li><li>a01a</li><li>a01b</li><li><a href=\"/a09b\">bar</a></li></ol></nav>");
}
@Test
public void a10() throws Exception {
- a.get("/a10").accept("text/html").execute().assertBodyContains("<nav><ol><li><a href=\"/a10a\">foo</a></li><li><a href=\"/a10b\">bar</a></li><li>a01a</li><li>a01b</li></ol></nav>");
+ a.get("/a10").accept("text/html").run().assertBody().contains("<nav><ol><li><a href=\"/a10a\">foo</a></li><li><a href=\"/a10b\">bar</a></li><li>a01a</li><li>a01b</li></ol></nav>");
}
@Test
public void a11() throws Exception {
- a.get("/a11").accept("text/html").execute().assertBodyContains("<nav><ol><li><a href=\"/a11b\">bar</a></li><li><a href=\"/a11a\">foo</a></li></ol></nav>");
+ a.get("/a11").accept("text/html").run().assertBody().contains("<nav><ol><li><a href=\"/a11b\">bar</a></li><li><a href=\"/a11a\">foo</a></li></ol></nav>");
}
//=================================================================================================================
@@ -177,46 +177,46 @@ public class HtmlDocNavlinksTest {
@Test
public void b01() throws Exception {
- b.get("/b01").accept("text/html").execute().assertBodyContains("<nav><ol><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li></ol></nav>");
+ b.get("/b01").accept("text/html").run().assertBody().contains("<nav><ol><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li></ol></nav>");
}
@Test
public void b02() throws Exception {
- b.get("/b02").accept("text/html").execute().assertBodyContains("<nav><ol><li>b02a</li><li>b02b</li></ol></nav>");
+ b.get("/b02").accept("text/html").run().assertBody().contains("<nav><ol><li>b02a</li><li>b02b</li></ol></nav>");
}
@Test
public void b03() throws Exception {
- b.get("/b03").accept("text/html").execute().assertBodyContains("<nav><ol><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li><li>b03a</li><li>b03b</li></ol></nav>");
+ b.get("/b03").accept("text/html").run().assertBody().contains("<nav><ol><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li><li>b03a</li><li>b03b</li></ol></nav>");
}
@Test
public void b04() throws Exception {
- b.get("/b04").accept("text/html").execute().assertBodyContains("<nav><ol><li>b04a</li><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li><li>b04b</li></ol></nav>");
+ b.get("/b04").accept("text/html").run().assertBody().contains("<nav><ol><li>b04a</li><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li><li>b04b</li></ol></nav>");
}
@Test
public void b05() throws Exception {
- b.get("/b05").accept("text/html").execute().assertBodyContains("<nav><ol><li>b05a</li><li>b05b</li><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li></ol></nav>");
+ b.get("/b05").accept("text/html").run().assertBody().contains("<nav><ol><li>b05a</li><li>b05b</li><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li></ol></nav>");
}
@Test
public void b06() throws Exception {
- b.get("/b06").accept("text/html").execute().assertBodyContains("<nav><ol><li>b06a</li><li>a01a</li><li>a01b</li><li>b06b</li><li>b01a</li><li>b01b</li></ol></nav>");
+ b.get("/b06").accept("text/html").run().assertBody().contains("<nav><ol><li>b06a</li><li>a01a</li><li>a01b</li><li>b06b</li><li>b01a</li><li>b01b</li></ol></nav>");
}
@Test
public void b07() throws Exception {
- b.get("/b07").accept("text/html").execute().assertBodyContains("<nav><ol><li>b07a</li><li>b07b</li><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li></ol></nav>");
+ b.get("/b07").accept("text/html").run().assertBody().contains("<nav><ol><li>b07a</li><li>b07b</li><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li></ol></nav>");
}
@Test
public void b08() throws Exception {
- b.get("/b08").accept("text/html").execute().assertBodyContains("<nav><ol><li>b08b</li><li>b08a</li></ol></nav>");
+ b.get("/b08").accept("text/html").run().assertBody().contains("<nav><ol><li>b08b</li><li>b08a</li></ol></nav>");
}
@Test
public void b09() throws Exception {
- b.get("/b09").accept("text/html").execute().assertBodyContains("<nav><ol><li><a href=\"/b09a\">foo</a></li><li>a01a</li><li>a01b</li><li><a href=\"/b09b\">bar</a></li><li>b01a</li><li>b01b</li></ol></nav>");
+ b.get("/b09").accept("text/html").run().assertBody().contains("<nav><ol><li><a href=\"/b09a\">foo</a></li><li>a01a</li><li>a01b</li><li><a href=\"/b09b\">bar</a></li><li>b01a</li><li>b01b</li></ol></nav>");
}
@Test
public void b10() throws Exception {
- b.get("/b10").accept("text/html").execute().assertBodyContains("<nav><ol><li><a href=\"/b10a\">foo</a></li><li><a href=\"/b10b\">bar</a></li><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li></ol></nav>");
+ b.get("/b10").accept("text/html").run().assertBody().contains("<nav><ol><li><a href=\"/b10a\">foo</a></li><li><a href=\"/b10b\">bar</a></li><li>a01a</li><li>a01b</li><li>b01a</li><li>b01b</li></ol></nav>");
}
@Test
public void b11() throws Exception {
- b.get("/b11").accept("text/html").execute().assertBodyContains("<nav><ol><li><a href=\"/b11b\">bar</a></li><li><a href=\"/b11a\">foo</a></li></ol></nav>");
+ b.get("/b11").accept("text/html").run().assertBody().contains("<nav><ol><li><a href=\"/b11b\">bar</a></li><li><a href=\"/b11a\">foo</a></li></ol></nav>");
}
}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocScriptTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocScriptTest.java
index 30dd88c..1a14845 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocScriptTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocScriptTest.java
@@ -53,23 +53,23 @@ public class HtmlDocScriptTest {
@Test
public void a01() throws Exception {
- a.get("/a01").accept("text/html").execute().assertBodyContains("<script>a01a\n a01b\n</script>");
+ a.get("/a01").accept("text/html").run().assertBody().contains("<script>a01a\n a01b\n</script>");
}
@Test
public void a02() throws Exception {
- a.get("/a02").accept("text/html").execute().assertBodyContains("<script>a02a\n a02b\n</script>");
+ a.get("/a02").accept("text/html").run().assertBody().contains("<script>a02a\n a02b\n</script>");
}
@Test
public void a03() throws Exception {
- a.get("/a03").accept("text/html").execute().assertBodyContains("<script>a01a\n a01b\n a03a\n a03b\n</script>");
+ a.get("/a03").accept("text/html").run().assertBody().contains("<script>a01a\n a01b\n a03a\n a03b\n</script>");
}
@Test
public void a04() throws Exception {
- a.get("/a04").accept("text/html").execute().assertBodyContains("<script>a04a\n a01a\n a01b\n a04b\n</script>");
+ a.get("/a04").accept("text/html").run().assertBody().contains("<script>a04a\n a01a\n a01b\n a04b\n</script>");
}
@Test
public void a05() throws Exception {
- a.get("/a05").accept("text/html").execute().assertBodyContains("<script>a05a\n a05b\n a01a\n a01b\n</script>");
+ a.get("/a05").accept("text/html").run().assertBody().contains("<script>a05a\n a05b\n a01a\n a01b\n</script>");
}
//=================================================================================================================
@@ -103,22 +103,22 @@ public class HtmlDocScriptTest {
@Test
public void b01() throws Exception {
- b.get("/b01").accept("text/html").execute().assertBodyContains("<script>b01a\n b01b\n</script>");
+ b.get("/b01").accept("text/html").run().assertBody().contains("<script>b01a\n b01b\n</script>");
}
@Test
public void b02() throws Exception {
- b.get("/b02").accept("text/html").execute().assertBodyContains("<script>b02a\n b02b\n</script>");
+ b.get("/b02").accept("text/html").run().assertBody().contains("<script>b02a\n b02b\n</script>");
}
@Test
public void b03() throws Exception {
- b.get("/b03").accept("text/html").execute().assertBodyContains("<script>b01a\n b01b\n b03a\n b03b\n</script>");
+ b.get("/b03").accept("text/html").run().assertBody().contains("<script>b01a\n b01b\n b03a\n b03b\n</script>");
}
@Test
public void b04() throws Exception {
- b.get("/b04").accept("text/html").execute().assertBodyContains("<script>b04a\n b01a\n b01b\n b04b\n</script>");
+ b.get("/b04").accept("text/html").run().assertBody().contains("<script>b04a\n b01a\n b01b\n b04b\n</script>");
}
@Test
public void b05() throws Exception {
- b.get("/b05").accept("text/html").execute().assertBodyContains("<script>b05a\n b05b\n b01a\n b01b\n</script>");
+ b.get("/b05").accept("text/html").run().assertBody().contains("<script>b05a\n b05b\n b01a\n b01b\n</script>");
}
}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocStyleTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocStyleTest.java
index 0ab3105..6f338c5 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocStyleTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/HtmlDocStyleTest.java
@@ -53,23 +53,23 @@ public class HtmlDocStyleTest {
@Test
public void a01() throws Exception {
- a.get("/a01").accept("text/html").execute().assertBodyContains("<style>@import \"/a01s\"; a01a a01b</style>");
+ a.get("/a01").accept("text/html").run().assertBody().contains("<style>@import \"/a01s\"; a01a a01b</style>");
}
@Test
public void a02() throws Exception {
- a.get("/a02").accept("text/html").execute().assertBodyContains("<style>@import \"/a02s\"; a02a a02b</style>");
+ a.get("/a02").accept("text/html").run().assertBody().contains("<style>@import \"/a02s\"; a02a a02b</style>");
}
@Test
public void a03() throws Exception {
- a.get("/a03").accept("text/html").execute().assertBodyContains("<style>@import \"/a01s\"; a01a a01b a03a a03b</style>");
+ a.get("/a03").accept("text/html").run().assertBody().contains("<style>@import \"/a01s\"; a01a a01b a03a a03b</style>");
}
@Test
public void a04() throws Exception {
- a.get("/a04").accept("text/html").execute().assertBodyContains("<style>@import \"/a01s\"; a04a a01a a01b a04b</style>");
+ a.get("/a04").accept("text/html").run().assertBody().contains("<style>@import \"/a01s\"; a04a a01a a01b a04b</style>");
}
@Test
public void a05() throws Exception {
- a.get("/a05").accept("text/html").execute().assertBodyContains("<style>@import \"/a01s\"; a05a a05b a01a a01b</style>");
+ a.get("/a05").accept("text/html").run().assertBody().contains("<style>@import \"/a01s\"; a05a a05b a01a a01b</style>");
}
//=================================================================================================================
@@ -103,22 +103,22 @@ public class HtmlDocStyleTest {
@Test
public void b01() throws Exception {
- b.get("/b01").accept("text/html").execute().assertBodyContains("<style>@import \"/b01s\"; b01a b01b</style>");
+ b.get("/b01").accept("text/html").run().assertBody().contains("<style>@import \"/b01s\"; b01a b01b</style>");
}
@Test
public void b02() throws Exception {
- b.get("/b02").accept("text/html").execute().assertBodyContains("<style>@import \"/b02s\"; b02a b02b</style>");
+ b.get("/b02").accept("text/html").run().assertBody().contains("<style>@import \"/b02s\"; b02a b02b</style>");
}
@Test
public void b03() throws Exception {
- b.get("/b03").accept("text/html").execute().assertBodyContains("<style>@import \"/b01s\"; b01a b01b b03a b03b</style>");
+ b.get("/b03").accept("text/html").run().assertBody().contains("<style>@import \"/b01s\"; b01a b01b b03a b03b</style>");
}
@Test
public void b04() throws Exception {
- b.get("/b04").accept("text/html").execute().assertBodyContains("<style>@import \"/b01s\"; b04a b01a b01b b04b</style>");
+ b.get("/b04").accept("text/html").run().assertBody().contains("<style>@import \"/b01s\"; b04a b01a b01b b04b</style>");
}
@Test
public void b05() throws Exception {
- b.get("/b05").accept("text/html").execute().assertBodyContains("<style>@import \"/b01s\"; b05a b05b b01a b01b</style>");
+ b.get("/b05").accept("text/html").run().assertBody().contains("<style>@import \"/b01s\"; b05a b05b b01a b01b</style>");
}
}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseHeaderAnnotationTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseHeaderAnnotationTest.java
index b990a3e..93b73ec 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseHeaderAnnotationTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseHeaderAnnotationTest.java
@@ -55,15 +55,15 @@ public class ResponseHeaderAnnotationTest {
@Test
public void a01_valueOnParameterPojo() throws Exception {
- a.get("/a01").execute().assertStatus(200).assertHeader("Foo", "foo");
+ a.get("/a01").run().assertStatus().equals(200).assertHeader("Foo").is("foo");
}
@Test
public void a02_valueOnParameterString() throws Exception {
- a.get("/a02").execute().assertStatus(200).assertHeader("Foo", "foo");
+ a.get("/a02").run().assertStatus().equals(200).assertHeader("Foo").is("foo");
}
@Test
public void a03_valueOnParameterOverrideName() throws Exception {
- a.get("/a03").execute().assertStatus(200).assertHeader("Bar", "foo");
+ a.get("/a03").run().assertStatus().equals(200).assertHeader("Bar").is("foo");
}
//=================================================================================================================
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseStatusAnnotationTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseStatusAnnotationTest.java
index 7aea20e..fae55be 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseStatusAnnotationTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseStatusAnnotationTest.java
@@ -38,6 +38,6 @@ public class ResponseStatusAnnotationTest {
@Test
public void a01() throws Exception {
- a.get("/a01").execute().assertStatus(100);
+ a.get("/a01").run().assertStatus().equals(100);
}
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestMethodBpiTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestMethodBpiTest.java
index 22e9dbc..e913db2 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestMethodBpiTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestMethodBpiTest.java
@@ -61,52 +61,52 @@ public class RestMethodBpiTest {
@Test
public void a01() throws Exception {
- a.get("/a01").json().execute().assertBody("{\"a\":1,\"_b\":\"foo\"}");
- a.get("/a01").xml().execute().assertBodyContains("<object><a>1</a><_b>foo</_b></object>");
- a.get("/a01").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr><tr><td>_b</td><td>foo</td></tr></table>");
- a.get("/a01").uon().execute().assertBody("(a=1,_b=foo)");
- a.get("/a01").urlEnc().execute().assertBody("a=1&_b=foo");
+ a.get("/a01").json().run().assertBody().is("{\"a\":1,\"_b\":\"foo\"}");
+ a.get("/a01").xml().run().assertBody().contains("<object><a>1</a><_b>foo</_b></object>");
+ a.get("/a01").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr><tr><td>_b</td><td>foo</td></tr></table>");
+ a.get("/a01").uon().run().assertBody().is("(a=1,_b=foo)");
+ a.get("/a01").urlEnc().run().assertBody().is("a=1&_b=foo");
}
@Test
public void a02() throws Exception {
- a.get("/a02").json().execute().assertBody("{\"a\":1}");
- a.get("/a02").xml().execute().assertBodyContains("<object><a>1</a></object>");
- a.get("/a02").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr></table>");
- a.get("/a02").uon().execute().assertBody("(a=1)");
- a.get("/a02").urlEnc().execute().assertBody("a=1");
+ a.get("/a02").json().run().assertBody().is("{\"a\":1}");
+ a.get("/a02").xml().run().assertBody().contains("<object><a>1</a></object>");
+ a.get("/a02").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr></table>");
+ a.get("/a02").uon().run().assertBody().is("(a=1)");
+ a.get("/a02").urlEnc().run().assertBody().is("a=1");
}
@Test
public void a03() throws Exception {
- a.get("/a03").json().execute().assertBody("{\"_b\":\"foo\"}");
- a.get("/a03").xml().execute().assertBodyContains("<object><_b>foo</_b></object>");
- a.get("/a03").html().execute().assertBodyContains("<table><tr><td>_b</td><td>foo</td></tr></table>");
- a.get("/a03").uon().execute().assertBody("(_b=foo)");
- a.get("/a03").urlEnc().execute().assertBody("_b=foo");
+ a.get("/a03").json().run().assertBody().is("{\"_b\":\"foo\"}");
+ a.get("/a03").xml().run().assertBody().contains("<object><_b>foo</_b></object>");
+ a.get("/a03").html().run().assertBody().contains("<table><tr><td>_b</td><td>foo</td></tr></table>");
+ a.get("/a03").uon().run().assertBody().is("(_b=foo)");
+ a.get("/a03").urlEnc().run().assertBody().is("_b=foo");
}
@Test
public void a04() throws Exception {
- a.get("/a04").json().execute().assertBody("{\"a\":1,\"_b\":\"foo\"}");
- a.get("/a04").xml().execute().assertBodyContains("<object><a>1</a><_b>foo</_b></object>");
- a.get("/a04").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr><tr><td>_b</td><td>foo</td></tr></table>");
- a.get("/a04").uon().execute().assertBody("(a=1,_b=foo)");
- a.get("/a04").urlEnc().execute().assertBody("a=1&_b=foo");
+ a.get("/a04").json().run().assertBody().is("{\"a\":1,\"_b\":\"foo\"}");
+ a.get("/a04").xml().run().assertBody().contains("<object><a>1</a><_b>foo</_b></object>");
+ a.get("/a04").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr><tr><td>_b</td><td>foo</td></tr></table>");
+ a.get("/a04").uon().run().assertBody().is("(a=1,_b=foo)");
+ a.get("/a04").urlEnc().run().assertBody().is("a=1&_b=foo");
}
@Test
public void a05() throws Exception {
- a.get("/a05").json().execute().assertBody("{\"a\":1}");
- a.get("/a05").xml().execute().assertBodyContains("<object><a>1</a></object>");
- a.get("/a05").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr></table>");
- a.get("/a05").uon().execute().assertBody("(a=1)");
- a.get("/a05").urlEnc().execute().assertBody("a=1");
+ a.get("/a05").json().run().assertBody().is("{\"a\":1}");
+ a.get("/a05").xml().run().assertBody().contains("<object><a>1</a></object>");
+ a.get("/a05").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr></table>");
+ a.get("/a05").uon().run().assertBody().is("(a=1)");
+ a.get("/a05").urlEnc().run().assertBody().is("a=1");
}
@Test
public void a06() throws Exception {
- a.get("/a06").json().execute().assertBody("{\"_b\":\"foo\"}");
- a.get("/a06").xml().execute().assertBodyContains("<object><_b>foo</_b></object>");
- a.get("/a06").html().execute().assertBodyContains("<table><tr><td>_b</td><td>foo</td></tr></table>");
- a.get("/a06").uon().execute().assertBody("(_b=foo)");
- a.get("/a06").urlEnc().execute().assertBody("_b=foo");
+ a.get("/a06").json().run().assertBody().is("{\"_b\":\"foo\"}");
+ a.get("/a06").xml().run().assertBody().contains("<object><_b>foo</_b></object>");
+ a.get("/a06").html().run().assertBody().contains("<table><tr><td>_b</td><td>foo</td></tr></table>");
+ a.get("/a06").uon().run().assertBody().is("(_b=foo)");
+ a.get("/a06").urlEnc().run().assertBody().is("_b=foo");
}
//=================================================================================================================
@@ -148,51 +148,51 @@ public class RestMethodBpiTest {
@Test
public void b01() throws Exception {
- b.get("/b01").json().execute().assertBody("{}");
- b.get("/b01").xml().execute().assertBodyContains("<object/>");
- b.get("/b01").html().execute().assertBodyContains("<table></table>");
- b.get("/b01").uon().execute().assertBody("()");
- b.get("/b01").urlEnc().execute().assertBody("");
+ b.get("/b01").json().run().assertBody().is("{}");
+ b.get("/b01").xml().run().assertBody().contains("<object/>");
+ b.get("/b01").html().run().assertBody().contains("<table></table>");
+ b.get("/b01").uon().run().assertBody().is("()");
+ b.get("/b01").urlEnc().run().assertBody().is("");
}
@Test
public void b02() throws Exception {
- b.get("/b02").json().execute().assertBody("{\"_b\":\"foo\"}");
- b.get("/b02").xml().execute().assertBodyContains("<object><_b>foo</_b></object>");
- b.get("/b02").html().execute().assertBodyContains("<table><tr><td>_b</td><td>foo</td></tr></table>");
- b.get("/b02").uon().execute().assertBody("(_b=foo)");
- b.get("/b02").urlEnc().execute().assertBody("_b=foo");
+ b.get("/b02").json().run().assertBody().is("{\"_b\":\"foo\"}");
+ b.get("/b02").xml().run().assertBody().contains("<object><_b>foo</_b></object>");
+ b.get("/b02").html().run().assertBody().contains("<table><tr><td>_b</td><td>foo</td></tr></table>");
+ b.get("/b02").uon().run().assertBody().is("(_b=foo)");
+ b.get("/b02").urlEnc().run().assertBody().is("_b=foo");
}
@Test
public void b03() throws Exception {
- b.get("/b03").json().execute().assertBody("{\"a\":1}");
- b.get("/b03").xml().execute().assertBodyContains("<object><a>1</a></object>");
- b.get("/b03").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr></table>");
- b.get("/b03").uon().execute().assertBody("(a=1)");
- b.get("/b03").urlEnc().execute().assertBody("a=1");
+ b.get("/b03").json().run().assertBody().is("{\"a\":1}");
+ b.get("/b03").xml().run().assertBody().contains("<object><a>1</a></object>");
+ b.get("/b03").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr></table>");
+ b.get("/b03").uon().run().assertBody().is("(a=1)");
+ b.get("/b03").urlEnc().run().assertBody().is("a=1");
}
@Test
public void b04() throws Exception {
- b.get("/b04").json().execute().assertBody("{}");
- b.get("/b04").xml().execute().assertBodyContains("<object/>");
- b.get("/b04").html().execute().assertBodyContains("<table></table>");
- b.get("/b04").uon().execute().assertBody("()");
- b.get("/b04").urlEnc().execute().assertBody("");
+ b.get("/b04").json().run().assertBody().is("{}");
+ b.get("/b04").xml().run().assertBody().contains("<object/>");
+ b.get("/b04").html().run().assertBody().contains("<table></table>");
+ b.get("/b04").uon().run().assertBody().is("()");
+ b.get("/b04").urlEnc().run().assertBody().is("");
}
@Test
public void b05() throws Exception {
- b.get("/b05").json().execute().assertBody("{\"_b\":\"foo\"}");
- b.get("/b05").xml().execute().assertBodyContains("<object><_b>foo</_b></object>");
- b.get("/b05").html().execute().assertBodyContains("<table><tr><td>_b</td><td>foo</td></tr></table>");
- b.get("/b05").uon().execute().assertBody("(_b=foo)");
- b.get("/b05").urlEnc().execute().assertBody("_b=foo");
+ b.get("/b05").json().run().assertBody().is("{\"_b\":\"foo\"}");
+ b.get("/b05").xml().run().assertBody().contains("<object><_b>foo</_b></object>");
+ b.get("/b05").html().run().assertBody().contains("<table><tr><td>_b</td><td>foo</td></tr></table>");
+ b.get("/b05").uon().run().assertBody().is("(_b=foo)");
+ b.get("/b05").urlEnc().run().assertBody().is("_b=foo");
}
@Test
public void b06() throws Exception {
- b.get("/b06").json().execute().assertBody("{\"a\":1}");
- b.get("/b06").xml().execute().assertBodyContains("<object><a>1</a></object>");
- b.get("/b06").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr></table>");
- b.get("/b06").uon().execute().assertBody("(a=1)");
- b.get("/b06").urlEnc().execute().assertBody("a=1");
+ b.get("/b06").json().run().assertBody().is("{\"a\":1}");
+ b.get("/b06").xml().run().assertBody().contains("<object><a>1</a></object>");
+ b.get("/b06").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr></table>");
+ b.get("/b06").uon().run().assertBody().is("(a=1)");
+ b.get("/b06").urlEnc().run().assertBody().is("a=1");
}
//=================================================================================================================
@@ -234,51 +234,51 @@ public class RestMethodBpiTest {
@Test
public void c01() throws Exception {
- c.get("/c01").json().execute().assertBody("{\"a\":1,\"_b\":\"foo\"}");
- c.get("/c01").xml().execute().assertBodyContains("<object><a>1</a><_b>foo</_b></object>");
- c.get("/c01").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr><tr><td>_b</td><td>foo</td></tr></table>");
- c.get("/c01").uon().execute().assertBody("(a=1,_b=foo)");
- c.get("/c01").urlEnc().execute().assertBody("a=1&_b=foo");
+ c.get("/c01").json().run().assertBody().is("{\"a\":1,\"_b\":\"foo\"}");
+ c.get("/c01").xml().run().assertBody().contains("<object><a>1</a><_b>foo</_b></object>");
+ c.get("/c01").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr><tr><td>_b</td><td>foo</td></tr></table>");
+ c.get("/c01").uon().run().assertBody().is("(a=1,_b=foo)");
+ c.get("/c01").urlEnc().run().assertBody().is("a=1&_b=foo");
}
@Test
public void c02() throws Exception {
- c.get("/c02").json().execute().assertBody("{\"a\":1}");
- c.get("/c02").xml().execute().assertBodyContains("<object><a>1</a></object>");
- c.get("/c02").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr></table>");
- c.get("/c02").uon().execute().assertBody("(a=1)");
- c.get("/c02").urlEnc().execute().assertBody("a=1");
+ c.get("/c02").json().run().assertBody().is("{\"a\":1}");
+ c.get("/c02").xml().run().assertBody().contains("<object><a>1</a></object>");
+ c.get("/c02").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr></table>");
+ c.get("/c02").uon().run().assertBody().is("(a=1)");
+ c.get("/c02").urlEnc().run().assertBody().is("a=1");
}
@Test
public void c03() throws Exception {
- c.get("/c03").json().execute().assertBody("{\"_b\":\"foo\"}");
- c.get("/c03").xml().execute().assertBodyContains("<object><_b>foo</_b></object>");
- c.get("/c03").html().execute().assertBodyContains("<table><tr><td>_b</td><td>foo</td></tr></table>");
- c.get("/c03").uon().execute().assertBody("(_b=foo)");
- c.get("/c03").urlEnc().execute().assertBody("_b=foo");
+ c.get("/c03").json().run().assertBody().is("{\"_b\":\"foo\"}");
+ c.get("/c03").xml().run().assertBody().contains("<object><_b>foo</_b></object>");
+ c.get("/c03").html().run().assertBody().contains("<table><tr><td>_b</td><td>foo</td></tr></table>");
+ c.get("/c03").uon().run().assertBody().is("(_b=foo)");
+ c.get("/c03").urlEnc().run().assertBody().is("_b=foo");
}
@Test
public void c04() throws Exception {
- c.get("/c04").json().execute().assertBody("{\"a\":1,\"_b\":\"foo\"}");
- c.get("/c04").xml().execute().assertBodyContains("<object><a>1</a><_b>foo</_b></object>");
- c.get("/c04").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr><tr><td>_b</td><td>foo</td></tr></table>");
- c.get("/c04").uon().execute().assertBody("(a=1,_b=foo)");
- c.get("/c04").urlEnc().execute().assertBody("a=1&_b=foo");
+ c.get("/c04").json().run().assertBody().is("{\"a\":1,\"_b\":\"foo\"}");
+ c.get("/c04").xml().run().assertBody().contains("<object><a>1</a><_b>foo</_b></object>");
+ c.get("/c04").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr><tr><td>_b</td><td>foo</td></tr></table>");
+ c.get("/c04").uon().run().assertBody().is("(a=1,_b=foo)");
+ c.get("/c04").urlEnc().run().assertBody().is("a=1&_b=foo");
}
@Test
public void c05() throws Exception {
- c.get("/c05").json().execute().assertBody("{\"a\":1}");
- c.get("/c05").xml().execute().assertBodyContains("<object><a>1</a></object>");
- c.get("/c05").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr></table>");
- c.get("/c05").uon().execute().assertBody("(a=1)");
- c.get("/c05").urlEnc().execute().assertBody("a=1");
+ c.get("/c05").json().run().assertBody().is("{\"a\":1}");
+ c.get("/c05").xml().run().assertBody().contains("<object><a>1</a></object>");
+ c.get("/c05").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr></table>");
+ c.get("/c05").uon().run().assertBody().is("(a=1)");
+ c.get("/c05").urlEnc().run().assertBody().is("a=1");
}
@Test
public void c06() throws Exception {
- c.get("/c06").json().execute().assertBody("{\"_b\":\"foo\"}");
- c.get("/c06").xml().execute().assertBodyContains("<object><_b>foo</_b></object>");
- c.get("/c06").html().execute().assertBodyContains("<table><tr><td>_b</td><td>foo</td></tr></table>");
- c.get("/c06").uon().execute().assertBody("(_b=foo)");
- c.get("/c06").urlEnc().execute().assertBody("_b=foo");
+ c.get("/c06").json().run().assertBody().is("{\"_b\":\"foo\"}");
+ c.get("/c06").xml().run().assertBody().contains("<object><_b>foo</_b></object>");
+ c.get("/c06").html().run().assertBody().contains("<table><tr><td>_b</td><td>foo</td></tr></table>");
+ c.get("/c06").uon().run().assertBody().is("(_b=foo)");
+ c.get("/c06").urlEnc().run().assertBody().is("_b=foo");
}
//=================================================================================================================
@@ -320,51 +320,51 @@ public class RestMethodBpiTest {
@Test
public void d01() throws Exception {
- d.get("/d01").json().execute().assertBody("{}");
- d.get("/d01").xml().execute().assertBodyContains("<object/>");
- d.get("/d01").html().execute().assertBodyContains("<table></table>");
- d.get("/d01").uon().execute().assertBody("()");
- d.get("/d01").urlEnc().execute().assertBody("");
+ d.get("/d01").json().run().assertBody().is("{}");
+ d.get("/d01").xml().run().assertBody().contains("<object/>");
+ d.get("/d01").html().run().assertBody().contains("<table></table>");
+ d.get("/d01").uon().run().assertBody().is("()");
+ d.get("/d01").urlEnc().run().assertBody().is("");
}
@Test
public void d02() throws Exception {
- d.get("/d02").json().execute().assertBody("{\"_b\":\"foo\"}");
- d.get("/d02").xml().execute().assertBodyContains("<object><_b>foo</_b></object>");
- d.get("/d02").html().execute().assertBodyContains("<table><tr><td>_b</td><td>foo</td></tr></table>");
- d.get("/d02").uon().execute().assertBody("(_b=foo)");
- d.get("/d02").urlEnc().execute().assertBody("_b=foo");
+ d.get("/d02").json().run().assertBody().is("{\"_b\":\"foo\"}");
+ d.get("/d02").xml().run().assertBody().contains("<object><_b>foo</_b></object>");
+ d.get("/d02").html().run().assertBody().contains("<table><tr><td>_b</td><td>foo</td></tr></table>");
+ d.get("/d02").uon().run().assertBody().is("(_b=foo)");
+ d.get("/d02").urlEnc().run().assertBody().is("_b=foo");
}
@Test
public void d03() throws Exception {
- d.get("/d03").json().execute().assertBody("{\"a\":1}");
- d.get("/d03").xml().execute().assertBodyContains("<object><a>1</a></object>");
- d.get("/d03").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr></table>");
- d.get("/d03").uon().execute().assertBody("(a=1)");
- d.get("/d03").urlEnc().execute().assertBody("a=1");
+ d.get("/d03").json().run().assertBody().is("{\"a\":1}");
+ d.get("/d03").xml().run().assertBody().contains("<object><a>1</a></object>");
+ d.get("/d03").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr></table>");
+ d.get("/d03").uon().run().assertBody().is("(a=1)");
+ d.get("/d03").urlEnc().run().assertBody().is("a=1");
}
@Test
public void d04() throws Exception {
- d.get("/d04").json().execute().assertBody("{}");
- d.get("/d04").xml().execute().assertBodyContains("<object/>");
- d.get("/d04").html().execute().assertBodyContains("<table></table>");
- d.get("/d04").uon().execute().assertBody("()");
- d.get("/d04").urlEnc().execute().assertBody("");
+ d.get("/d04").json().run().assertBody().is("{}");
+ d.get("/d04").xml().run().assertBody().contains("<object/>");
+ d.get("/d04").html().run().assertBody().contains("<table></table>");
+ d.get("/d04").uon().run().assertBody().is("()");
+ d.get("/d04").urlEnc().run().assertBody().is("");
}
@Test
public void d05() throws Exception {
- d.get("/d05").json().execute().assertBody("{\"_b\":\"foo\"}");
- d.get("/d05").xml().execute().assertBodyContains("<object><_b>foo</_b></object>");
- d.get("/d05").html().execute().assertBodyContains("<table><tr><td>_b</td><td>foo</td></tr></table>");
- d.get("/d05").uon().execute().assertBody("(_b=foo)");
- d.get("/d05").urlEnc().execute().assertBody("_b=foo");
+ d.get("/d05").json().run().assertBody().is("{\"_b\":\"foo\"}");
+ d.get("/d05").xml().run().assertBody().contains("<object><_b>foo</_b></object>");
+ d.get("/d05").html().run().assertBody().contains("<table><tr><td>_b</td><td>foo</td></tr></table>");
+ d.get("/d05").uon().run().assertBody().is("(_b=foo)");
+ d.get("/d05").urlEnc().run().assertBody().is("_b=foo");
}
@Test
public void d06() throws Exception {
- d.get("/d06").json().execute().assertBody("{\"a\":1}");
- d.get("/d06").xml().execute().assertBodyContains("<object><a>1</a></object>");
- d.get("/d06").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr></table>");
- d.get("/d06").uon().execute().assertBody("(a=1)");
- d.get("/d06").urlEnc().execute().assertBody("a=1");
+ d.get("/d06").json().run().assertBody().is("{\"a\":1}");
+ d.get("/d06").xml().run().assertBody().contains("<object><a>1</a></object>");
+ d.get("/d06").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr></table>");
+ d.get("/d06").uon().run().assertBody().is("(a=1)");
+ d.get("/d06").urlEnc().run().assertBody().is("a=1");
}
//=================================================================================================================
@@ -388,19 +388,19 @@ public class RestMethodBpiTest {
@Test
public void e01() throws Exception {
- e.get("/e01").json().execute().assertBody("{\"a\":1}");
- e.get("/e01").xml().execute().assertBodyContains("<object><a>1</a></object>");
- e.get("/e01").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr></table>");
- e.get("/e01").uon().execute().assertBody("(a=1)");
- e.get("/e01").urlEnc().execute().assertBody("a=1");
+ e.get("/e01").json().run().assertBody().is("{\"a\":1}");
+ e.get("/e01").xml().run().assertBody().contains("<object><a>1</a></object>");
+ e.get("/e01").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr></table>");
+ e.get("/e01").uon().run().assertBody().is("(a=1)");
+ e.get("/e01").urlEnc().run().assertBody().is("a=1");
}
@Test
public void e02() throws Exception {
- e.get("/e02").json().execute().assertBody("{\"a\":1}");
- e.get("/e02").xml().execute().assertBodyContains("<object><a>1</a></object>");
- e.get("/e02").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr></table>");
- e.get("/e02").uon().execute().assertBody("(a=1)");
- e.get("/e02").urlEnc().execute().assertBody("a=1");
+ e.get("/e02").json().run().assertBody().is("{\"a\":1}");
+ e.get("/e02").xml().run().assertBody().contains("<object><a>1</a></object>");
+ e.get("/e02").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr></table>");
+ e.get("/e02").uon().run().assertBody().is("(a=1)");
+ e.get("/e02").urlEnc().run().assertBody().is("a=1");
}
//=================================================================================================================
@@ -424,19 +424,19 @@ public class RestMethodBpiTest {
@Test
public void f01() throws Exception {
- f.get("/f01").json().execute().assertBody("{\"a\":1}");
- f.get("/f01").xml().execute().assertBodyContains("<object><a>1</a></object>");
- f.get("/f01").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr></table>");
- f.get("/f01").uon().execute().assertBody("(a=1)");
- f.get("/f01").urlEnc().execute().assertBody("a=1");
+ f.get("/f01").json().run().assertBody().is("{\"a\":1}");
+ f.get("/f01").xml().run().assertBody().contains("<object><a>1</a></object>");
+ f.get("/f01").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr></table>");
+ f.get("/f01").uon().run().assertBody().is("(a=1)");
+ f.get("/f01").urlEnc().run().assertBody().is("a=1");
}
@Test
public void f02() throws Exception {
- f.get("/f02").json().execute().assertBody("{\"a\":1}");
- f.get("/f02").xml().execute().assertBodyContains("<object><a>1</a></object>");
- f.get("/f02").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr></table>");
- f.get("/f02").uon().execute().assertBody("(a=1)");
- f.get("/f02").urlEnc().execute().assertBody("a=1");
+ f.get("/f02").json().run().assertBody().is("{\"a\":1}");
+ f.get("/f02").xml().run().assertBody().contains("<object><a>1</a></object>");
+ f.get("/f02").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr></table>");
+ f.get("/f02").uon().run().assertBody().is("(a=1)");
+ f.get("/f02").urlEnc().run().assertBody().is("a=1");
}
//=================================================================================================================
@@ -473,35 +473,35 @@ public class RestMethodBpiTest {
@Test
public void g01() throws Exception {
- g.get("/g01").json().execute().assertBody("{\"a\":1,\"_b\":\"foo\"}");
- g.get("/g01").xml().execute().assertBodyContains("<object><a>1</a><_b>foo</_b></object>");
- g.get("/g01").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr><tr><td>_b</td><td>foo</td></tr></table>");
- g.get("/g01").uon().execute().assertBody("(a=1,_b=foo)");
- g.get("/g01").urlEnc().execute().assertBody("a=1&_b=foo");
+ g.get("/g01").json().run().assertBody().is("{\"a\":1,\"_b\":\"foo\"}");
+ g.get("/g01").xml().run().assertBody().contains("<object><a>1</a><_b>foo</_b></object>");
+ g.get("/g01").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr><tr><td>_b</td><td>foo</td></tr></table>");
+ g.get("/g01").uon().run().assertBody().is("(a=1,_b=foo)");
+ g.get("/g01").urlEnc().run().assertBody().is("a=1&_b=foo");
}
@Test
public void g02() throws Exception {
- g.get("/g02").json().execute().assertBody("{\"a\":1,\"_b\":\"foo\"}");
- g.get("/g02").xml().execute().assertBodyContains("<object><a>1</a><_b>foo</_b></object>");
- g.get("/g02").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr><tr><td>_b</td><td>foo</td></tr></table>");
- g.get("/g02").uon().execute().assertBody("(a=1,_b=foo)");
- g.get("/g02").urlEnc().execute().assertBody("a=1&_b=foo");
+ g.get("/g02").json().run().assertBody().is("{\"a\":1,\"_b\":\"foo\"}");
+ g.get("/g02").xml().run().assertBody().contains("<object><a>1</a><_b>foo</_b></object>");
+ g.get("/g02").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr><tr><td>_b</td><td>foo</td></tr></table>");
+ g.get("/g02").uon().run().assertBody().is("(a=1,_b=foo)");
+ g.get("/g02").urlEnc().run().assertBody().is("a=1&_b=foo");
}
@Test
public void g03() throws Exception {
- g.get("/g03").json().execute().assertBody("{\"a\":1,\"_b\":\"foo\"}");
- g.get("/g03").xml().execute().assertBodyContains("<object><a>1</a><_b>foo</_b></object>");
- g.get("/g03").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr><tr><td>_b</td><td>foo</td></tr></table>");
- g.get("/g03").uon().execute().assertBody("(a=1,_b=foo)");
- g.get("/g03").urlEnc().execute().assertBody("a=1&_b=foo");
+ g.get("/g03").json().run().assertBody().is("{\"a\":1,\"_b\":\"foo\"}");
+ g.get("/g03").xml().run().assertBody().contains("<object><a>1</a><_b>foo</_b></object>");
+ g.get("/g03").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr><tr><td>_b</td><td>foo</td></tr></table>");
+ g.get("/g03").uon().run().assertBody().is("(a=1,_b=foo)");
+ g.get("/g03").urlEnc().run().assertBody().is("a=1&_b=foo");
}
@Test
public void g04() throws Exception {
- g.get("/g04").json().execute().assertBody("{\"a\":1,\"_b\":\"foo\"}");
- g.get("/g04").xml().execute().assertBodyContains("<object><a>1</a><_b>foo</_b></object>");
- g.get("/g04").html().execute().assertBodyContains("<table><tr><td>a</td><td>1</td></tr><tr><td>_b</td><td>foo</td></tr></table>");
- g.get("/g04").uon().execute().assertBody("(a=1,_b=foo)");
- g.get("/g04").urlEnc().execute().assertBody("a=1&_b=foo");
+ g.get("/g04").json().run().assertBody().is("{\"a\":1,\"_b\":\"foo\"}");
+ g.get("/g04").xml().run().assertBody().contains("<object><a>1</a><_b>foo</_b></object>");
+ g.get("/g04").html().run().assertBody().contains("<table><tr><td>a</td><td>1</td></tr><tr><td>_b</td><td>foo</td></tr></table>");
+ g.get("/g04").uon().run().assertBody().is("(a=1,_b=foo)");
+ g.get("/g04").urlEnc().run().assertBody().is("a=1&_b=foo");
}
//=================================================================================================================
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 99871ae..4c7d63f 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
@@ -52,15 +52,15 @@ public class RestMethodGuardsTest {
@Test
public void a01_overlappingOneGuard() throws Exception {
- a.get("/a01?t1=1").execute().assertBody("OK1");
- a.get("/a01?noTrace=true").execute().assertStatus(403).assertBodyContains("Access denied by guard");
+ a.get("/a01?t1=1").run().assertBody().is("OK1");
+ a.get("/a01?noTrace=true").run().assertStatus().equals(403).assertBody().contains("Access denied by guard");
}
@Test
public void a02_overlappingTwoGuards() throws Exception {
- a.get("/a02?noTrace=true").execute().assertStatus(403).assertBodyContains("Access denied by guard");
- a.get("/a02?noTrace=true&t1=1").execute().assertStatus(403).assertBodyContains("Access denied by guard");
- a.get("/a02?noTrace=true&t2=2").execute().assertStatus(403).assertBodyContains("Access denied by guard");
- a.get("/a02?t1=1&t2=2").execute().assertBody("OK2");
+ a.get("/a02?noTrace=true").run().assertStatus().equals(403).assertBody().contains("Access denied by guard");
+ a.get("/a02?noTrace=true&t1=1").run().assertStatus().equals(403).assertBody().contains("Access denied by guard");
+ a.get("/a02?noTrace=true&t2=2").run().assertStatus().equals(403).assertBody().contains("Access denied by guard");
+ a.get("/a02?t1=1&t2=2").run().assertBody().is("OK2");
}
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestMethodMatchersTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestMethodMatchersTest.java
index e6f83b3..1e9656c 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestMethodMatchersTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestMethodMatchersTest.java
@@ -66,15 +66,15 @@ public class RestMethodMatchersTest {
@Test
public void a01() throws Exception {
- a.get("/one?t1=1").execute().assertBody("OK-1a");
- a.get("/one?t2=2").execute().assertBody("OK-1b");
- a.get("/one").execute().assertBody("OK-1c");
+ a.get("/one?t1=1").run().assertBody().is("OK-1a");
+ a.get("/one?t2=2").run().assertBody().is("OK-1b");
+ a.get("/one").run().assertBody().is("OK-1c");
}
@Test
public void a02() throws Exception {
- a.get("/two?t1=1").execute().assertBody("OK-2b");
- a.get("/two?t2=2").execute().assertBody("OK-2b");
- a.get("/two?t1=1&t2=2").execute().assertBody("OK-2b");
- a.get("/two?tx=x").execute().assertBody("OK-2a");
+ a.get("/two?t1=1").run().assertBody().is("OK-2b");
+ a.get("/two?t2=2").run().assertBody().is("OK-2b");
+ a.get("/two?t1=1&t2=2").run().assertBody().is("OK-2b");
+ a.get("/two?tx=x").run().assertBody().is("OK-2a");
}
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestMethodPathTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestMethodPathTest.java
index 4bf6dd9..bb71eee 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestMethodPathTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestMethodPathTest.java
@@ -72,13 +72,13 @@ public class RestMethodPathTest {
// [/{id}/*] = [test5f]
// [/{id}/foo] = [test5g]
// [/{id}/foo/*] = [test5h]
- a.get("/").execute().assertBody("a");
- a.get("/foo").execute().assertBody("c");
- a.get("/foo/x").execute().assertBody("d");
- a.get("/x").execute().assertBody("e");
- a.get("/x/x").execute().assertBody("f");
- a.get("/x/foo").execute().assertBody("g");
- a.get("/x/foo/x").execute().assertBody("h");
+ a.get("/").run().assertBody().is("a");
+ a.get("/foo").run().assertBody().is("c");
+ a.get("/foo/x").run().assertBody().is("d");
+ a.get("/x").run().assertBody().is("e");
+ a.get("/x/x").run().assertBody().is("f");
+ a.get("/x/foo").run().assertBody().is("g");
+ a.get("/x/foo/x").run().assertBody().is("h");
}
//=================================================================================================================
@@ -104,6 +104,6 @@ public class RestMethodPathTest {
@Test
public void b01_pathOverriddenByChild() throws Exception {
- b2.get("/foo").execute().assertBody("b");
+ b2.get("/foo").run().assertBody().is("b");
}
}
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 934920c..0bc69e2 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
@@ -48,7 +48,7 @@ public class RestResourceLoggingTest {
@Test
public void a01_default() throws Exception {
- a.get("/").execute().assertBody("{}");
+ a.get("/").run().assertBody().is("{}");
}
//------------------------------------------------------------------------------------------------------------------
@@ -113,39 +113,39 @@ public class RestResourceLoggingTest {
@Test
public void b01_logging() throws Exception {
- b1.get("/b01").execute().assertBody("{level:'WARNING'}");
+ b1.get("/b01").run().assertBody().is("{level:'WARNING'}");
}
@Test
public void b02_logging() throws Exception {
- b1.get("/b02").execute().assertBody("{level:'SEVERE'}");
+ b1.get("/b02").run().assertBody().is("{level:'SEVERE'}");
}
@Test
public void b03_logging() throws Exception {
- b2.get("/b03").execute().assertBody("{}");
+ b2.get("/b03").run().assertBody().is("{}");
}
@Test
public void b04_logging() throws Exception {
- b2.get("/b04").execute().assertBody("{level:'SEVERE'}");
+ b2.get("/b04").run().assertBody().is("{level:'SEVERE'}");
}
@Test
public void b05_logging() throws Exception {
- b3.get("/b01").execute().assertBody("{level:'WARNING'}");
+ b3.get("/b01").run().assertBody().is("{level:'WARNING'}");
}
@Test
public void b06_logging() throws Exception {
- b3.get("/b02").execute().assertBody("{level:'SEVERE'}");
+ b3.get("/b02").run().assertBody().is("{level:'SEVERE'}");
}
@Test
public void b07_logging() throws Exception {
- b3.get("/b07").execute().assertBody("{level:'OFF'}");
+ b3.get("/b07").run().assertBody().is("{level:'OFF'}");
}
@Test
public void b08_logging() throws Exception {
- b3.get("/b08").execute().assertBody("{level:'WARNING'}");
+ b3.get("/b08").run().assertBody().is("{level:'WARNING'}");
}
@Test
public void b09_logging() throws Exception {
- b3.get("/b09").execute().assertBody("{level:'SEVERE'}");
+ b3.get("/b09").run().assertBody().is("{level:'SEVERE'}");
}
//------------------------------------------------------------------------------------------------------------------
@@ -222,47 +222,47 @@ public class RestResourceLoggingTest {
@Test
public void c01_useStackTraceHashing() throws Exception {
- c1.get("/c01").execute().assertBody("{useStackTraceHashing:true}");
+ c1.get("/c01").run().assertBody().is("{useStackTraceHashing:true}");
}
@Test
public void c02_useStackTraceHashing() throws Exception {
- c1.get("/c02").execute().assertBody("{}");
+ c1.get("/c02").run().assertBody().is("{}");
}
@Test
public void c03_useStackTraceHashing() throws Exception {
- c2.get("/c03").execute().assertBody("{}");
+ c2.get("/c03").run().assertBody().is("{}");
}
@Test
public void c04_useStackTraceHashing() throws Exception {
- c2.get("/c04").execute().assertBody("{useStackTraceHashing:true}");
+ c2.get("/c04").run().assertBody().is("{useStackTraceHashing:true}");
}
@Test
public void c05_useStackTraceHashing() throws Exception {
- c2.get("/c05").execute().assertBody("{}");
+ c2.get("/c05").run().assertBody().is("{}");
}
@Test
public void c06_useStackTraceHashing() throws Exception {
- c3.get("/c01").execute().assertBody("{useStackTraceHashing:true}");
+ c3.get("/c01").run().assertBody().is("{useStackTraceHashing:true}");
}
@Test
public void c07_useStackTraceHashing() throws Exception {
- c3.get("/c02").execute().assertBody("{}");
+ c3.get("/c02").run().assertBody().is("{}");
}
@Test
public void c08_useStackTraceHashing() throws Exception {
- c3.get("/c08").execute().assertBody("{useStackTraceHashing:true}");
+ c3.get("/c08").run().assertBody().is("{useStackTraceHashing:true}");
}
@Test
public void c09_useStackTraceHashing() throws Exception {
- c3.get("/c09").execute().assertBody("{useStackTraceHashing:true}");
+ c3.get("/c09").run().assertBody().is("{useStackTraceHashing:true}");
}
@Test
public void c10_useStackTraceHashing() throws Exception {
- c3.get("/c10").execute().assertBody("{}");
+ c3.get("/c10").run().assertBody().is("{}");
}
@Test
public void c11_useStackTraceHashing() throws Exception {
- c4.get("/c11").execute().assertBody("{}");
+ c4.get("/c11").run().assertBody().is("{}");
}
//------------------------------------------------------------------------------------------------------------------
@@ -327,39 +327,39 @@ public class RestResourceLoggingTest {
@Test
public void d01_stackTraceHashingTimeout() throws Exception {
- d1.get("/d01").execute().assertBody("{stackTraceHashingTimeout:1}");
+ d1.get("/d01").run().assertBody().is("{stackTraceHashingTimeout:1}");
}
@Test
public void d02_stackTraceHashingTimeout() throws Exception {
- d1.get("/d02").execute().assertBody("{stackTraceHashingTimeout:2}");
+ d1.get("/d02").run().assertBody().is("{stackTraceHashingTimeout:2}");
}
@Test
public void d03_stackTraceHashingTimeout() throws Exception {
- d2.get("/d03").execute().assertBody("{}");
+ d2.get("/d03").run().assertBody().is("{}");
}
@Test
public void d04_stackTraceHashingTimeout() throws Exception {
- d2.get("/d04").execute().assertBody("{stackTraceHashingTimeout:4}");
+ d2.get("/d04").run().assertBody().is("{stackTraceHashingTimeout:4}");
}
@Test
public void d05_stackTraceHashingTimeout() throws Exception {
- d3.get("/d01").execute().assertBody("{stackTraceHashingTimeout:1}");
+ d3.get("/d01").run().assertBody().is("{stackTraceHashingTimeout:1}");
}
@Test
public void d06_stackTraceHashingTimeout() throws Exception {
- d3.get("/d02").execute().assertBody("{stackTraceHashingTimeout:2}");
+ d3.get("/d02").run().assertBody().is("{stackTraceHashingTimeout:2}");
}
@Test
public void d07_stackTraceHashingTimeout() throws Exception {
- d3.get("/d07").execute().assertBody("{stackTraceHashingTimeout:5}");
+ d3.get("/d07").run().assertBody().is("{stackTraceHashingTimeout:5}");
}
@Test
public void d08_stackTraceHashingTimeout() throws Exception {
- d3.get("/d08").execute().assertBody("{stackTraceHashingTimeout:1}");
+ d3.get("/d08").run().assertBody().is("{stackTraceHashingTimeout:1}");
}
@Test
public void d09_stackTraceHashingTimeout() throws Exception {
- d3.get("/d09").execute().assertBody("{stackTraceHashingTimeout:6}");
+ d3.get("/d09").run().assertBody().is("{stackTraceHashingTimeout:6}");
}
//------------------------------------------------------------------------------------------------------------------
@@ -436,47 +436,47 @@ public class RestResourceLoggingTest {
@Test
public void e01_noTrace() throws Exception {
- e1.get("/e01").execute().assertBody("{disabled:'TRUE'}");
+ e1.get("/e01").run().assertBody().is("{disabled:'TRUE'}");
}
@Test
public void e02_noTrace() throws Exception {
- e1.get("/e02").execute().assertBody("{disabled:'PER_REQUEST'}");
+ e1.get("/e02").run().assertBody().is("{disabled:'PER_REQUEST'}");
}
@Test
public void e03_noTrace() throws Exception {
- e2.get("/e03").execute().assertBody("{}");
+ e2.get("/e03").run().assertBody().is("{}");
}
@Test
public void e04_noTrace() throws Exception {
- e2.get("/e04").execute().assertBody("{disabled:'TRUE'}");
+ e2.get("/e04").run().assertBody().is("{disabled:'TRUE'}");
}
@Test
public void e05_noTrace() throws Exception {
- e2.get("/e05").execute().assertBody("{}");
+ e2.get("/e05").run().assertBody().is("{}");
}
@Test
public void e06_noTrace() throws Exception {
- e3.get("/e01").execute().assertBody("{disabled:'TRUE'}");
+ e3.get("/e01").run().assertBody().is("{disabled:'TRUE'}");
}
@Test
public void e07_noTrace() throws Exception {
- e3.get("/e02").execute().assertBody("{disabled:'PER_REQUEST'}");
+ e3.get("/e02").run().assertBody().is("{disabled:'PER_REQUEST'}");
}
@Test
public void e08_noTrace() throws Exception {
- e3.get("/e08").execute().assertBody("{}");
+ e3.get("/e08").run().assertBody().is("{}");
}
@Test
public void e09_noTrace() throws Exception {
- e3.get("/e09").execute().assertBody("{disabled:'TRUE'}");
+ e3.get("/e09").run().assertBody().is("{disabled:'TRUE'}");
}
@Test
public void e10_noTrace() throws Exception {
- e3.get("/e10").execute().assertBody("{disabled:'PER_REQUEST'}");
+ e3.get("/e10").run().assertBody().is("{disabled:'PER_REQUEST'}");
}
@Test
public void e11_noTrace() throws Exception {
- e4.get("/e11").execute().assertBody("{}");
+ e4.get("/e11").run().assertBody().is("{}");
}
//------------------------------------------------------------------------------------------------------------------
@@ -541,39 +541,39 @@ public class RestResourceLoggingTest {
@Test
public void f01_rules() throws Exception {
- f1.get("/f01").execute().assertBody("{codes:'1'}");
+ f1.get("/f01").run().assertBody().is("{codes:'1'}");
}
@Test
public void f02_rules() throws Exception {
- f1.get("/f02").execute().assertBody("{codes:'2'},{codes:'1'}");
+ f1.get("/f02").run().assertBody().is("{codes:'2'},{codes:'1'}");
}
@Test
public void f03_rules() throws Exception {
- f2.get("/f03").execute().assertBody("");
+ f2.get("/f03").run().assertBody().is("");
}
@Test
public void f04_rules() throws Exception {
- f2.get("/f04").execute().assertBody("{codes:'4'}");
+ f2.get("/f04").run().assertBody().is("{codes:'4'}");
}
@Test
public void f05_rules() throws Exception {
- f3.get("/f01").execute().assertBody("{codes:'1'}");
+ f3.get("/f01").run().assertBody().is("{codes:'1'}");
}
@Test
public void f06_rules() throws Exception {
- f3.get("/f02").execute().assertBody("{codes:'2'},{codes:'1'}");
+ f3.get("/f02").run().assertBody().is("{codes:'2'},{codes:'1'}");
}
@Test
public void f07_rules() throws Exception {
- f3.get("/f07").execute().assertBody("{codes:'5'},{codes:'3'},{codes:'1'}");
+ f3.get("/f07").run().assertBody().is("{codes:'5'},{codes:'3'},{codes:'1'}");
}
@Test
public void f08_rules() throws Exception {
- f3.get("/f08").execute().assertBody("{codes:'1'}");
+ f3.get("/f08").run().assertBody().is("{codes:'1'}");
}
@Test
public void f09_rules() throws Exception {
- f3.get("/f09").execute().assertBody("{codes:'6'},{codes:'1'}");
+ f3.get("/f09").run().assertBody().is("{codes:'6'},{codes:'1'}");
}
//------------------------------------------------------------------------------------------------------------------
@@ -634,15 +634,15 @@ public class RestResourceLoggingTest {
@Test
public void g01_rules() throws Exception {
- g1.get("/g01").execute().assertBody("{exceptions:'1',debugOnly:true,level:'WARNING',req:'MEDIUM'}");
+ g1.get("/g01").run().assertBody().is("{exceptions:'1',debugOnly:true,level:'WARNING',req:'MEDIUM'}");
}
@Test
public void g02_rules() throws Exception {
- g1.get("/g02").execute().assertBody("{exceptions:'2',debugOnly:true,level:'WARNING',req:'MEDIUM'},{exceptions:'1',debugOnly:true,level:'WARNING',req:'MEDIUM'}");
+ g1.get("/g02").run().assertBody().is("{exceptions:'2',debugOnly:true,level:'WARNING',req:'MEDIUM'},{exceptions:'1',debugOnly:true,level:'WARNING',req:'MEDIUM'}");
}
@Test
public void g03_rules() throws Exception {
- g2.get("/g03").execute().assertBody("{exceptions:'3',debugOnly:true,level:'WARNING',req:'MEDIUM'}");
+ g2.get("/g03").run().assertBody().is("{exceptions:'3',debugOnly:true,level:'WARNING',req:'MEDIUM'}");
}
//------------------------------------------------------------------------------------------------------------------
@@ -673,7 +673,7 @@ public class RestResourceLoggingTest {
@Test
public void test() throws Exception {
- MY_REST.post("/foo?foo=bar", "Foo").header("Foo", "bar").execute().assertStatus(500);
- MY_REST.post("/foo?foo=bar", "Foo").header("Foo", "bar").execute().assertStatus(500);
+ MY_REST.post("/foo?foo=bar", "Foo").header("Foo", "bar").run().assertStatus().equals(500);
+ MY_REST.post("/foo?foo=bar", "Foo").header("Foo", "bar").run().assertStatus().equals(500);
}
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceMessagesTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceMessagesTest.java
index fc6465c..e1db343 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceMessagesTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceMessagesTest.java
@@ -50,7 +50,7 @@ public class RestResourceMessagesTest {
@Test
public void a01() throws Exception {
// Parent resource should just pick up values from its bundle.
- a.get("/a01").execute().assertBody("{key1:'value1a',key2:'value2a'}");
+ a.get("/a01").run().assertBody().is("{key1:'value1a',key2:'value2a'}");
}
//====================================================================================================
@@ -65,6 +65,6 @@ public class RestResourceMessagesTest {
public void b01() throws Exception {
// Child resource should pick up values from both parent and child,
// ordered child before parent.
- b.get("/a01").execute().assertBody("{key1:'value1a',key2:'value2b',key3:'value3b'}");
+ b.get("/a01").run().assertBody().is("{key1:'value1a',key2:'value2b',key3:'value3b'}");
}
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourcePathTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourcePathTest.java
index 17ff800..f197e5f 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourcePathTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourcePathTest.java
@@ -55,8 +55,8 @@ public class RestResourcePathTest {
public void a01_nestedChildren() throws Exception {
// Since we're not running from a servlet container, we access A directly with no path.
// However, the path is still reflected in RestContext.getPath().
- a.get("/").execute().assertBody("A-p0");
- a.get("/p1").execute().assertBody("A01-p0/p1");
- a.get("/p1/p2").execute().assertBody("A02a-p0/p1/p2");
+ a.get("/").run().assertBody().is("A-p0");
+ a.get("/p1").run().assertBody().is("A01-p0/p1");
+ a.get("/p1/p2").run().assertBody().is("A02a-p0/p1/p2");
}
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourcePropertiesTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourcePropertiesTest.java
index ac29d45..40d4b4d 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourcePropertiesTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourcePropertiesTest.java
@@ -81,6 +81,6 @@ public class RestResourcePropertiesTest {
@Test
public void a01() throws Exception {
- a.get("/p2").accept("text/plain").execute().assertBody("A1=a1,A2=c,B1=b1,B2=c,C=c,R1a=/p2,R1b=/,R2=bar,R3=,R4=a1,R5=c,R6=c");
+ a.get("/p2").accept("text/plain").run().assertBody().is("A1=a1,A2=c,B1=b1,B2=c,C=c,R1a=/p2,R1b=/,R2=bar,R3=,R4=a1,R5=c,R6=c");
}
}
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 72bbf2c..a0138ac 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
@@ -121,38 +121,38 @@ public class RestResourceSerializersTest {
@Test
public void a01_serializerOnClass() throws Exception {
- a.get("/a01").accept("text/a").execute().assertBody("text/a - test1");
- a.get("/a01?noTrace=true").accept("text/b").execute()
- .assertStatus(406)
- .assertBodyContains(
+ a.get("/a01").accept("text/a").run().assertBody().is("text/a - test1");
+ a.get("/a01?noTrace=true").accept("text/b").run()
+ .assertStatus().equals(406)
+ .assertBody().contains(
"Unsupported media-type in request header 'Accept': 'text/b'",
"Supported media-types: ['text/a'"
);
}
@Test
public void a02_serializerOnMethod() throws Exception {
- a.get("/a02?noTrace=true").accept("text/a").execute()
- .assertStatus(406)
- .assertBodyContains(
+ a.get("/a02?noTrace=true").accept("text/a").run()
+ .assertStatus().equals(406)
+ .assertBody().contains(
"Unsupported media-type in request header 'Accept': 'text/a'",
"Supported media-types: ['text/b']"
);
}
@Test
public void a03_serializerOverriddenOnMethod() throws Exception {
- a.get("/a03").accept("text/a").execute().assertBody("text/c - test3");
- a.get("/a03").accept("text/b").execute().assertBody("text/b - test3");
+ a.get("/a03").accept("text/a").run().assertBody().is("text/c - test3");
+ a.get("/a03").accept("text/b").run().assertBody().is("text/b - test3");
}
@Test
public void a04_serializerWithDifferentMediaTypes() throws Exception {
- a.get("/a04").accept("text/a").execute().assertBody("text/d - test4");
- a.get("/a04").accept("text/d").execute().assertBody("text/d - test4");
+ a.get("/a04").accept("text/a").run().assertBody().is("text/d - test4");
+ a.get("/a04").accept("text/d").run().assertBody().is("text/d - test4");
}
@Test
public void a05_validErrorResponse() throws Exception {
- a.get("/a05?noTrace=true").accept("text/bad").execute()
- .assertStatus(406)
- .assertBodyContains(
+ a.get("/a05?noTrace=true").accept("text/bad").run()
+ .assertStatus().equals(406)
+ .assertBody().contains(
"Unsupported media-type in request header 'Accept': 'text/bad'",
"Supported media-types: ['text/a"
);
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 e4dec9e..57bbe15 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
@@ -35,13 +35,13 @@ public class RestResourceStaticFilesTest {
@Test
public void a01a() throws Exception {
- a1.get("/xdocs/test.txt").execute().assertBodyContains("OK-1");
- a1.get("/xdocs/xsubdocs/test.txt").execute().assertBodyContains("OK-2");
+ a1.get("/xdocs/test.txt").run().assertBody().contains("OK-1");
+ a1.get("/xdocs/xsubdocs/test.txt").run().assertBody().contains("OK-2");
}
@Test
public void a01b_preventPathTraversals() throws Exception {
- a1.get("/xdocs/xsubdocs/../test.txt?noTrace=true").execute().assertStatus(404);
- a1.get("/xdocs/xsubdocs/%2E%2E/test.txt?noTrace=true").execute().assertStatus(404);
+ a1.get("/xdocs/xsubdocs/../test.txt?noTrace=true").run().assertStatus().equals(404);
+ a1.get("/xdocs/xsubdocs/%2E%2E/test.txt?noTrace=true").run().assertStatus().equals(404);
}
@Rest(staticFiles={"xdocs2:xdocs2:{Foo:'Bar',Baz:'Qux'},xdocs:xdocs"})
@@ -55,13 +55,13 @@ public class RestResourceStaticFilesTest {
@Test
public void a02a() throws Exception {
- a1.get("/xdocs/test.txt").execute().assertBodyContains("OK-1");
- a1.get("/xdocs/xsubdocs/test.txt").execute().assertBodyContains("OK-2");
+ a1.get("/xdocs/test.txt").run().assertBody().contains("OK-1");
+ a1.get("/xdocs/xsubdocs/test.txt").run().assertBody().contains("OK-2");
}
@Test
public void a02b_preventPathTraversals() throws Exception {
- a1.get("/xdocs/xsubdocs/../test.txt?noTrace=true").execute().assertStatus(404);
- a1.get("/xdocs/xsubdocs/%2E%2E/test.txt?noTrace=true").execute().assertStatus(404);
+ a1.get("/xdocs/xsubdocs/../test.txt?noTrace=true").run().assertStatus().equals(404);
+ a1.get("/xdocs/xsubdocs/%2E%2E/test.txt?noTrace=true").run().assertStatus().equals(404);
}
//------------------------------------------------------------------------------------------------------------------
@@ -79,7 +79,7 @@ public class RestResourceStaticFilesTest {
@Test
public void b01() throws Exception {
- b.get("/xdocs/test.txt").execute().assertHeader("Foo","Bar").assertHeader("Baz","Qux").assertBodyContains("OK-1");
+ b.get("/xdocs/test.txt").run().assertHeader("Foo").is("Bar").assertHeader("Baz").is("Qux").assertBody().contains("OK-1");
}
//------------------------------------------------------------------------------------------------------------------
@@ -108,18 +108,18 @@ public class RestResourceStaticFilesTest {
@Test
public void c01() throws Exception {
// Should resolve to relative xdocs folder.
- c1.get("/xdocs/test.txt").execute().assertBodyContains("OK-1");
- c1.get("/xdocs/xsubdocs/test.txt").execute().assertBodyContains("OK-2");
+ c1.get("/xdocs/test.txt").run().assertBody().contains("OK-1");
+ c1.get("/xdocs/xsubdocs/test.txt").run().assertBody().contains("OK-2");
// Should be overridden to absolute xdocs folder.
- c2.get("/xdocs/test.txt").execute().assertBodyContains("OK-3");
- c2.get("/xdocs/xsubdocs/test.txt").execute().assertBodyContains("OK-4");
+ c2.get("/xdocs/test.txt").run().assertBody().contains("OK-3");
+ c2.get("/xdocs/xsubdocs/test.txt").run().assertBody().contains("OK-4");
// Should pick up from file system.
- c1.get("/xdocs/test2.txt").execute().assertBodyContains("OK-5");
- c2.get("/xdocs/test2.txt").execute().assertBodyContains("OK-5");
- c1.get("/xdocs/xsubdocs/test2.txt").execute().assertBodyContains("OK-6");
- c2.get("/xdocs/xsubdocs/test2.txt").execute().assertBodyContains("OK-6");
+ c1.get("/xdocs/test2.txt").run().assertBody().contains("OK-5");
+ c2.get("/xdocs/test2.txt").run().assertBody().contains("OK-5");
+ c1.get("/xdocs/xsubdocs/test2.txt").run().assertBody().contains("OK-6");
+ c2.get("/xdocs/xsubdocs/test2.txt").run().assertBody().contains("OK-6");
}
//------------------------------------------------------------------------------------------------------------------
@@ -139,12 +139,12 @@ public class RestResourceStaticFilesTest {
@Test
public void d01() throws Exception {
// Should be overridden to absolute xdocs folder.
- d.get("/xdocs/test.txt").execute().assertBodyContains("OK-3");
- d.get("/xdocs/xsubdocs/test.txt").execute().assertBodyContains("OK-4");
+ d.get("/xdocs/test.txt").run().assertBody().contains("OK-3");
+ d.get("/xdocs/xsubdocs/test.txt").run().assertBody().contains("OK-4");
// Should pick up from file system.
- d.get("/xdocs/test2.txt").execute().assertBodyContains("OK-5");
- d.get("/xdocs/xsubdocs/test2.txt").execute().assertBodyContains("OK-6");
+ d.get("/xdocs/test2.txt").run().assertBody().contains("OK-5");
+ d.get("/xdocs/xsubdocs/test2.txt").run().assertBody().contains("OK-6");
}
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceTest.java
index 5342ced..95bb416 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation/RestResourceTest.java
@@ -54,26 +54,26 @@ public class RestResourceTest {
@Test
public void a01_allowBodyParam_true() throws Exception {
- a1.put("/", "{a:'b'}").execute().assertBody("{a:'b'}");
- a1.put("/?body=(c=d)", "{a:'b'}").execute().assertBody("{c:'d'}");
+ a1.put("/", "{a:'b'}").run().assertBody().is("{a:'b'}");
+ a1.put("/?body=(c=d)", "{a:'b'}").run().assertBody().is("{c:'d'}");
}
@Test
public void a02_allowBodyParam_false() throws Exception {
- a2.put("/", "{a:'b'}").execute().assertBody("{a:'b'}");
- a2.put("/?body=(c=d)", "{a:'b'}").execute().assertBody("{a:'b'}");
+ a2.put("/", "{a:'b'}").run().assertBody().is("{a:'b'}");
+ a2.put("/?body=(c=d)", "{a:'b'}").run().assertBody().is("{a:'b'}");
}
@Test
public void a03_allowBodyParam_overridden_false() throws Exception {
- a3.put("/", "{a:'b'}").execute().assertBody("{a:'b'}");
- a3.put("/?body=(c=d)", "{a:'b'}").execute().assertBody("{a:'b'}");
+ a3.put("/", "{a:'b'}").run().assertBody().is("{a:'b'}");
+ a3.put("/?body=(c=d)", "{a:'b'}").run().assertBody().is("{a:'b'}");
}
@Test
public void a04_allowBodyParam_overridden_true() throws Exception {
- a4.put("/", "{a:'b'}").execute().assertBody("{a:'b'}");
- a4.put("/?body=(c=d)", "{a:'b'}").execute().assertBody("{c:'d'}");
+ a4.put("/", "{a:'b'}").run().assertBody().is("{a:'b'}");
+ a4.put("/?body=(c=d)", "{a:'b'}").run().assertBody().is("{c:'d'}");
}
//====================================================================================================
@@ -122,58 +122,58 @@ public class RestResourceTest {
@Test
public void b01_allowedHeaderParams_default() throws Exception {
- b1.put("/", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
- b1.put("/?Accept=text/plain%2Bbar1&Content-Type=text/plain%2Bbar2&Custom=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+bar1,Content-Type=text/plain+bar2,Custom=foo3");
- b1.put("/?ACCEPT=text/plain%2Bbar1&CONTENT-TYPE=text/plain%2Bbar2&CUSTOM=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+bar1,Content-Type=text/plain+bar2,Custom=foo3");
+ b1.put("/", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
+ b1.put("/?Accept=text/plain%2Bbar1&Content-Type=text/plain%2Bbar2&Custom=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+bar1,Content-Type=text/plain+bar2,Custom=foo3");
+ b1.put("/?ACCEPT=text/plain%2Bbar1&CONTENT-TYPE=text/plain%2Bbar2&CUSTOM=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+bar1,Content-Type=text/plain+bar2,Custom=foo3");
}
@Test
public void b02_allowedHeaderParams_defaultExplicit() throws Exception {
- b2.put("/", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
- b2.put("/?Accept=text/plain%2Bbar1&Content-Type=text/plain%2Bbar2&Custom=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+bar1,Content-Type=text/plain+bar2,Custom=foo3");
- b2.put("/?ACCEPT=text/plain%2Bbar1&CONTENT-TYPE=text/plain%2Bbar2&CUSTOM=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+bar1,Content-Type=text/plain+bar2,Custom=foo3");
+ b2.put("/", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
+ b2.put("/?Accept=text/plain%2Bbar1&Content-Type=text/plain%2Bbar2&Custom=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+bar1,Content-Type=text/plain+bar2,Custom=foo3");
+ b2.put("/?ACCEPT=text/plain%2Bbar1&CONTENT-TYPE=text/plain%2Bbar2&CUSTOM=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+bar1,Content-Type=text/plain+bar2,Custom=foo3");
}
@Test
public void b03_allowedHeaderParams_caseSensitivity() throws Exception {
- b3.put("/", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
- b3.put("/?Accept=text/plain%2Bbar1&Content-Type=text/plain%2Bbar2&Custom=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+bar1,Content-Type=text/plain+bar2,Custom=foo3");
- b3.put("/?ACCEPT=text/plain%2Bbar1&CONTENT-TYPE=text/plain%2Bbar2&CUSTOM=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+bar1,Content-Type=text/plain+bar2,Custom=foo3");
+ b3.put("/", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
+ b3.put("/?Accept=text/plain%2Bbar1&Content-Type=text/plain%2Bbar2&Custom=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+bar1,Content-Type=text/plain+bar2,Custom=foo3");
+ b3.put("/?ACCEPT=text/plain%2Bbar1&CONTENT-TYPE=text/plain%2Bbar2&CUSTOM=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+bar1,Content-Type=text/plain+bar2,Custom=foo3");
}
@Test
public void b04_allowedHeaderParams_customHeaderOnly() throws Exception {
- b4.put("/", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
- b4.put("/?Accept=text/plain%2Bbar1&Content-Type=text/plain%2Bbar2&Custom=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=bar3");
- b4.put("/?ACCEPT=text/plain%2Bbar1&CONTENT-TYPE=text/plain%2Bbar2&CUSTOM=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=bar3");
+ b4.put("/", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
+ b4.put("/?Accept=text/plain%2Bbar1&Content-Type=text/plain%2Bbar2&Custom=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=bar3");
+ b4.put("/?ACCEPT=text/plain%2Bbar1&CONTENT-TYPE=text/plain%2Bbar2&CUSTOM=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=bar3");
}
@Test
public void b05_allowedHeaderParams_allHeaders() throws Exception {
- b5.put("/", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
- b5.put("/?Accept=text/plain%2Bbar1&Content-Type=text/plain%2Bbar2&Custom=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+bar1,Content-Type=text/plain+bar2,Custom=bar3");
- b5.put("/?ACCEPT=text/plain%2Bbar1&CONTENT-TYPE=text/plain%2Bbar2&CUSTOM=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+bar1,Content-Type=text/plain+bar2,Custom=bar3");
+ b5.put("/", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
+ b5.put("/?Accept=text/plain%2Bbar1&Content-Type=text/plain%2Bbar2&Custom=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+bar1,Content-Type=text/plain+bar2,Custom=bar3");
+ b5.put("/?ACCEPT=text/plain%2Bbar1&CONTENT-TYPE=text/plain%2Bbar2&CUSTOM=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+bar1,Content-Type=text/plain+bar2,Custom=bar3");
}
@Test
public void b06_allowedHeaderParams_none() throws Exception {
- b6.put("/", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
- b6.put("/?Accept=text/plain%2Bbar1&Content-Type=text/plain%2Bbar2&Custom=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
- b6.put("/?ACCEPT=text/plain%2Bbar1&CONTENT-TYPE=text/plain%2Bbar2&CUSTOM=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
+ b6.put("/", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
+ b6.put("/?Accept=text/plain%2Bbar1&Content-Type=text/plain%2Bbar2&Custom=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
+ b6.put("/?ACCEPT=text/plain%2Bbar1&CONTENT-TYPE=text/plain%2Bbar2&CUSTOM=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
}
@Test
public void b07_allowedHeaderParams_none_caseSensitivity() throws Exception {
- b7.put("/", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
- b7.put("/?Accept=text/plain%2Bbar1&Content-Type=text/plain%2Bbar2&Custom=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
- b7.put("/?ACCEPT=text/plain%2Bbar1&CONTENT-TYPE=text/plain%2Bbar2&CUSTOM=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
+ b7.put("/", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
+ b7.put("/?Accept=text/plain%2Bbar1&Content-Type=text/plain%2Bbar2&Custom=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
+ b7.put("/?ACCEPT=text/plain%2Bbar1&CONTENT-TYPE=text/plain%2Bbar2&CUSTOM=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
}
@Test
public void b08_allowedHeaderParams_none_overridingParent() throws Exception {
- b8.put("/", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
- b8.put("/?Accept=text/plain%2Bbar1&Content-Type=text/plain%2Bbar2&Custom=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
- b8.put("/?ACCEPT=text/plain%2Bbar1&CONTENT-TYPE=text/plain%2Bbar2&CUSTOM=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").execute().assertBody("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
+ b8.put("/", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
+ b8.put("/?Accept=text/plain%2Bbar1&Content-Type=text/plain%2Bbar2&Custom=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
+ b8.put("/?ACCEPT=text/plain%2Bbar1&CONTENT-TYPE=text/plain%2Bbar2&CUSTOM=bar3", "").accept("text/plain+foo1").contentType("text/plain+foo2").header("Custom", "foo3").run().assertBody().is("Accept=text/plain+foo1,Content-Type=text/plain+foo2,Custom=foo3");
}
//====================================================================================================
@@ -230,86 +230,86 @@ public class RestResourceTest {
@Test
public void c01_allowedMethodHeaders_default() throws Exception {
- c1.get("/").execute().assertBody("GET");
- c1.put("/", "").execute().assertBody("PUT");
- c1.get("/").header("X-Method", "PUT").execute().assertBody("GET");
- c1.put("/", "").header("X-Method", "GET").execute().assertBody("PUT");
- c1.request("GET","/",null,"").header("X-Method","FOO").execute().assertBody("GET");
+ c1.get("/").run().assertBody().is("GET");
+ c1.put("/", "").run().assertBody().is("PUT");
+ c1.get("/").header("X-Method", "PUT").run().assertBody().is("GET");
+ c1.put("/", "").header("X-Method", "GET").run().assertBody().is("PUT");
+ c1.request("GET","/",null,"").header("X-Method","FOO").run().assertBody().is("GET");
}
@Test
public void c02_allowedMethodHeaders_GET_only() throws Exception {
- c2.get("/").execute().assertBody("GET");
- c2.put("/", "").execute().assertBody("PUT");
- c2.get("/").header("X-Method", "PUT").execute().assertBody("GET");
- c2.put("/", "").header("X-Method", "GET").execute().assertBody("GET");
- c2.request("GET","/",null,"").header("X-Method","FOO").execute().assertBody("GET");
+ c2.get("/").run().assertBody().is("GET");
+ c2.put("/", "").run().assertBody().is("PUT");
+ c2.get("/").header("X-Method", "PUT").run().assertBody().is("GET");
+ c2.put("/", "").header("X-Method", "GET").run().assertBody().is("GET");
+ c2.request("GET","/",null,"").header("X-Method","FOO").run().assertBody().is("GET");
}
@Test
public void c03_allowedMethodHeaders_GET_caseSensitivity() throws Exception {
- c3.get("/").execute().assertBody("GET");
- c3.put("/", "").execute().assertBody("PUT");
- c3.get("/").header("X-Method", "PUT").execute().assertBody("GET");
- c3.put("/", "").header("X-Method", "GET").execute().assertBody("GET");
- c3.request("GET","/",null,"").header("X-Method","FOO").execute().assertBody("GET");
+ c3.get("/").run().assertBody().is("GET");
+ c3.put("/", "").run().assertBody().is("PUT");
+ c3.get("/").header("X-Method", "PUT").run().assertBody().is("GET");
+ c3.put("/", "").header("X-Method", "GET").run().assertBody().is("GET");
+ c3.request("GET","/",null,"").header("X-Method","FOO").run().assertBody().is("GET");
}
@Test
public void c04_allowedMethodHeaders_FOO_only() throws Exception {
- c4.get("/").execute().assertBody("GET");
- c4.put("/", "").execute().assertBody("PUT");
- c4.get("/").header("X-Method", "PUT").execute().assertBody("GET");
- c4.put("/", "").header("X-Method", "GET").execute().assertBody("PUT");
- c4.request("GET","/",null,"").header("X-Method","FOO").execute().assertBody("FOO");
+ c4.get("/").run().assertBody().is("GET");
+ c4.put("/", "").run().assertBody().is("PUT");
+ c4.get("/").header("X-Method", "PUT").run().assertBody().is("GET");
+ c4.put("/", "").header("X-Method", "GET").run().assertBody().is("PUT");
+ c4.request("GET","/",null,"").header("X-Method","FOO").run().assertBody().is("FOO");
}
@Test
public void c05_allowedMethodHeaders_allMethods() throws Exception {
- c5.get("/").execute().assertBody("GET");
- c5.put("/", "").execute().assertBody("PUT");
- c5.get("/").header("X-Method", "PUT").execute().assertBody("PUT");
- c5.put("/", "").header("X-Method", "GET").execute().assertBody("GET");
- c5.request("GET","/",null,"").header("X-Method","FOO").execute().assertBody("FOO");
+ c5.get("/").run().assertBody().is("GET");
+ c5.put("/", "").run().assertBody().is("PUT");
+ c5.get("/").header("X-Method", "PUT").run().assertBody().is("PUT");
+ c5.put("/", "").header("X-Method", "GET").run().assertBody().is("GET");
+ c5.request("GET","/",null,"").header("X-Method","FOO").run().assertBody().is("FOO");
}
@Test
public void c06_allowedMethodHeaders_none() throws Exception {
- c6.get("/").execute().assertBody("GET");
- c6.put("/", "").execute().assertBody("PUT");
- c6.get("/").header("X-Method", "PUT").execute().assertBody("GET");
- c6.put("/", "").header("X-Method", "GET").execute().assertBody("PUT");
- c6.request("GET","/",null,"").header("X-Method","FOO").execute().assertBody("GET");
+ c6.get("/").run().assertBody().is("GET");
+ c6.put("/", "").run().assertBody().is("PUT");
+ c6.get("/").header("X-Method", "PUT").run().assertBody().is("GET");
+ c6.put("/", "").header("X-Method", "GET").run().assertBody().is("PUT");
+ c6.request("GET","/",null,"").header("X-Method","FOO").run().assertBody().is("GET");
}
@Test
public void c07_allowedMethodHeaders_none_caseSensitivity() throws Exception {
- c7.get("/").execute().assertBody("GET");
- c7.put("/", "").execute().assertBody("PUT");
- c7.get("/").header("X-Method", "PUT").execute().assertBody("GET");
- c7.put("/", "").header("X-Method", "GET").execute().assertBody("PUT");
- c7.request("GET","/",null,"").header("X-Method","FOO").execute().assertBody("GET");
+ c7.get("/").run().assertBody().is("GET");
+ c7.put("/", "").run().assertBody().is("PUT");
+ c7.get("/").header("X-Method", "PUT").run().assertBody().is("GET");
+ c7.put("/", "").header("X-Method", "GET").run().assertBody().is("PUT");
+ c7.request("GET","/",null,"").header("X-Method","FOO").run().assertBody().is("GET");
}
@Test
public void c08_allowedMethodHeaders_none_overridingParent() throws Exception {
- c8.get("/").execute().assertBody("GET");
- c8.put("/", "").execute().assertBody("PUT");
- c8.get("/").header("X-Method", "PUT").execute().assertBody("GET");
- c8.put("/", "").header("X-Method", "GET").execute().assertBody("PUT");
- c8.request("GET","/",null,"").header("X-Method","FOO").execute().assertBody("GET");
+ c8.get("/").run().assertBody().is("GET");
+ c8.put("/", "").run().assertBody().is("PUT");
+ c8.get("/").header("X-Method", "PUT").run().assertBody().is("GET");
+ c8.put("/", "").header("X-Method", "GET").run().assertBody().is("PUT");
+ c8.request("GET","/",null,"").header("X-Method","FOO").run().assertBody().is("GET");
}
@Test
public void c09_allowedMethodHeaders_caseInsensitiveHeaderName() throws Exception {
- c5.get("/").header("x-method", "PUT").execute().assertBody("PUT");
- c5.get("/").header("x-method", "FOO").execute().assertBody("FOO");
+ c5.get("/").header("x-method", "PUT").run().assertBody().is("PUT");
+ c5.get("/").header("x-method", "FOO").run().assertBody().is("FOO");
}
@Test
public void c10_allowedMethodHeaders_caseInsensitiveHeaderValue() throws Exception {
- c5.get("/").header("X-Method", "put").execute().assertBody("PUT");
- c5.get("/").header("X-Method", "foo").execute().assertBody("FOO");
+ c5.get("/").header("X-Method", "put").run().assertBody().is("PUT");
+ c5.get("/").header("X-Method", "foo").run().assertBody().is("FOO");
}
//====================================================================================================
@@ -374,111 +374,111 @@ public class RestResourceTest {
@Test
public void d01_allowedMethodHeaders_default() throws Exception {
- d1.get("/").execute().assertBody("GET");
- d1.put("/", "").execute().assertBody("PUT");
- d1.head("/").execute().assertBody("HEAD");
- d1.options("/").execute().assertBody("OPTIONS");
- d1.get("/?method=PUT").execute().assertBody("GET");
- d1.put("/?method=GET", "").execute().assertBody("PUT");
- d1.get("/?method=HEAD").execute().assertBody("HEAD");
- d1.get("/?method=OPTIONS").execute().assertBody("OPTIONS");
- d1.request("GET","/?method=FOO",null,"").execute().assertBody("GET");
+ d1.get("/").run().assertBody().is("GET");
+ d1.put("/", "").run().assertBody().is("PUT");
+ d1.head("/").run().assertBody().is("HEAD");
+ d1.options("/").run().assertBody().is("OPTIONS");
+ d1.get("/?method=PUT").run().assertBody().is("GET");
+ d1.put("/?method=GET", "").run().assertBody().is("PUT");
+ d1.get("/?method=HEAD").run().assertBody().is("HEAD");
+ d1.get("/?method=OPTIONS").run().assertBody().is("OPTIONS");
+ d1.request("GET","/?method=FOO",null,"").run().assertBody().is("GET");
}
@Test
public void d02_allowedMethodParams_GET_only() throws Exception {
- d2.get("/").execute().assertBody("GET");
- d2.put("/", "").execute().assertBody("PUT");
- d2.head("/").execute().assertBody("HEAD");
- d2.options("/").execute().assertBody("OPTIONS");
- d2.get("/?method=PUT").execute().assertBody("GET");
- d2.put("/?method=GET", "").execute().assertBody("GET");
- d2.get("/?method=HEAD").execute().assertBody("GET");
- d2.get("/?method=OPTIONS").execute().assertBody("GET");
- d2.request("GET","/?method=FOO",null,"").execute().assertBody("GET");
+ d2.get("/").run().assertBody().is("GET");
+ d2.put("/", "").run().assertBody().is("PUT");
+ d2.head("/").run().assertBody().is("HEAD");
+ d2.options("/").run().assertBody().is("OPTIONS");
+ d2.get("/?method=PUT").run().assertBody().is("GET");
+ d2.put("/?method=GET", "").run().assertBody().is("GET");
+ d2.get("/?method=HEAD").run().assertBody().is("GET");
+ d2.get("/?method=OPTIONS").run().assertBody().is("GET");
+ d2.request("GET","/?method=FOO",null,"").run().assertBody().is("GET");
}
@Test
public void d03_allowedMethodParams_GET_caseSensitivity() throws Exception {
- d3.get("/").execute().assertBody("GET");
- d3.put("/", "").execute().assertBody("PUT");
- d3.head("/").execute().assertBody("HEAD");
- d3.options("/").execute().assertBody("OPTIONS");
- d3.get("/?method=PUT").execute().assertBody("GET");
- d3.put("/?method=GET", "").execute().assertBody("GET");
- d3.get("/?method=HEAD").execute().assertBody("GET");
- d3.get("/?method=OPTIONS").execute().assertBody("GET");
- d3.request("GET","/?method=FOO",null,"").execute().assertBody("GET");
+ d3.get("/").run().assertBody().is("GET");
+ d3.put("/", "").run().assertBody().is("PUT");
+ d3.head("/").run().assertBody().is("HEAD");
+ d3.options("/").run().assertBody().is("OPTIONS");
+ d3.get("/?method=PUT").run().assertBody().is("GET");
+ d3.put("/?method=GET", "").run().assertBody().is("GET");
+ d3.get("/?method=HEAD").run().assertBody().is("GET");
+ d3.get("/?method=OPTIONS").run().assertBody().is("GET");
+ d3.request("GET","/?method=FOO",null,"").run().assertBody().is("GET");
}
@Test
public void d04_allowedMethodParams_FOO_only() throws Exception {
- d4.get("/").execute().assertBody("GET");
- d4.put("/", "").execute().assertBody("PUT");
- d4.head("/").execute().assertBody("HEAD");
- d4.options("/").execute().assertBody("OPTIONS");
- d4.get("/?method=PUT").execute().assertBody("GET");
- d4.put("/?method=GET", "").execute().assertBody("PUT");
- d4.get("/?method=HEAD").execute().assertBody("GET");
- d4.get("/?method=OPTIONS").execute().assertBody("GET");
- d4.request("GET","/?method=FOO",null,"").execute().assertBody("FOO");
+ d4.get("/").run().assertBody().is("GET");
+ d4.put("/", "").run().assertBody().is("PUT");
+ d4.head("/").run().assertBody().is("HEAD");
+ d4.options("/").run().assertBody().is("OPTIONS");
+ d4.get("/?method=PUT").run().assertBody().is("GET");
+ d4.put("/?method=GET", "").run().assertBody().is("PUT");
+ d4.get("/?method=HEAD").run().assertBody().is("GET");
+ d4.get("/?method=OPTIONS").run().assertBody().is("GET");
+ d4.request("GET","/?method=FOO",null,"").run().assertBody().is("FOO");
}
@Test
public void d05_allowedMethodParams_allMethods() throws Exception {
- d5.get("/").execute().assertBody("GET");
- d5.put("/", "").execute().assertBody("PUT");
- d5.head("/").execute().assertBody("HEAD");
- d5.options("/").execute().assertBody("OPTIONS");
- d5.get("/?method=PUT").execute().assertBody("PUT");
- d5.put("/?method=GET", "").execute().assertBody("GET");
- d5.get("/?method=HEAD").execute().assertBody("HEAD");
- d5.get("/?method=OPTIONS").execute().assertBody("OPTIONS");
- d5.request("GET","/?method=FOO",null,"").execute().assertBody("FOO");
+ d5.get("/").run().assertBody().is("GET");
+ d5.put("/", "").run().assertBody().is("PUT");
+ d5.head("/").run().assertBody().is("HEAD");
+ d5.options("/").run().assertBody().is("OPTIONS");
+ d5.get("/?method=PUT").run().assertBody().is("PUT");
+ d5.put("/?method=GET", "").run().assertBody().is("GET");
+ d5.get("/?method=HEAD").run().assertBody().is("HEAD");
+ d5.get("/?method=OPTIONS").run().assertBody().is("OPTIONS");
+ d5.request("GET","/?method=FOO",null,"").run().assertBody().is("FOO");
}
@Test
public void d06_allowedMethodParams_none() throws Exception {
- d6.get("/").execute().assertBody("GET");
- d6.put("/", "").execute().assertBody("PUT");
- d6.head("/").execute().assertBody("HEAD");
- d6.options("/").execute().assertBody("OPTIONS");
- d6.get("/?method=PUT").execute().assertBody("GET");
- d6.put("/?method=GET", "").execute().assertBody("PUT");
- d6.get("/?method=HEAD").execute().assertBody("GET");
- d6.get("/?method=OPTIONS").execute().assertBody("GET");
- d6.request("GET","/?method=FOO",null,"").execute().assertBody("GET");
+ d6.get("/").run().assertBody().is("GET");
+ d6.put("/", "").run().assertBody().is("PUT");
+ d6.head("/").run().assertBody().is("HEAD");
+ d6.options("/").run().assertBody().is("OPTIONS");
+ d6.get("/?method=PUT").run().assertBody().is("GET");
+ d6.put("/?method=GET", "").run().assertBody().is("PUT");
+ d6.get("/?method=HEAD").run().assertBody().is("GET");
+ d6.get("/?method=OPTIONS").run().assertBody().is("GET");
+ d6.request("GET","/?method=FOO",null,"").run().assertBody().is("GET");
}
@Test
public void d07_allowedMethodParams_none_caseSensitivity() throws Exception {
- d7.get("/").execute().assertBody("GET");
- d7.put("/", "").execute().assertBody("PUT");
- d7.head("/").execute().assertBody("HEAD");
- d7.options("/").execute().assertBody("OPTIONS");
- d7.get("/?method=PUT").execute().assertBody("GET");
- d7.put("/?method=GET", "").execute().assertBody("PUT");
- d7.get("/?method=HEAD").execute().assertBody("GET");
- d7.get("/?method=OPTIONS").execute().assertBody("GET");
- d7.request("GET","/?method=FOO",null,"").execute().assertBody("GET");
+ d7.get("/").run().assertBody().is("GET");
+ d7.put("/", "").run().assertBody().is("PUT");
+ d7.head("/").run().assertBody().is("HEAD");
+ d7.options("/").run().assertBody().is("OPTIONS");
+ d7.get("/?method=PUT").run().assertBody().is("GET");
+ d7.put("/?method=GET", "").run().assertBody().is("PUT");
+ d7.get("/?method=HEAD").run().assertBody().is("GET");
+ d7.get("/?method=OPTIONS").run().assertBody().is("GET");
+ d7.request("GET","/?method=FOO",null,"").run().assertBody().is("GET");
}
@Test
public void d08_allowedMethodParams_none_overridingParent() throws Exception {
- d8.get("/").execute().assertBody("GET");
- d8.put("/", "").execute().assertBody("PUT");
- d8.head("/").execute().assertBody("HEAD");
- d8.options("/").execute().assertBody("OPTIONS");
- d8.get("/?method=PUT").execute().assertBody("GET");
- d8.put("/?method=GET", "").execute().assertBody("PUT");
- d8.get("/?method=HEAD").execute().assertBody("GET");
- d8.get("/?method=OPTIONS").execute().assertBody("GET");
- d8.request("GET","/?method=FOO",null,"").execute().assertBody("GET");
+ d8.get("/").run().assertBody().is("GET");
+ d8.put("/", "").run().assertBody().is("PUT");
+ d8.head("/").run().assertBody().is("HEAD");
+ d8.options("/").run().assertBody().is("OPTIONS");
+ d8.get("/?method=PUT").run().assertBody().is("GET");
+ d8.put("/?method=GET", "").run().assertBody().is("PUT");
+ d8.get("/?method=HEAD").run().assertBody().is("GET");
+ d8.get("/?method=OPTIONS").run().assertBody().is("GET");
+ d8.request("GET","/?method=FOO",null,"").run().assertBody().is("GET");
}
@Test
public void d09_allowedMethodHeaders_caseInsensitiveParamValue() throws Exception {
- d5.get("/?method=Put").execute().assertBody("PUT");
- d5.get("/?method=Foo").execute().assertBody("FOO");
+ d5.get("/?method=Put").run().assertBody().is("PUT");
+ d5.get("/?method=Foo").run().assertBody().is("FOO");
}
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/AnnotationInheritanceTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/AnnotationInheritanceTest.java
index 368d08a..fe12cd2 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/AnnotationInheritanceTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/AnnotationInheritanceTest.java
@@ -64,14 +64,14 @@ public class AnnotationInheritanceTest {
@Test
public void a01_inherited_Body() throws Exception {
- a.put("/a01", "'foo'").json().execute().assertBody("'foo'");
+ a.put("/a01", "'foo'").json().run().assertBody().is("'foo'");
}
@Test
public void a02_inherited_Query() throws Exception {
- a.get("/a02").query("foo", "bar").json().execute().assertBody("'bar'");
+ a.get("/a02").query("foo", "bar").json().run().assertBody().is("'bar'");
}
@Test
public void a03_inherited_Header() throws Exception {
- a.get("/a03").header("foo", "bar").json().execute().assertBody("'bar'");
+ a.get("/a03").header("foo", "bar").json().run().assertBody().is("'bar'");
}
}
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 5e3bfff..03c13eb 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
@@ -131,139 +131,139 @@ public class BodyAnnotationTest {
@Test
public void a01a_onParameter_String() throws Exception {
- a.put("/String", "'foo'").json().execute().assertBody("'foo'");
+ a.put("/String", "'foo'").json().run().assertBody().is("'foo'");
}
@Test
public void a01b_onParameter_String_noContentType() throws Exception {
// If no Content-Type specified, should be treated as plain-text.
- a.put("/String", "'foo'").execute().assertBody("'\\'foo\\''");
+ a.put("/String", "'foo'").run().assertBody().is("'\\'foo\\''");
}
@Test
public void a01c_onParameter_String_noContentType_other() throws Exception {
// If Content-Type not matched, should be treated as plain-text.
- a.put("/String", "'foo'").contentType("").execute().assertBody("'\\'foo\\''");
- a.put("/String", "'foo'").contentType("text/plain").execute().assertBody("'\\'foo\\''");
+ a.put("/String", "'foo'").contentType("").run().assertBody().is("'\\'foo\\''");
+ a.put("/String", "'foo'").contentType("text/plain").run().assertBody().is("'\\'foo\\''");
}
@Test
public void a02a_onParameter_Integer() throws Exception {
- a.put("/Integer", "123").json().execute().assertBody("123");
+ a.put("/Integer", "123").json().run().assertBody().is("123");
}
@Test
public void a02b_onParameter_Integer_noContentType() throws Exception {
// Integer takes in a String arg, so it can be parsed without Content-Type.
- a.put("/Integer", "123").execute().assertBody("123");
+ a.put("/Integer", "123").run().assertBody().is("123");
}
@Test
public void a03a_onParameter_int() throws Exception {
- a.put("/int", "123").json().execute().assertBody("123");
+ a.put("/int", "123").json().run().assertBody().is("123");
}
@Test
public void a03b_onParameter_int_noContentType() throws Exception {
- a.put("/int", "123").execute().assertBody("123"); // Uses part parser.
+ a.put("/int", "123").run().assertBody().is("123"); // Uses part parser.
}
@Test
public void a04a_onParameter_Boolean() throws Exception {
- a.put("/Boolean", "true").json().execute().assertBody("true");
+ a.put("/Boolean", "true").json().run().assertBody().is("true");
}
@Test
public void a04b_onParameter_Boolean_noContentType() throws Exception {
// Boolean takes in a String arg, so it can be parsed without Content-Type.
- a.put("/Boolean", "true").execute().assertBody("true");
+ a.put("/Boolean", "true").run().assertBody().is("true");
}
@Test
public void a05a_onParameter_boolean() throws Exception {
- a.put("/boolean", "true").json().execute().assertBody("true");
+ a.put("/boolean", "true").json().run().assertBody().is("true");
}
@Test
public void a05b_onParameter_boolean_noContentType() throws Exception {
- a.put("/boolean", "true").execute().assertBody("true"); // Uses part parser.
+ a.put("/boolean", "true").run().assertBody().is("true"); // Uses part parser.
}
@Test
public void a06a_onParameter_float() throws Exception {
- a.put("/float", "1.23").json().execute().assertBody("1.23");
+ a.put("/float", "1.23").json().run().assertBody().is("1.23");
}
@Test
public void a06b_onParameter_float_noContentType() throws Exception {
- a.put("/float", "1.23").execute().assertBody("1.23"); // Uses part parser.
+ a.put("/float", "1.23").run().assertBody().is("1.23"); // Uses part parser.
}
@Test
public void a07a_onParameter_Float() throws Exception {
- a.put("/Float", "1.23").json().execute().assertBody("1.23");
+ a.put("/Float", "1.23").json().run().assertBody().is("1.23");
}
@Test
public void a07b_onParameter_Float_noContentType() throws Exception {
// Float takes in a String arg, so it can be parsed without Content-Type.
- a.put("/Float", "1.23").execute().assertBody("1.23");
+ a.put("/Float", "1.23").run().assertBody().is("1.23");
}
@Test
public void a08a_onParameter_Map() throws Exception {
- a.put("/Map", "{foo:123}").json().execute().assertBody("{foo:123}");
+ a.put("/Map", "{foo:123}").json().run().assertBody().is("{foo:123}");
}
@Test
public void a08b_onParameter_Map_noContentType() throws Exception {
- a.put("/Map", "(foo=123)").execute().assertStatus(415);
+ a.put("/Map", "(foo=123)").run().assertStatus().equals(415);
}
@Test
public void a09a_onParameter_enum() throws Exception {
- a.put("/enum", "'ONE'").json().execute().assertBody("'ONE'");
+ a.put("/enum", "'ONE'").json().run().assertBody().is("'ONE'");
}
@Test
public void a09b_onParameter_enum_noContentType() throws Exception {
- a.put("/enum", "ONE").execute().assertBody("'ONE'");
+ a.put("/enum", "ONE").run().assertBody().is("'ONE'");
}
@Test
public void a11a_onParameter_Bean() throws Exception {
- a.put("/Bean", "{f1:'a'}").json().execute().assertBody("{f1:'a'}");
+ a.put("/Bean", "{f1:'a'}").json().run().assertBody().is("{f1:'a'}");
}
@Test
public void a11b_onParameter_Bean_noContentType() throws Exception {
- a.put("/Bean", "(f1=a)").execute().assertStatus(415);
+ a.put("/Bean", "(f1=a)").run().assertStatus().equals(415);
}
@Test
public void a12a_onParameter_InputStream() throws Exception {
// Content-Type should always be ignored.
- a.put("/InputStream", "'a'").json().execute().assertBody("'\\'a\\''");
+ a.put("/InputStream", "'a'").json().run().assertBody().is("'\\'a\\''");
}
@Test
public void a12b_onParameter_InputStream_noContentType() throws Exception {
- a.put("/InputStream", "'a'").execute().assertBody("'\\'a\\''");
+ a.put("/InputStream", "'a'").run().assertBody().is("'\\'a\\''");
}
@Test
public void a13a_onParameter_Reader() throws Exception {
// Content-Type should always be ignored.
- a.put("/Reader", "'a'").json().execute().assertBody("'\\'a\\''");
+ a.put("/Reader", "'a'").json().run().assertBody().is("'\\'a\\''");
}
@Test
public void a13b_onParameter_Reader_noContentType() throws Exception {
- a.put("/Reader", "'a'").execute().assertBody("'\\'a\\''");
+ a.put("/Reader", "'a'").run().assertBody().is("'\\'a\\''");
}
@Test
public void a14a_onParameter_InputStreamTransform() throws Exception {
// Input stream transform requests must not specify Content-Type or else gets resolved as POJO.
- a.put("/InputStreamTransform?noTrace=true", "'a'").json().execute().assertBodyContains("Bad Request");
+ a.put("/InputStreamTransform?noTrace=true", "'a'").json().run().assertBody().contains("Bad Request");
}
@Test
public void a14b_onParameter_InputStreamTransform_noContentType() throws Exception {
- a.put("/InputStreamTransform", "'a'").execute().assertBody("'\\'a\\''");
+ a.put("/InputStreamTransform", "'a'").run().assertBody().is("'\\'a\\''");
}
@Test
public void a15a_onParameter_ReaderTransform() throws Exception {
// Reader transform requests must not specify Content-Type or else gets resolved as POJO.
- a.put("/ReaderTransform?noTrace=true", "'a'").json().execute().assertBodyContains("Bad Request");
+ a.put("/ReaderTransform?noTrace=true", "'a'").json().run().assertBody().contains("Bad Request");
}
@Test
public void a15b_onParameter_ReaderTransform_noContentType() throws Exception {
- a.put("/ReaderTransform", "'a'").execute().assertBody("'\\'a\\''");
+ a.put("/ReaderTransform", "'a'").run().assertBody().is("'\\'a\\''");
}
@Test
public void a16a_onParameter_StringTransform() throws Exception {
// When Content-Type specified and matched, treated as a parsed POJO.
- a.put("/StringTransform", "'a'").json().execute().assertBody("'a'");
+ a.put("/StringTransform", "'a'").json().run().assertBody().is("'a'");
}
@Test
public void a16b_onParameter_StringTransform_noContentType() throws Exception {
// When Content-Type not matched, treated as plain text.
- a.put("/StringTransform", "'a'").execute().assertBody("'\\'a\\''");
+ a.put("/StringTransform", "'a'").run().assertBody().is("'\\'a\\''");
}
//=================================================================================================================
@@ -322,46 +322,46 @@ public class BodyAnnotationTest {
@Test
public void b01a_onPojo_StringTransform() throws Exception {
- b.put("/StringTransform", "'foo'").json().execute().assertBody("'foo'");
+ b.put("/StringTransform", "'foo'").json().run().assertBody().is("'foo'");
}
@Test
public void b01b_onPojo_StringTransform_noContentType() throws Exception {
// When Content-Type not matched, treated as plain text.
- b.put("/StringTransform", "'foo'").execute().assertBody("'\\'foo\\''");
+ b.put("/StringTransform", "'foo'").run().assertBody().is("'\\'foo\\''");
}
@Test
public void b02a_onPojo_Bean() throws Exception {
- b.put("/Bean", "{f1:'a'}").json().execute().assertBody("{f1:'a'}");
+ b.put("/Bean", "{f1:'a'}").json().run().assertBody().is("{f1:'a'}");
}
@Test
public void b02b_onPojo_Bean_noContentType() throws Exception {
- b.put("/Bean", "(f1=a)").execute().assertStatus(415);
+ b.put("/Bean", "(f1=a)").run().assertStatus().equals(415);
}
@Test
public void b03a_onPojo_BeanList() throws Exception {
- b.put("/BeanList", "[{f1:'a'}]").json().execute().assertBody("[{f1:'a'}]");
+ b.put("/BeanList", "[{f1:'a'}]").json().run().assertBody().is("[{f1:'a'}]");
}
@Test
public void b03b_onPojo_BeanList_noContentType() throws Exception {
- b.put("/BeanList", "(f1=a)").execute().assertStatus(415);
+ b.put("/BeanList", "(f1=a)").run().assertStatus().equals(415);
}
@Test
public void b04a_onPojo_InputStreamTransform() throws Exception {
- b.put("/InputStreamTransform", "a").execute().assertBody("'a'");
+ b.put("/InputStreamTransform", "a").run().assertBody().is("'a'");
}
@Test
public void b04b_onPojo_InputStreamTransform_withContentType() throws Exception {
// When Content-Type matched, treated as parsed POJO.
- b.put("/InputStreamTransform?noTrace=true", "a").json().execute().assertBodyContains("Bad Request");
+ b.put("/InputStreamTransform?noTrace=true", "a").json().run().assertBody().contains("Bad Request");
}
@Test
public void b05a_onPojo_ReaderTransform() throws Exception {
- b.put("/ReaderTransform", "a").execute().assertBody("'a'");
+ b.put("/ReaderTransform", "a").run().assertBody().is("'a'");
}
@Test
public void b05b_onPojo_ReaderTransform_withContentType() throws Exception {
// When Content-Type matched, treated as parsed POJO.
- b.put("/ReaderTransform?noTrace=true", "a").json().execute().assertBodyContains("Bad Request");
+ b.put("/ReaderTransform?noTrace=true", "a").json().run().assertBody().contains("Bad Request");
}
//=================================================================================================================
@@ -369,93 +369,93 @@ public class BodyAnnotationTest {
//=================================================================================================================
public void c01_bodyParam_String() throws Exception {
- a.put("/String?body=foo", null).execute().assertBody("'foo'");
- a.put("/String?body=null", null).execute().assertBody("null");
- a.put("/String?body=", null).execute().assertBody("''");
+ a.put("/String?body=foo", null).run().assertBody().is("'foo'");
+ a.put("/String?body=null", null).run().assertBody().is("null");
+ a.put("/String?body=", null).run().assertBody().is("''");
}
@Test
public void c02_bodyParam_Integer() throws Exception {
- a.put("/Integer?body=123", null).execute().assertBody("123");
- a.put("/Integer?body=-123", null).execute().assertBody("-123");
- a.put("/Integer?body=null", null).execute().assertBody("null");
- a.put("/Integer?body=", null).execute().assertBody("null");
- a.put("/Integer?body=bad&noTrace=true", null).execute().assertStatus(400);
+ a.put("/Integer?body=123", null).run().assertBody().is("123");
+ a.put("/Integer?body=-123", null).run().assertBody().is("-123");
+ a.put("/Integer?body=null", null).run().assertBody().is("null");
+ a.put("/Integer?body=", null).run().assertBody().is("null");
+ a.put("/Integer?body=bad&noTrace=true", null).run().assertStatus().equals(400);
}
@Test
public void c03_bodyParam_int() throws Exception {
- a.put("/int?body=123", null).execute().assertBody("123");
- a.put("/int?body=-123", null).execute().assertBody("-123");
- a.put("/int?body=null", null).execute().assertBody("0");
- a.put("/int?body=", null).execute().assertBody("0");
- a.put("/int?body=bad&noTrace=true", null).execute().assertStatus(400);
+ a.put("/int?body=123", null).run().assertBody().is("123");
+ a.put("/int?body=-123", null).run().assertBody().is("-123");
+ a.put("/int?body=null", null).run().assertBody().is("0");
+ a.put("/int?body=", null).run().assertBody().is("0");
+ a.put("/int?body=bad&noTrace=true", null).run().assertStatus().equals(400);
}
@Test
public void c04_bodyParam_Boolean() throws Exception {
- a.put("/Boolean?body=true", null).execute().assertBody("true");
- a.put("/Boolean?body=false", null).execute().assertBody("false");
- a.put("/Boolean?body=null", null).execute().assertBody("null");
- a.put("/Boolean?body=", null).execute().assertBody("null");
- a.put("/Boolean?body=bad&noTrace=true", null).execute().assertStatus(400);
+ a.put("/Boolean?body=true", null).run().assertBody().is("true");
+ a.put("/Boolean?body=false", null).run().assertBody().is("false");
+ a.put("/Boolean?body=null", null).run().assertBody().is("null");
+ a.put("/Boolean?body=", null).run().assertBody().is("null");
+ a.put("/Boolean?body=bad&noTrace=true", null).run().assertStatus().equals(400);
}
@Test
public void c05_bodyParam_boolean() throws Exception {
- a.put("/boolean?body=true", null).execute().assertBody("true");
- a.put("/boolean?body=false", null).execute().assertBody("false");
- a.put("/boolean?body=null", null).execute().assertBody("false");
- a.put("/boolean?body=", null).execute().assertBody("false");
- a.put("/boolean?body=bad&noTrace=true", null).execute().assertStatus(400);
+ a.put("/boolean?body=true", null).run().assertBody().is("true");
+ a.put("/boolean?body=false", null).run().assertBody().is("false");
+ a.put("/boolean?body=null", null).run().assertBody().is("false");
+ a.put("/boolean?body=", null).run().assertBody().is("false");
+ a.put("/boolean?body=bad&noTrace=true", null).run().assertStatus().equals(400);
}
@Test
public void c06_bodyParam_Float() throws Exception {
- a.put("/Float?body=1.23", null).execute().assertBody("1.23");
- a.put("/Float?body=-1.23", null).execute().assertBody("-1.23");
- a.put("/Float?body=null", null).execute().assertBody("null");
- a.put("/Float?body=", null).execute().assertBody("null");
- a.put("/Float?body=bad&noTrace=true", null).execute().assertStatus(400);
+ a.put("/Float?body=1.23", null).run().assertBody().is("1.23");
+ a.put("/Float?body=-1.23", null).run().assertBody().is("-1.23");
+ a.put("/Float?body=null", null).run().assertBody().is("null");
+ a.put("/Float?body=", null).run().assertBody().is("null");
+ a.put("/Float?body=bad&noTrace=true", null).run().assertStatus().equals(400);
}
@Test
public void c07_bodyParam_float() throws Exception {
- a.put("/float?body=1.23", null).execute().assertBody("1.23");
- a.put("/float?body=-1.23", null).execute().assertBody("-1.23");
- a.put("/float?body=null", null).execute().assertBody("0.0");
- a.put("/float?body=", null).execute().assertBody("0.0");
- a.put("/float?body=bad&noTrace=true", null).execute().assertStatus(400);
+ a.put("/float?body=1.23", null).run().assertBody().is("1.23");
+ a.put("/float?body=-1.23", null).run().assertBody().is("-1.23");
+ a.put("/float?body=null", null).run().assertBody().is("0.0");
+ a.put("/float?body=", null).run().assertBody().is("0.0");
+ a.put("/float?body=bad&noTrace=true", null).run().assertStatus().equals(400);
}
@Test
public void c08_bodyParam_Map() throws Exception {
- a.put("/Map?body=(foo=123)", null).execute().assertBody("{foo:123}");
- a.put("/Map?body=()", null).execute().assertBody("{}");
- a.put("/Map?body=null", null).execute().assertBody("null");
- a.put("/Map?body=", null).execute().assertBody("null");
- a.put("/Map?body=bad&noTrace=true", null).execute().assertStatus(400);
+ a.put("/Map?body=(foo=123)", null).run().assertBody().is("{foo:123}");
+ a.put("/Map?body=()", null).run().assertBody().is("{}");
+ a.put("/Map?body=null", null).run().assertBody().is("null");
+ a.put("/Map?body=", null).run().assertBody().is("null");
+ a.put("/Map?body=bad&noTrace=true", null).run().assertStatus().equals(400);
}
@Test
public void c09_bodyParam_enum() throws Exception {
- a.put("/enum?body=ONE", null).execute().assertBody("'ONE'");
- a.put("/enum?body=TWO", null).execute().assertBody("'TWO'");
- a.put("/enum?body=null", null).execute().assertBody("null");
- a.put("/enum?body=", null).execute().assertBody("null");
- a.put("/enum?body=bad&noTrace=true", null).execute().assertStatus(400);
+ a.put("/enum?body=ONE", null).run().assertBody().is("'ONE'");
+ a.put("/enum?body=TWO", null).run().assertBody().is("'TWO'");
+ a.put("/enum?body=null", null).run().assertBody().is("null");
+ a.put("/enum?body=", null).run().assertBody().is("null");
+ a.put("/enum?body=bad&noTrace=true", null).run().assertStatus().equals(400);
}
@Test
public void c11_bodyParam_Bean() throws Exception {
- a.put("/Bean?body=(f1=a)", null).execute().assertBody("{f1:'a'}");
- a.put("/Bean?body=()", null).execute().assertBody("{}");
- a.put("/Bean?body=null", null).execute().assertBody("null");
- a.put("/Bean?body=", null).execute().assertBody("null");
- a.put("/Bean?body=bad&noTrace=true", null).execute().assertStatus(400);
+ a.put("/Bean?body=(f1=a)", null).run().assertBody().is("{f1:'a'}");
+ a.put("/Bean?body=()", null).run().assertBody().is("{}");
+ a.put("/Bean?body=null", null).run().assertBody().is("null");
+ a.put("/Bean?body=", null).run().assertBody().is("null");
+ a.put("/Bean?body=bad&noTrace=true", null).run().assertStatus().equals(400);
}
@Test
public void c12_bodyParam_InputStream() throws Exception {
- a.put("/InputStream?body=a", null).execute().assertBody("'a'");
- a.put("/InputStream?body=null", null).execute().assertBody("'null'");
- a.put("/InputStream?body=", null).execute().assertBody("''");
+ a.put("/InputStream?body=a", null).run().assertBody().is("'a'");
+ a.put("/InputStream?body=null", null).run().assertBody().is("'null'");
+ a.put("/InputStream?body=", null).run().assertBody().is("''");
}
@Test
public void c13_bodyParam_Reader() throws Exception {
- a.put("/Reader?body=a", null).execute().assertBody("'a'");
- a.put("/Reader?body=null", null).execute().assertBody("'null'");
- a.put("/Reader?body=", null).execute().assertBody("''");
+ a.put("/Reader?body=a", null).run().assertBody().is("'a'");
+ a.put("/Reader?body=null", null).run().assertBody().is("'null'");
+ a.put("/Reader?body=", null).run().assertBody().is("''");
}
// It's not currently possible to pass in a &body parameter for InputStream/Reader transforms.
@@ -541,75 +541,75 @@ public class BodyAnnotationTest {
@Test
public void d01a_noMediaTypes_String() throws Exception {
- d.put("/String", "a").execute().assertBody("a");
+ d.put("/String", "a").run().assertBody().is("a");
}
@Test
public void d01b_noMediaTypes_String_withContentType() throws Exception {
- d.put("/String", "a").json().execute().assertBody("a");
+ d.put("/String", "a").json().run().assertBody().is("a");
}
@Test
public void d02a_noMediaTypes_InputStream() throws Exception {
- d.put("/InputStream", "a").execute().assertBody("a");
+ d.put("/InputStream", "a").run().assertBody().is("a");
}
@Test
public void d02b_noMediaTypes_InputStream_withContentType() throws Exception {
- d.put("/InputStream", "a").json().execute().assertBody("a");
+ d.put("/InputStream", "a").json().run().assertBody().is("a");
}
@Test
public void d03a_noMediaTypes_Reader() throws Exception {
- d.put("/Reader", "a").execute().assertBody("a");
+ d.put("/Reader", "a").run().assertBody().is("a");
}
@Test
public void d03b_noMediaTypes_Reader_withContentType() throws Exception {
- d.put("/Reader", "a").json().execute().assertBody("a");
+ d.put("/Reader", "a").json().run().assertBody().is("a");
}
@Test
public void d04a_noMediaTypes_StringTransform() throws Exception {
- d.put("/StringTransform", "a").execute().assertBody("a");
+ d.put("/StringTransform", "a").run().assertBody().is("a");
}
@Test
public void d04b_noMediaTypes_StringTransform_withContentType() throws Exception {
- d.put("/StringTransform?noTrace=true", "a").json().execute().assertStatus(415);
+ d.put("/StringTransform?noTrace=true", "a").json().run().assertStatus().equals(415);
}
@Test
public void d05a_noMediaTypes_InputStreamTransform() throws Exception {
- d.put("/InputStreamTransform", "a").execute().assertBody("a");
+ d.put("/InputStreamTransform", "a").run().assertBody().is("a");
}
@Test
public void d05b_noMediaTypes_InputStreamTransform_withContentType() throws Exception {
- d.put("/InputStreamTransform", "a").json().execute().assertBody("a");
+ d.put("/InputStreamTransform", "a").json().run().assertBody().is("a");
}
@Test
public void d06a_noMediaTypes_ReaderTransform() throws Exception {
- d.put("/ReaderTransform", "a").execute().assertBody("a");
+ d.put("/ReaderTransform", "a").run().assertBody().is("a");
}
@Test
public void d06b_noMediaTypes_ReaderTransform_withContentType() throws Exception {
- d.put("/ReaderTransform", "a").json().execute().assertBody("a");
+ d.put("/ReaderTransform", "a").json().run().assertBody().is("a");
}
@Test
public void d07a_noMediaTypes_StringTransformBodyOnPojo() throws Exception {
- d.put("/StringTransformBodyOnPojo", "a").execute().assertBody("a");
+ d.put("/StringTransformBodyOnPojo", "a").run().assertBody().is("a");
}
@Test
public void d07b_noMediaTypes_StringTransformBodyOnPojo_withContentType() throws Exception {
- d.put("/StringTransformBodyOnPojo?noTrace=true", "a").json().execute().assertStatus(415);
+ d.put("/StringTransformBodyOnPojo?noTrace=true", "a").json().run().assertStatus().equals(415);
}
@Test
public void d08a_noMediaTypes_InputStreamTransformBodyOnPojo() throws Exception {
- d.put("/InputStreamTransformBodyOnPojo", "a").execute().assertBody("a");
+ d.put("/InputStreamTransformBodyOnPojo", "a").run().assertBody().is("a");
}
@Test
public void d08b_noMediaTypes_InputStreamTransformBodyOnPojo_withContentType() throws Exception {
- d.put("/InputStreamTransformBodyOnPojo", "a").json().execute().assertBody("a");
+ d.put("/InputStreamTransformBodyOnPojo", "a").json().run().assertBody().is("a");
}
@Test
public void d09a_noMediaTypes_ReaderTransformBodyOnPojo() throws Exception {
- d.put("/ReaderTransformBodyOnPojo", "a").execute().assertBody("a");
+ d.put("/ReaderTransformBodyOnPojo", "a").run().assertBody().is("a");
}
@Test
public void d09b_noMediaTypes_ReaderTransformBodyOnPojo_withContentType() throws Exception {
- d.put("/ReaderTransformBodyOnPojo", "a").json().execute().assertBody("a");
+ d.put("/ReaderTransformBodyOnPojo", "a").json().run().assertBody().is("a");
}
//=================================================================================================================
@@ -632,22 +632,22 @@ public class BodyAnnotationTest {
@Test
public void e01_complexPojos_B_body() throws Exception {
String expected = "{f01:['a','b'],f02:['c','d'],f03:[1,2],f04:[3,4],f05:[['e','f'],['g','h']],f06:[['i','j'],['k','l']],f07:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f08:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f09:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f10:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f11:['a','b'],f12:['c','d'],f13:[1,2],f14:[3,4],f15:[['e','f'],['g','h']],f16:[['i','j'],['k','l']],f17:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f18:[{a:'a',b:1,c:true},{a:'a',b:1,c:true} [...]
- e.put("/B", SimpleJsonSerializer.DEFAULT.toString(DTOs.B.INSTANCE)).json().execute().assertBody(expected);
+ e.put("/B", SimpleJsonSerializer.DEFAULT.toString(DTOs.B.INSTANCE)).json().run().assertBody().is(expected);
}
@Test
public void e02_complexPojos_B_bodyParam() throws Exception {
String expected = "{f01:['a','b'],f02:['c','d'],f03:[1,2],f04:[3,4],f05:[['e','f'],['g','h']],f06:[['i','j'],['k','l']],f07:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f08:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f09:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f10:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f11:['a','b'],f12:['c','d'],f13:[1,2],f14:[3,4],f15:[['e','f'],['g','h']],f16:[['i','j'],['k','l']],f17:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f18:[{a:'a',b:1,c:true},{a:'a',b:1,c:true} [...]
- e.put("/B?body=" + UonSerializer.DEFAULT.serialize(DTOs.B.INSTANCE), "a").execute().assertBody(expected);
+ e.put("/B?body=" + UonSerializer.DEFAULT.serialize(DTOs.B.INSTANCE), "a").run().assertBody().is(expected);
}
@Test
public void e03_complexPojos_C_body() throws Exception {
String expected = "{f01:['a','b'],f02:['c','d'],f03:[1,2],f04:[3,4],f05:[['e','f'],['g','h']],f06:[['i','j'],['k','l']],f07:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f08:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f09:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f10:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f11:['a','b'],f12:['c','d'],f13:[1,2],f14:[3,4],f15:[['e','f'],['g','h']],f16:[['i','j'],['k','l']],f17:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f18:[{a:'a',b:1,c:true},{a:'a',b:1,c:true} [...]
- e.put("/C", SimpleJsonSerializer.DEFAULT.toString(DTOs.B.INSTANCE)).json().execute().assertBody(expected);
+ e.put("/C", SimpleJsonSerializer.DEFAULT.toString(DTOs.B.INSTANCE)).json().run().assertBody().is(expected);
}
@Test
public void e04_complexPojos_C_bodyParam() throws Exception {
String expected = "{f01:['a','b'],f02:['c','d'],f03:[1,2],f04:[3,4],f05:[['e','f'],['g','h']],f06:[['i','j'],['k','l']],f07:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f08:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f09:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f10:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f11:['a','b'],f12:['c','d'],f13:[1,2],f14:[3,4],f15:[['e','f'],['g','h']],f16:[['i','j'],['k','l']],f17:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f18:[{a:'a',b:1,c:true},{a:'a',b:1,c:true} [...]
- e.put("/C?body=" + UonSerializer.DEFAULT.serialize(DTOs.B.INSTANCE), "a").execute().assertBody(expected);
+ e.put("/C?body=" + UonSerializer.DEFAULT.serialize(DTOs.B.INSTANCE), "a").run().assertBody().is(expected);
}
@Rest(serializers=SimpleJsonSerializer.class, parsers=JsonParser.class, defaultAccept="application/json")
@@ -668,22 +668,22 @@ public class BodyAnnotationTest {
@Test
public void e05_complexPojos_B_body() throws Exception {
String expected = "{f01:['a','b'],f02:['c','d'],f03:[1,2],f04:[3,4],f05:[['e','f'],['g','h']],f06:[['i','j'],['k','l']],f07:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f08:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f09:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f10:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f11:['a','b'],f12:['c','d'],f13:[1,2],f14:[3,4],f15:[['e','f'],['g','h']],f16:[['i','j'],['k','l']],f17:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f18:[{a:'a',b:1,c:true},{a:'a',b:1,c:true} [...]
- e2.put("/B", SimpleJsonSerializer.DEFAULT.builder().applyAnnotations(DTOs2.Annotations.class).build().toString(DTOs2.B.INSTANCE)).json().execute().assertBody(expected);
+ e2.put("/B", SimpleJsonSerializer.DEFAULT.builder().applyAnnotations(DTOs2.Annotations.class).build().toString(DTOs2.B.INSTANCE)).json().run().assertBody().is(expected);
}
@Test
public void e06_complexPojos_B_bodyParam() throws Exception {
String expected = "{f01:['a','b'],f02:['c','d'],f03:[1,2],f04:[3,4],f05:[['e','f'],['g','h']],f06:[['i','j'],['k','l']],f07:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f08:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f09:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f10:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f11:['a','b'],f12:['c','d'],f13:[1,2],f14:[3,4],f15:[['e','f'],['g','h']],f16:[['i','j'],['k','l']],f17:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f18:[{a:'a',b:1,c:true},{a:'a',b:1,c:true} [...]
- e2.put("/B?body=" + UonSerializer.DEFAULT.builder().applyAnnotations(DTOs2.Annotations.class).build().serialize(DTOs2.B.INSTANCE), "a").execute().assertBody(expected);
+ e2.put("/B?body=" + UonSerializer.DEFAULT.builder().applyAnnotations(DTOs2.Annotations.class).build().serialize(DTOs2.B.INSTANCE), "a").run().assertBody().is(expected);
}
@Test
public void e07_complexPojos_C_body() throws Exception {
String expected = "{f01:['a','b'],f02:['c','d'],f03:[1,2],f04:[3,4],f05:[['e','f'],['g','h']],f06:[['i','j'],['k','l']],f07:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f08:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f09:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f10:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f11:['a','b'],f12:['c','d'],f13:[1,2],f14:[3,4],f15:[['e','f'],['g','h']],f16:[['i','j'],['k','l']],f17:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f18:[{a:'a',b:1,c:true},{a:'a',b:1,c:true} [...]
- e2.put("/C", SimpleJsonSerializer.DEFAULT.builder().applyAnnotations(DTOs2.Annotations.class).build().toString(DTOs2.B.INSTANCE)).json().execute().assertBody(expected);
+ e2.put("/C", SimpleJsonSerializer.DEFAULT.builder().applyAnnotations(DTOs2.Annotations.class).build().toString(DTOs2.B.INSTANCE)).json().run().assertBody().is(expected);
}
@Test
public void e08_complexPojos_C_bodyParam() throws Exception {
String expected = "{f01:['a','b'],f02:['c','d'],f03:[1,2],f04:[3,4],f05:[['e','f'],['g','h']],f06:[['i','j'],['k','l']],f07:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f08:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f09:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f10:[[{a:'a',b:1,c:true}],[{a:'a',b:1,c:true}]],f11:['a','b'],f12:['c','d'],f13:[1,2],f14:[3,4],f15:[['e','f'],['g','h']],f16:[['i','j'],['k','l']],f17:[{a:'a',b:1,c:true},{a:'a',b:1,c:true}],f18:[{a:'a',b:1,c:true},{a:'a',b:1,c:true} [...]
- e2.put("/C?body=" + UonSerializer.DEFAULT.builder().applyAnnotations(DTOs2.Annotations.class).build().serialize(DTOs2.B.INSTANCE), "a").execute().assertBody(expected);
+ e2.put("/C?body=" + UonSerializer.DEFAULT.builder().applyAnnotations(DTOs2.Annotations.class).build().serialize(DTOs2.B.INSTANCE), "a").run().assertBody().is(expected);
}
//=================================================================================================================
@@ -708,10 +708,10 @@ public class BodyAnnotationTest {
@Test
public void f01_formPostAsContent() throws Exception {
- f.post("/", "{p1:'p1',p2:2}").json().execute().assertBody("bean=[{p1:'p1',p2:2}],qp1=[null],qp2=[0],hqp1=[false],hqp2=[false]");
- f.post("/", "{}").json().execute().assertBody("bean=[{p2:0}],qp1=[null],qp2=[0],hqp1=[false],hqp2=[false]");
- f.post("?p1=p3&p2=4", "{p1:'p1',p2:2}").json().execute().assertBody("bean=[{p1:'p1',p2:2}],qp1=[p3],qp2=[4],hqp1=[true],hqp2=[true]");
- f.post("?p1=p3&p2=4", "{}").json().execute().assertBody("bean=[{p2:0}],qp1=[p3],qp2=[4],hqp1=[true],hqp2=[true]");
+ f.post("/", "{p1:'p1',p2:2}").json().run().assertBody().is("bean=[{p1:'p1',p2:2}],qp1=[null],qp2=[0],hqp1=[false],hqp2=[false]");
+ f.post("/", "{}").json().run().assertBody().is("bean=[{p2:0}],qp1=[null],qp2=[0],hqp1=[false],hqp2=[false]");
+ f.post("?p1=p3&p2=4", "{p1:'p1',p2:2}").json().run().assertBody().is("bean=[{p1:'p1',p2:2}],qp1=[p3],qp2=[4],hqp1=[true],hqp2=[true]");
+ f.post("?p1=p3&p2=4", "{}").json().run().assertBody().is("bean=[{p2:0}],qp1=[p3],qp2=[4],hqp1=[true],hqp2=[true]");
}
//=================================================================================================================
@@ -752,7 +752,7 @@ public class BodyAnnotationTest {
+ "&f18=(a=a,b=1,c=true)&f18=(a=b,b=2,c=false)"
+ "&f19=@((a=a,b=1,c=true))&f19=@((a=b,b=2,c=false))"
+ "&f20=@((a=a,b=1,c=true))&f20=@((a=b,b=2,c=false))";
- g.post("/", in).urlEnc().execute().assertBody(in);
+ g.post("/", in).urlEnc().run().assertBody().is(in);
}
//=================================================================================================================
@@ -798,7 +798,7 @@ public class BodyAnnotationTest {
+ "&f18=(a=a,b=1,c=true)&f18=(a=b,b=2,c=false)"
+ "&f19=@((a=a,b=1,c=true))&f19=@((a=b,b=2,c=false))"
+ "&f20=@((a=a,b=1,c=true))&f20=@((a=b,b=2,c=false))";
- h.post("/", in).urlEnc().execute().assertBody(in);
+ h.post("/", in).urlEnc().run().assertBody().is(in);
}
@Rest(serializers=UrlEncodingSerializer.class,parsers=UrlEncodingParser.class)
@@ -840,7 +840,7 @@ public class BodyAnnotationTest {
+ "&f18=(a=a,b=1,c=true)&f18=(a=b,b=2,c=false)"
+ "&f19=@((a=a,b=1,c=true))&f19=@((a=b,b=2,c=false))"
+ "&f20=@((a=a,b=1,c=true))&f20=@((a=b,b=2,c=false))";
- h2.post("/", in).urlEnc().execute().assertBody(in);
+ h2.post("/", in).urlEnc().run().assertBody().is(in);
}
//=================================================================================================================
@@ -858,8 +858,8 @@ public class BodyAnnotationTest {
@Test
public void i01() throws Exception {
- i.post("/", "").json().execute().assertStatus(400).assertBodyContains("Required value not provided.");
- i.post("/", "{}").json().execute().assertStatus(200);
+ i.post("/", "").json().run().assertStatus().equals(400).assertBody().contains("Required value not provided.");
+ i.post("/", "{}").json().run().assertStatus().equals(200);
}
@Rest(serializers=JsonSerializer.class,parsers=JsonParser.class)
@@ -875,8 +875,8 @@ public class BodyAnnotationTest {
@Test
public void i02() throws Exception {
- i2.post("/", "").json().execute().assertStatus(400).assertBodyContains("Required value not provided.");
- i2.post("/", "{}").json().execute().assertStatus(200);
+ i2.post("/", "").json().run().assertStatus().equals(400).assertBody().contains("Required value not provided.");
+ i2.post("/", "{}").json().run().assertStatus().equals(200);
}
//=================================================================================================================
@@ -909,28 +909,28 @@ public class BodyAnnotationTest {
@Test
public void j01_optionalParam_integer() throws Exception {
- j.post("/a", "123").execute().assertStatus(200).assertBody("123");
- j.post("/a", "null").execute().assertStatus(200).assertBody("null");
+ j.post("/a", "123").run().assertStatus().equals(200).assertBody().is("123");
+ j.post("/a", "null").run().assertStatus().equals(200).assertBody().is("null");
}
@Test
public void j02_optionalParam_bean() throws Exception {
- j.post("/b", new ABean().init()).execute().assertStatus(200).assertBody("{a:1,b:'foo'}");
- j.post("/b", "null").execute().assertStatus(200).assertBody("null");
+ j.post("/b", new ABean().init()).run().assertStatus().equals(200).assertBody().is("{a:1,b:'foo'}");
+ j.post("/b", "null").run().assertStatus().equals(200).assertBody().is("null");
}
@Test
public void j03_optionalParam_listOfBeans() throws Exception {
String body = SimpleJson.DEFAULT.toString(AList.of(new ABean().init()));
- j.post("/c", body).execute().assertStatus(200).assertBody("[{a:1,b:'foo'}]");
- j.post("/c", "null").execute().assertStatus(200).assertBody("null");
+ j.post("/c", body).run().assertStatus().equals(200).assertBody().is("[{a:1,b:'foo'}]");
+ j.post("/c", "null").run().assertStatus().equals(200).assertBody().is("null");
}
@Test
public void j04_optionalParam_listOfOptionals() throws Exception {
String body = SimpleJson.DEFAULT.toString(AList.of(Optional.of(new ABean().init())));
- j.post("/d", body).execute().assertStatus(200).assertBody("[{a:1,b:'foo'}]");
- j.post("/d", "null").execute().assertStatus(200).assertBody("null");
+ j.post("/d", body).run().assertStatus().equals(200).assertBody().is("[{a:1,b:'foo'}]");
+ j.post("/d", "null").run().assertStatus().equals(200).assertBody().is("null");
}
//=================================================================================================================
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/FormDataAnnotationTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/FormDataAnnotationTest.java
index 01535b7..f475c8c 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/FormDataAnnotationTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/FormDataAnnotationTest.java
@@ -49,18 +49,18 @@ public class FormDataAnnotationTest {
@Test
public void a01() throws Exception {
- a.post("", "p1=p1&p2=2").contentType("application/x-www-form-urlencoded").execute().assertBody("p1=[p1,p1,p1],p2=[2,2,2]");
- a.post("", "p1&p2").contentType("application/x-www-form-urlencoded").execute().assertBody("p1=[null,null,null],p2=[0,null,0]");
- a.post("", "p1=&p2=").contentType("application/x-www-form-urlencoded").execute().assertBody("p1=[,,],p2=[0,,0]");
- a.post("", "").contentType("application/x-www-form-urlencoded").execute().assertBody("p1=[null,null,null],p2=[0,null,0]");
- a.post("", "p1").contentType("application/x-www-form-urlencoded").execute().assertBody("p1=[null,null,null],p2=[0,null,0]");
- a.post("", "p1=").contentType("application/x-www-form-urlencoded").execute().assertBody("p1=[,,],p2=[0,null,0]");
- a.post("", "p2").contentType("application/x-www-form-urlencoded").execute().assertBody("p1=[null,null,null],p2=[0,null,0]");
- a.post("", "p2=").contentType("application/x-www-form-urlencoded").execute().assertBody("p1=[null,null,null],p2=[0,,0]");
- a.post("", "p1=foo&p2").contentType("application/x-www-form-urlencoded").execute().assertBody("p1=[foo,foo,foo],p2=[0,null,0]");
- a.post("", "p1&p2=1").contentType("application/x-www-form-urlencoded").execute().assertBody("p1=[null,null,null],p2=[1,1,1]");
+ a.post("", "p1=p1&p2=2").contentType("application/x-www-form-urlencoded").run().assertBody().is("p1=[p1,p1,p1],p2=[2,2,2]");
+ a.post("", "p1&p2").contentType("application/x-www-form-urlencoded").run().assertBody().is("p1=[null,null,null],p2=[0,null,0]");
+ a.post("", "p1=&p2=").contentType("application/x-www-form-urlencoded").run().assertBody().is("p1=[,,],p2=[0,,0]");
+ a.post("", "").contentType("application/x-www-form-urlencoded").run().assertBody().is("p1=[null,null,null],p2=[0,null,0]");
+ a.post("", "p1").contentType("application/x-www-form-urlencoded").run().assertBody().is("p1=[null,null,null],p2=[0,null,0]");
+ a.post("", "p1=").contentType("application/x-www-form-urlencoded").run().assertBody().is("p1=[,,],p2=[0,null,0]");
+ a.post("", "p2").contentType("application/x-www-form-urlencoded").run().assertBody().is("p1=[null,null,null],p2=[0,null,0]");
+ a.post("", "p2=").contentType("application/x-www-form-urlencoded").run().assertBody().is("p1=[null,null,null],p2=[0,,0]");
+ a.post("", "p1=foo&p2").contentType("application/x-www-form-urlencoded").run().assertBody().is("p1=[foo,foo,foo],p2=[0,null,0]");
+ a.post("", "p1&p2=1").contentType("application/x-www-form-urlencoded").run().assertBody().is("p1=[null,null,null],p2=[1,1,1]");
String x = "a%2Fb%25c%3Dd+e"; // [x/y%z=a+b]
- a.post("", "p1="+x+"&p2=1").contentType("application/x-www-form-urlencoded").execute().assertBody("p1=[a/b%c=d e,a/b%c=d e,a/b%c=d e],p2=[1,1,1]");
+ a.post("", "p1="+x+"&p2=1").contentType("application/x-www-form-urlencoded").run().assertBody().is("p1=[a/b%c=d e,a/b%c=d e,a/b%c=d e],p2=[1,1,1]");
}
//=================================================================================================================
@@ -84,13 +84,13 @@ public class FormDataAnnotationTest {
@Test
public void b01() throws Exception {
- b.post("/post1", "p1=p1").contentType("application/x-www-form-urlencoded").execute().assertBody("p1=[p1,p1,p1]");
- b.post("/post1", "p1='p1'").contentType("application/x-www-form-urlencoded").execute().assertBody("p1=['p1','p1','p1']");
+ b.post("/post1", "p1=p1").contentType("application/x-www-form-urlencoded").run().assertBody().is("p1=[p1,p1,p1]");
+ b.post("/post1", "p1='p1'").contentType("application/x-www-form-urlencoded").run().assertBody().is("p1=['p1','p1','p1']");
}
@Test
public void b02() throws Exception {
- b.post("/post2", "p1=p1").contentType("application/x-www-form-urlencoded").execute().assertBody("p1=[p1,p1,p1]");
- b.post("/post2", "p1='p1'").contentType("application/x-www-form-urlencoded").execute().assertBody("p1=[p1,'p1','p1']");
+ b.post("/post2", "p1=p1").contentType("application/x-www-form-urlencoded").run().assertBody().is("p1=[p1,p1,p1]");
+ b.post("/post2", "p1='p1'").contentType("application/x-www-form-urlencoded").run().assertBody().is("p1=[p1,'p1','p1']");
}
//=================================================================================================================
@@ -132,26 +132,26 @@ public class FormDataAnnotationTest {
@Test
public void c01_defaultFormData() throws Exception {
- c.post("/defaultFormData", null).contentType("application/x-www-form-urlencoded").execute().assertBody("{f1:'1',f2:'2',f3:'3'}");
- c.post("/defaultFormData", null).contentType("application/x-www-form-urlencoded").formData("f1",4).formData("f2",5).formData("f3",6).execute().assertBody("{f1:'4',f2:'5',f3:'6'}");
+ c.post("/defaultFormData", null).contentType("application/x-www-form-urlencoded").run().assertBody().is("{f1:'1',f2:'2',f3:'3'}");
+ c.post("/defaultFormData", null).contentType("application/x-www-form-urlencoded").formData("f1",4).formData("f2",5).formData("f3",6).run().assertBody().is("{f1:'4',f2:'5',f3:'6'}");
}
@Test
public void c02_annotatedFormData() throws Exception {
- c.post("/annotatedFormData", null).contentType("application/x-www-form-urlencoded").execute().assertBody("{f1:null,f2:null,f3:null}");
- c.post("/annotatedFormData", null).contentType("application/x-www-form-urlencoded").formData("f1",4).formData("f2",5).formData("f3",6).execute().assertBody("{f1:'4',f2:'5',f3:'6'}");
+ c.post("/annotatedFormData", null).contentType("application/x-www-form-urlencoded").run().assertBody().is("{f1:null,f2:null,f3:null}");
+ c.post("/annotatedFormData", null).contentType("application/x-www-form-urlencoded").formData("f1",4).formData("f2",5).formData("f3",6).run().assertBody().is("{f1:'4',f2:'5',f3:'6'}");
}
@Test
public void c03_annotatedFormDataDefault() throws Exception {
- c.post("/annotatedFormDataDefault", null).contentType("application/x-www-form-urlencoded").execute().assertBody("{f1:'1',f2:'2',f3:'3'}");
- c.post("/annotatedFormDataDefault", null).contentType("application/x-www-form-urlencoded").formData("f1",4).formData("f2",5).formData("f3",6).execute().assertBody("{f1:'4',f2:'5',f3:'6'}");
+ c.post("/annotatedFormDataDefault", null).contentType("application/x-www-form-urlencoded").run().assertBody().is("{f1:'1',f2:'2',f3:'3'}");
+ c.post("/annotatedFormDataDefault", null).contentType("application/x-www-form-urlencoded").formData("f1",4).formData("f2",5).formData("f3",6).run().assertBody().is("{f1:'4',f2:'5',f3:'6'}");
}
@Test
public void c04_annotatedAndDefaultFormData() throws Exception {
- c.post("/annotatedAndDefaultFormData", null).contentType("application/x-www-form-urlencoded").execute().assertBody("{f1:'4',f2:'5',f3:'6'}");
- c.post("/annotatedAndDefaultFormData", null).contentType("application/x-www-form-urlencoded").formData("f1",7).formData("f2",8).formData("f3",9).execute().assertBody("{f1:'7',f2:'8',f3:'9'}");
+ c.post("/annotatedAndDefaultFormData", null).contentType("application/x-www-form-urlencoded").run().assertBody().is("{f1:'4',f2:'5',f3:'6'}");
+ c.post("/annotatedAndDefaultFormData", null).contentType("application/x-www-form-urlencoded").formData("f1",7).formData("f2",8).formData("f3",9).run().assertBody().is("{f1:'7',f2:'8',f3:'9'}");
}
//=================================================================================================================
@@ -184,26 +184,26 @@ public class FormDataAnnotationTest {
@Test
public void d01_optionalParam_integer() throws Exception {
- d.post("/a", "f1=123").execute().assertStatus(200).assertBody("123");
- d.post("/a", "null").execute().assertStatus(200).assertBody("null");
+ d.post("/a", "f1=123").run().assertStatus().equals(200).assertBody().is("123");
+ d.post("/a", "null").run().assertStatus().equals(200).assertBody().is("null");
}
@Test
public void d02_optionalParam_bean() throws Exception {
- d.post("/b", "f1=a=1,b=foo").execute().assertStatus(200).assertBody("{a:1,b:'foo'}");
- d.post("/b", "null").execute().assertStatus(200).assertBody("null");
+ d.post("/b", "f1=a=1,b=foo").run().assertStatus().equals(200).assertBody().is("{a:1,b:'foo'}");
+ d.post("/b", "null").run().assertStatus().equals(200).assertBody().is("null");
}
@Test
public void d03_optionalParam_listOfBeans() throws Exception {
- d.post("/c", "f1=@((a=1,b=foo))").execute().assertStatus(200).assertBody("[{a:1,b:'foo'}]");
- d.post("/c", "null").execute().assertStatus(200).assertBody("null");
+ d.post("/c", "f1=@((a=1,b=foo))").run().assertStatus().equals(200).assertBody().is("[{a:1,b:'foo'}]");
+ d.post("/c", "null").run().assertStatus().equals(200).assertBody().is("null");
}
@Test
public void d04_optionalParam_listOfOptionals() throws Exception {
- d.post("/d", "f1=@((a=1,b=foo))").execute().assertStatus(200).assertBody("[{a:1,b:'foo'}]");
- d.post("/d", "null").execute().assertStatus(200).assertBody("null");
+ d.post("/d", "f1=@((a=1,b=foo))").run().assertStatus().equals(200).assertBody().is("[{a:1,b:'foo'}]");
+ d.post("/d", "null").run().assertStatus().equals(200).assertBody().is("null");
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/HasFormDataAnnotationTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/HasFormDataAnnotationTest.java
index 5eaafb2..dc3c09c 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/HasFormDataAnnotationTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/HasFormDataAnnotationTest.java
@@ -40,17 +40,17 @@ public class HasFormDataAnnotationTest {
@Test
public void a01_post() throws Exception {
- a.post("", "p1=p1&p2=2").execute().assertBody("p1=[true,true],p2=[true,true]");
- a.post("", "p1&p2").execute().assertBody("p1=[true,true],p2=[true,true]");
- a.post("", "p1=&p2=").execute().assertBody("p1=[true,true],p2=[true,true]");
- a.post("", null).execute().assertBody("p1=[false,false],p2=[false,false]");
- a.post("", "p1").execute().assertBody("p1=[true,true],p2=[false,false]");
- a.post("", "p1=").execute().assertBody("p1=[true,true],p2=[false,false]");
- a.post("", "p2").execute().assertBody("p1=[false,false],p2=[true,true]");
- a.post("", "p2=").execute().assertBody("p1=[false,false],p2=[true,true]");
- a.post("", "p1=foo&p2").execute().assertBody("p1=[true,true],p2=[true,true]");
- a.post("", "p1&p2=1").execute().assertBody("p1=[true,true],p2=[true,true]");
+ a.post("", "p1=p1&p2=2").run().assertBody().is("p1=[true,true],p2=[true,true]");
+ a.post("", "p1&p2").run().assertBody().is("p1=[true,true],p2=[true,true]");
+ a.post("", "p1=&p2=").run().assertBody().is("p1=[true,true],p2=[true,true]");
+ a.post("", null).run().assertBody().is("p1=[false,false],p2=[false,false]");
+ a.post("", "p1").run().assertBody().is("p1=[true,true],p2=[false,false]");
+ a.post("", "p1=").run().assertBody().is("p1=[true,true],p2=[false,false]");
+ a.post("", "p2").run().assertBody().is("p1=[false,false],p2=[true,true]");
+ a.post("", "p2=").run().assertBody().is("p1=[false,false],p2=[true,true]");
+ a.post("", "p1=foo&p2").run().assertBody().is("p1=[true,true],p2=[true,true]");
+ a.post("", "p1&p2=1").run().assertBody().is("p1=[true,true],p2=[true,true]");
String x = "a%2Fb%25c%3Dd+e"; // [x/y%z=a+b]
- a.post("", "p1="+x+"&p2=1").execute().assertBody("p1=[true,true],p2=[true,true]");
+ a.post("", "p1="+x+"&p2=1").run().assertBody().is("p1=[true,true],p2=[true,true]");
}
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/HasQueryAnnotationTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/HasQueryAnnotationTest.java
index ca4d82e..d7dadf7 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/HasQueryAnnotationTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/HasQueryAnnotationTest.java
@@ -45,32 +45,32 @@ public class HasQueryAnnotationTest {
@Test
public void a01_get() throws Exception {
- a.get("?p1=p1&p2=2").execute().assertBody("p1=[true,true],p2=[true,true]");
- a.get("?p1&p2").execute().assertBody("p1=[true,true],p2=[true,true]");
- a.get("?p1=&p2=").execute().assertBody("p1=[true,true],p2=[true,true]");
- a.get("/").execute().assertBody("p1=[false,false],p2=[false,false]");
- a.get("?p1").execute().assertBody("p1=[true,true],p2=[false,false]");
- a.get("?p1=").execute().assertBody("p1=[true,true],p2=[false,false]");
- a.get("?p2").execute().assertBody("p1=[false,false],p2=[true,true]");
- a.get("?p2=").execute().assertBody("p1=[false,false],p2=[true,true]");
- a.get("?p1=foo&p2").execute().assertBody("p1=[true,true],p2=[true,true]");
- a.get("?p1&p2=1").execute().assertBody("p1=[true,true],p2=[true,true]");
+ a.get("?p1=p1&p2=2").run().assertBody().is("p1=[true,true],p2=[true,true]");
+ a.get("?p1&p2").run().assertBody().is("p1=[true,true],p2=[true,true]");
+ a.get("?p1=&p2=").run().assertBody().is("p1=[true,true],p2=[true,true]");
+ a.get("/").run().assertBody().is("p1=[false,false],p2=[false,false]");
+ a.get("?p1").run().assertBody().is("p1=[true,true],p2=[false,false]");
+ a.get("?p1=").run().assertBody().is("p1=[true,true],p2=[false,false]");
+ a.get("?p2").run().assertBody().is("p1=[false,false],p2=[true,true]");
+ a.get("?p2=").run().assertBody().is("p1=[false,false],p2=[true,true]");
+ a.get("?p1=foo&p2").run().assertBody().is("p1=[true,true],p2=[true,true]");
+ a.get("?p1&p2=1").run().assertBody().is("p1=[true,true],p2=[true,true]");
String x = "a%2Fb%25c%3Dd+e"; // [x/y%z=a+b]
- a.get("?p1="+x+"&p2=1").execute().assertBody("p1=[true,true],p2=[true,true]");
+ a.get("?p1="+x+"&p2=1").run().assertBody().is("p1=[true,true],p2=[true,true]");
}
@Test
public void a02_post() throws Exception {
- a.post("?p1=p1&p2=2", null).execute().assertBody("p1=[true,true],p2=[true,true]");
- a.post("?p1&p2", null).execute().assertBody("p1=[true,true],p2=[true,true]");
- a.post("?p1=&p2=", null).execute().assertBody("p1=[true,true],p2=[true,true]");
- a.post("/", null).execute().assertBody("p1=[false,false],p2=[false,false]");
- a.post("?p1", null).execute().assertBody("p1=[true,true],p2=[false,false]");
- a.post("?p1=", null).execute().assertBody("p1=[true,true],p2=[false,false]");
- a.post("?p2", null).execute().assertBody("p1=[false,false],p2=[true,true]");
- a.post("?p2=", null).execute().assertBody("p1=[false,false],p2=[true,true]");
- a.post("?p1=foo&p2", null).execute().assertBody("p1=[true,true],p2=[true,true]");
- a.post("?p1&p2=1", null).execute().assertBody("p1=[true,true],p2=[true,true]");
+ a.post("?p1=p1&p2=2", null).run().assertBody().is("p1=[true,true],p2=[true,true]");
+ a.post("?p1&p2", null).run().assertBody().is("p1=[true,true],p2=[true,true]");
+ a.post("?p1=&p2=", null).run().assertBody().is("p1=[true,true],p2=[true,true]");
+ a.post("/", null).run().assertBody().is("p1=[false,false],p2=[false,false]");
+ a.post("?p1", null).run().assertBody().is("p1=[true,true],p2=[false,false]");
+ a.post("?p1=", null).run().assertBody().is("p1=[true,true],p2=[false,false]");
+ a.post("?p2", null).run().assertBody().is("p1=[false,false],p2=[true,true]");
+ a.post("?p2=", null).run().assertBody().is("p1=[false,false],p2=[true,true]");
+ a.post("?p1=foo&p2", null).run().assertBody().is("p1=[true,true],p2=[true,true]");
+ a.post("?p1&p2=1", null).run().assertBody().is("p1=[true,true],p2=[true,true]");
String x = "a%2Fb%25c%3Dd+e"; // [x/y%z=a+b]
- a.post("?p1="+x+"&p2=1", null).execute().assertBody("p1=[true,true],p2=[true,true]");
+ a.post("?p1="+x+"&p2=1", null).run().assertBody().is("p1=[true,true],p2=[true,true]");
}
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/HeaderAnnotationTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/HeaderAnnotationTest.java
index 80a80ae..4cf14ad 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/HeaderAnnotationTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/HeaderAnnotationTest.java
@@ -60,26 +60,26 @@ public class HeaderAnnotationTest {
@Test
public void a01_optionalParam_integer() throws Exception {
- a.get("/a").header("f1", 123).execute().assertStatus(200).assertBody("123");
- a.get("/a").execute().assertStatus(200).assertBody("null");
+ a.get("/a").header("f1", 123).run().assertStatus().equals(200).assertBody().is("123");
+ a.get("/a").run().assertStatus().equals(200).assertBody().is("null");
}
@Test
public void a02_optionalParam_bean() throws Exception {
- a.get("/b").header("f1", "a=1,b=foo").execute().assertStatus(200).assertBody("{a:1,b:'foo'}");
- a.get("/b").execute().assertStatus(200).assertBody("null");
+ a.get("/b").header("f1", "a=1,b=foo").run().assertStatus().equals(200).assertBody().is("{a:1,b:'foo'}");
+ a.get("/b").run().assertStatus().equals(200).assertBody().is("null");
}
@Test
public void a03_optionalParam_listOfBeans() throws Exception {
- a.get("/c").header("f1", "@((a=1,b=foo))").execute().assertStatus(200).assertBody("[{a:1,b:'foo'}]");
- a.get("/c").execute().assertStatus(200).assertBody("null");
+ a.get("/c").header("f1", "@((a=1,b=foo))").run().assertStatus().equals(200).assertBody().is("[{a:1,b:'foo'}]");
+ a.get("/c").run().assertStatus().equals(200).assertBody().is("null");
}
@Test
public void a04_optionalParam_listOfOptionals() throws Exception {
- a.get("/d").header("f1", "@((a=1,b=foo))").execute().assertStatus(200).assertBody("[{a:1,b:'foo'}]");
- a.get("/d").execute().assertStatus(200).assertBody("null");
+ a.get("/d").header("f1", "@((a=1,b=foo))").run().assertStatus().equals(200).assertBody().is("[{a:1,b:'foo'}]");
+ a.get("/d").run().assertStatus().equals(200).assertBody().is("null");
}
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 5b298ee..d1b02d5 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
@@ -64,28 +64,28 @@ public class PathAnnotationTest {
@Test
public void a00_nonExistentPath() throws Exception {
- a.get("/bad?noTrace=true").execute().assertStatus(404);
+ a.get("/bad?noTrace=true").run().assertStatus().equals(404);
}
@Test
public void a01_noPath() throws Exception {
- a.get(null).execute().assertBody("GET");
- a.get().execute().assertBody("GET");
+ a.get(null).run().assertBody().is("GET");
+ a.get().run().assertBody().is("GET");
}
@Test
public void a02_simplePath() throws Exception {
- a.get("/a").execute().assertBody("GET /a");
+ a.get("/a").run().assertBody().is("GET /a");
}
@Test
public void a03_simplePathOneVar() throws Exception {
- a.get("/a/foo").execute().assertBody("GET /a foo");
+ a.get("/a/foo").run().assertBody().is("GET /a foo");
}
@Test
public void a04_simplePathTwoVars() throws Exception {
- a.get("/a/foo/bar").execute().assertBody("GET /a foo,bar");
+ a.get("/a/foo/bar").run().assertBody().is("GET /a foo,bar");
}
@Test
public void a05_simplePathWithRemainder() throws Exception {
- a.get("/a/foo/123/baz").execute().assertBody("GET /a foo,123,r=baz");
+ a.get("/a/foo/123/baz").run().assertBody().is("GET /a foo,123,r=baz");
}
@Test
public void a06_urlEncodedPathPart() throws Exception {
@@ -93,8 +93,8 @@ public class PathAnnotationTest {
// This should match /get1/{foo} and not /get1/{foo}/{bar}
// NOTE: When testing on Tomcat, must specify the following system property:
// -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true
- a.get("/a/x%2Fy").execute().assertBody("GET /a x/y");
- a.get("/a/x%2Fy/x%2Fy").execute().assertBody("GET /a x/y,x/y");
+ a.get("/a/x%2Fy").run().assertBody().is("GET /a x/y");
+ a.get("/a/x%2Fy/x%2Fy").run().assertBody().is("GET /a x/y,x/y");
}
//=================================================================================================================
@@ -140,43 +140,43 @@ public class PathAnnotationTest {
@Test
public void b01_int() throws Exception {
- b.get("/int/123/foo").execute().assertBody("123");
- b.get("/int/bad/foo?noTrace=true").execute().assertStatus(400);
+ b.get("/int/123/foo").run().assertBody().is("123");
+ b.get("/int/bad/foo?noTrace=true").run().assertStatus().equals(400);
}
@Test
public void b02_short() throws Exception {
- b.get("/short/123/foo").execute().assertBody("123");
- b.get("/short/bad/foo?noTrace=true").execute().assertStatus(400);
+ b.get("/short/123/foo").run().assertBody().is("123");
+ b.get("/short/bad/foo?noTrace=true").run().assertStatus().equals(400);
}
@Test
public void b03_long() throws Exception {
- b.get("/long/123/foo").execute().assertBody("123");
- b.get("/long/bad/foo?noTrace=true").execute().assertStatus(400);
+ b.get("/long/123/foo").run().assertBody().is("123");
+ b.get("/long/bad/foo?noTrace=true").run().assertStatus().equals(400);
}
@Test
public void b04_char() throws Exception {
- b.get("/char/c/foo").execute().assertBody("c");
- b.get("/char/bad/foo?noTrace=true").execute().assertStatus(400);
+ b.get("/char/c/foo").run().assertBody().is("c");
+ b.get("/char/bad/foo?noTrace=true").run().assertStatus().equals(400);
}
@Test
public void b05_float() throws Exception {
- b.get("/float/1.23/foo").execute().assertBody("1.23");
- b.get("/float/bad/foo?noTrace=true").execute().assertStatus(400);
+ b.get("/float/1.23/foo").run().assertBody().is("1.23");
+ b.get("/float/bad/foo?noTrace=true").run().assertStatus().equals(400);
}
@Test
public void b06_double() throws Exception {
- b.get("/double/1.23/foo").execute().assertBody("1.23");
- b.get("/double/bad/foo?noTrace=true").execute().assertStatus(400);
+ b.get("/double/1.23/foo").run().assertBody().is("1.23");
+ b.get("/double/bad/foo?noTrace=true").run().assertStatus().equals(400);
}
@Test
public void b07_byte() throws Exception {
- b.get("/byte/123/foo").execute().assertBody("123");
- b.get("/byte/bad/foo?noTrace=true").execute().assertStatus(400);
+ b.get("/byte/123/foo").run().assertBody().is("123");
+ b.get("/byte/bad/foo?noTrace=true").run().assertStatus().equals(400);
}
@Test
public void b08_boolean() throws Exception {
- b.get("/boolean/true/foo").execute().assertBody("true");
- b.get("/boolean/bad/foo?noTrace=true").execute().assertStatus(400);
+ b.get("/boolean/true/foo").run().assertBody().is("true");
+ b.get("/boolean/bad/foo?noTrace=true").run().assertStatus().equals(400);
}
//=================================================================================================================
@@ -222,43 +222,43 @@ public class PathAnnotationTest {
@Test
public void c01_Integer() throws Exception {
- c.get("/Integer/123/foo").execute().assertBody("123");
- c.get("/Integer/bad/foo?noTrace=true").execute().assertStatus(400);
+ c.get("/Integer/123/foo").run().assertBody().is("123");
+ c.get("/Integer/bad/foo?noTrace=true").run().assertStatus().equals(400);
}
@Test
public void c02_Short() throws Exception {
- c.get("/Short/123/foo").execute().assertBody("123");
- c.get("/Short/bad/foo?noTrace=true").execute().assertStatus(400);
+ c.get("/Short/123/foo").run().assertBody().is("123");
+ c.get("/Short/bad/foo?noTrace=true").run().assertStatus().equals(400);
}
@Test
public void c03_Long() throws Exception {
- c.get("/Long/123/foo").execute().assertBody("123");
- c.get("/Long/bad/foo?noTrace=true").execute().assertStatus(400);
+ c.get("/Long/123/foo").run().assertBody().is("123");
+ c.get("/Long/bad/foo?noTrace=true").run().assertStatus().equals(400);
}
@Test
public void c04_Char() throws Exception {
- c.get("/Character/c/foo").execute().assertBody("c");
- c.get("/Character/bad/foo?noTrace=true").execute().assertStatus(400);
+ c.get("/Character/c/foo").run().assertBody().is("c");
+ c.get("/Character/bad/foo?noTrace=true").run().assertStatus().equals(400);
}
@Test
public void c05_Float() throws Exception {
- c.get("/Float/1.23/foo").execute().assertBody("1.23");
- c.get("/Float/bad/foo?noTrace=true").execute().assertStatus(400);
+ c.get("/Float/1.23/foo").run().assertBody().is("1.23");
+ c.get("/Float/bad/foo?noTrace=true").run().assertStatus().equals(400);
}
@Test
public void c06_Double() throws Exception {
- c.get("/Double/1.23/foo").execute().assertBody("1.23");
- c.get("/Double/bad/foo?noTrace=true").execute().assertStatus(400);
+ c.get("/Double/1.23/foo").run().assertBody().is("1.23");
+ c.get("/Double/bad/foo?noTrace=true").run().assertStatus().equals(400);
}
@Test
public void c07_Byte() throws Exception {
- c.get("/Byte/123/foo").execute().assertBody("123");
- c.get("/Byte/bad/foo?noTrace=true").execute().assertStatus(400);
+ c.get("/Byte/123/foo").run().assertBody().is("123");
+ c.get("/Byte/bad/foo?noTrace=true").run().assertStatus().equals(400);
}
@Test
public void c08_Boolean() throws Exception {
- c.get("/Boolean/true/foo").execute().assertBody("true");
- c.get("/Boolean/bad/foo?noTrace=true").execute().assertStatus(400);
+ c.get("/Boolean/true/foo").run().assertBody().is("true");
+ c.get("/Boolean/bad/foo?noTrace=true").run().assertStatus().equals(400);
}
//=================================================================================================================
@@ -278,7 +278,7 @@ public class PathAnnotationTest {
@Test
public void d01_uuid() throws Exception {
UUID uuid = UUID.randomUUID();
- d.get("/uuid/" + uuid).execute().assertBody(uuid.toString());
+ d.get("/uuid/" + uuid).run().assertBody().is(uuid.toString());
}
//=================================================================================================================
@@ -312,23 +312,23 @@ public class PathAnnotationTest {
@Test
public void e01_normal1() throws Exception {
- e.get("/x/x1/x2").execute().assertBody("{m:'normal1',foo:'x1',bar:'x2'}");
+ e.get("/x/x1/x2").run().assertBody().is("{m:'normal1',foo:'x1',bar:'x2'}");
}
@Test
public void e02_normal2() throws Exception {
- e.get("/x/x1/x/x2/x").execute().assertBody("{m:'normal2',foo:'x1',bar:'x2'}");
+ e.get("/x/x1/x/x2/x").run().assertBody().is("{m:'normal2',foo:'x1',bar:'x2'}");
}
@Test
public void e03_numbers1() throws Exception {
- e.get("/y/y1/y2").execute().assertBody("{m:'numbers1','0':'y1','1':'y2'}");
+ e.get("/y/y1/y2").run().assertBody().is("{m:'numbers1','0':'y1','1':'y2'}");
}
@Test
public void e04_numbers2() throws Exception {
- e.get("/y/y1/y/y2/y").execute().assertBody("{m:'numbers2','0':'y1','1':'y2'}");
+ e.get("/y/y1/y/y2/y").run().assertBody().is("{m:'numbers2','0':'y1','1':'y2'}");
}
@Test
public void e05_numbers3() throws Exception {
- e.get("/z/z1/z/z2/z").execute().assertBody("{m:'numbers3','0':'z2','1':'z1'}");
+ e.get("/z/z1/z/z2/z").run().assertBody().is("{m:'numbers3','0':'z2','1':'z1'}");
}
//=================================================================================================================
@@ -369,78 +369,78 @@ public class PathAnnotationTest {
@Test
public void f01a_noPath() throws Exception {
- f.get("/f/x1/x2").execute().assertBody("noPath: {a:'x1',b:'x2'}");
+ f.get("/f/x1/x2").run().assertBody().is("noPath: {a:'x1',b:'x2'}");
}
@Test
public void f01b_incompletePath() throws Exception {
- f.get("/f/x1").execute().assertStatus(404);
- f.get("/f").execute().assertStatus(404);
+ f.get("/f/x1").run().assertStatus().equals(404);
+ f.get("/f").run().assertStatus().equals(404);
}
@Test
public void f01c_noPath_blanks() throws Exception {
- f.get("/f//").execute().assertStatus(404);
- f.get("/f/x/").execute().assertStatus(404);
- f.get("/f//x").execute().assertStatus(404);
+ f.get("/f//").run().assertStatus().equals(404);
+ f.get("/f/x/").run().assertStatus().equals(404);
+ f.get("/f//x").run().assertStatus().equals(404);
}
@Test
public void f02a_noPath2() throws Exception {
- f.get("/f/x1/x2/foo").execute().assertBody("noPath2: {'/*':'foo','/**':'foo',a:'x1',b:'x2'}");
+ f.get("/f/x1/x2/foo").run().assertBody().is("noPath2: {'/*':'foo','/**':'foo',a:'x1',b:'x2'}");
}
@Test
public void f02b_noPath2_blanks() throws Exception {
- f.get("/f///foo").execute().assertStatus(404);
- f.get("/f/x1//foo").execute().assertStatus(404);
- f.get("/f//x2/foo").execute().assertStatus(404);
+ f.get("/f///foo").run().assertStatus().equals(404);
+ f.get("/f/x1//foo").run().assertStatus().equals(404);
+ f.get("/f//x2/foo").run().assertStatus().equals(404);
}
@Test
public void f03a_noVars() throws Exception {
- f.get("/f/x1/x2/a").execute().assertBody("noVars: {a:'x1',b:'x2'}");
+ f.get("/f/x1/x2/a").run().assertBody().is("noVars: {a:'x1',b:'x2'}");
}
@Test
public void f03b_noVars_blanks() throws Exception {
- f.get("/f///a").execute().assertStatus(404);
- f.get("/f/x1//a").execute().assertStatus(404);
- f.get("/f//x2/a").execute().assertStatus(404);
+ f.get("/f///a").run().assertStatus().equals(404);
+ f.get("/f/x1//a").run().assertStatus().equals(404);
+ f.get("/f//x2/a").run().assertStatus().equals(404);
}
@Test
public void f04a_twoVars() throws Exception {
- f.get("/f/x1/x2/b/x3/x4").execute().assertBody("twoVars: {a:'x1',b:'x2',c:'x3',d:'x4'}");
+ f.get("/f/x1/x2/b/x3/x4").run().assertBody().is("twoVars: {a:'x1',b:'x2',c:'x3',d:'x4'}");
}
@Test
public void f04b_twoVars_blanks() throws Exception {
- f.get("/f//x2/b/x3/x4").execute().assertStatus(404);
- f.get("/f/x1//b/x3/x4").execute().assertStatus(404);
- f.get("/f/x1/x2/b//x4").execute().assertStatus(200);
- f.get("/f/x1/x2/b/x3/").execute().assertStatus(200);
- f.get("/f///b//").execute().assertStatus(404);
+ f.get("/f//x2/b/x3/x4").run().assertStatus().equals(404);
+ f.get("/f/x1//b/x3/x4").run().assertStatus().equals(404);
+ f.get("/f/x1/x2/b//x4").run().assertStatus().equals(200);
+ f.get("/f/x1/x2/b/x3/").run().assertStatus().equals(200);
+ f.get("/f///b//").run().assertStatus().equals(404);
}
@Test
public void f05_twoVarsOverlapping() throws Exception {
- f.get("/f/x1/x2/c/x3/x4").execute().assertBody("twoVarsOverlapping: {a:'x3',b:'x4'}");
+ f.get("/f/x1/x2/c/x3/x4").run().assertBody().is("twoVarsOverlapping: {a:'x3',b:'x4'}");
}
@Test
public void f06a_withRemainder() throws Exception {
- f.get("/f/x1/x2/d/x3/x4").execute().assertBody("withRemainder: {a:'x1',b:'x2',c:'x3',d:'x4'}");
+ f.get("/f/x1/x2/d/x3/x4").run().assertBody().is("withRemainder: {a:'x1',b:'x2',c:'x3',d:'x4'}");
}
@Test
public void f06b_withRemainder_lank() throws Exception {
- f.get("/f/x1/x2/d/x3/x4/").execute().assertBody("withRemainder: {'/*':'','/**':'',a:'x1',b:'x2',c:'x3',d:'x4'}");
+ f.get("/f/x1/x2/d/x3/x4/").run().assertBody().is("withRemainder: {'/*':'','/**':'',a:'x1',b:'x2',c:'x3',d:'x4'}");
}
@Test
public void f06c_withRemainderWithStuff() throws Exception {
- f.get("/f/x1/x2/d/x3/x4/foo/bar").execute().assertBody("withRemainder: {'/*':'foo/bar','/**':'foo/bar',a:'x1',b:'x2',c:'x3',d:'x4'}");
+ f.get("/f/x1/x2/d/x3/x4/foo/bar").run().assertBody().is("withRemainder: {'/*':'foo/bar','/**':'foo/bar',a:'x1',b:'x2',c:'x3',d:'x4'}");
}
//=================================================================================================================
@@ -454,66 +454,66 @@ public class PathAnnotationTest {
@Test
public void g01a_noPath() throws Exception {
- g.get("/f/x1/x2").execute().assertBody("noPath: {a:'x1',b:'x2'}");
+ g.get("/f/x1/x2").run().assertBody().is("noPath: {a:'x1',b:'x2'}");
}
@Test
public void g01b_incompletePath() throws Exception {
- g.get("/f/x1").execute().assertStatus(404);
- g.get("/f").execute().assertStatus(404);
+ g.get("/f/x1").run().assertStatus().equals(404);
+ g.get("/f").run().assertStatus().equals(404);
}
@Test
public void g01c_noPath_blanks() throws Exception {
- g.get("/f//").execute().assertStatus(404);
- g.get("/f/x1/").execute().assertStatus(404);
- g.get("/f//x2").execute().assertStatus(404);
+ g.get("/f//").run().assertStatus().equals(404);
+ g.get("/f/x1/").run().assertStatus().equals(404);
+ g.get("/f//x2").run().assertStatus().equals(404);
}
@Test
public void g02a_noVars() throws Exception {
- g.get("/f/x1/x2/a").execute().assertBody("noVars: {a:'x1',b:'x2'}");
+ g.get("/f/x1/x2/a").run().assertBody().is("noVars: {a:'x1',b:'x2'}");
}
@Test
public void g02b_noVars_blanks() throws Exception {
- g.get("/f///a").execute().assertStatus(404);
- g.get("/f/x1//a").execute().assertStatus(404);
- g.get("/f//x2/a").execute().assertStatus(404);
+ g.get("/f///a").run().assertStatus().equals(404);
+ g.get("/f/x1//a").run().assertStatus().equals(404);
+ g.get("/f//x2/a").run().assertStatus().equals(404);
}
@Test
public void g03a_twoVars() throws Exception {
- g.get("/f/x1/x2/b/x3/x4").execute().assertBody("twoVars: {a:'x1',b:'x2',c:'x3',d:'x4'}");
+ g.get("/f/x1/x2/b/x3/x4").run().assertBody().is("twoVars: {a:'x1',b:'x2',c:'x3',d:'x4'}");
}
@Test
public void g03b_twoVars_blanks() throws Exception {
- g.get("/f//x2/b/x3/x4").execute().assertStatus(404);
- g.get("/f/x1//b/x3/x4").execute().assertStatus(404);
- g.get("/f/x1/x2/b//x4").execute().assertStatus(200);
- g.get("/f/x1/x2/b/x3/").execute().assertStatus(200);
- g.get("/f///b//").execute().assertStatus(404);
+ g.get("/f//x2/b/x3/x4").run().assertStatus().equals(404);
+ g.get("/f/x1//b/x3/x4").run().assertStatus().equals(404);
+ g.get("/f/x1/x2/b//x4").run().assertStatus().equals(200);
+ g.get("/f/x1/x2/b/x3/").run().assertStatus().equals(200);
+ g.get("/f///b//").run().assertStatus().equals(404);
}
@Test
public void g04_twoVarsOverlapping() throws Exception {
- g.get("/f/x1/x2/c/x3/x4").execute().assertBody("twoVarsOverlapping: {a:'x3',b:'x4'}");
+ g.get("/f/x1/x2/c/x3/x4").run().assertBody().is("twoVarsOverlapping: {a:'x3',b:'x4'}");
}
@Test
public void g05a_withRemainder() throws Exception {
- g.get("/f/x1/x2/d/x3/x4").execute().assertBody("withRemainder: {a:'x1',b:'x2',c:'x3',d:'x4'}");
+ g.get("/f/x1/x2/d/x3/x4").run().assertBody().is("withRemainder: {a:'x1',b:'x2',c:'x3',d:'x4'}");
}
@Test
public void g05b_withRemainderBlank() throws Exception {
- g.get("/f/x1/x2/d/x3/x4/").execute().assertBody("withRemainder: {'/*':'','/**':'',a:'x1',b:'x2',c:'x3',d:'x4'}");
+ g.get("/f/x1/x2/d/x3/x4/").run().assertBody().is("withRemainder: {'/*':'','/**':'',a:'x1',b:'x2',c:'x3',d:'x4'}");
}
@Test
public void g05c_withRemainderWithStuff() throws Exception {
- g.get("/f/x1/x2/d/x3/x4/foo/bar").execute().assertBody("withRemainder: {'/*':'foo/bar','/**':'foo/bar',a:'x1',b:'x2',c:'x3',d:'x4'}");
+ g.get("/f/x1/x2/d/x3/x4/foo/bar").run().assertBody().is("withRemainder: {'/*':'foo/bar','/**':'foo/bar',a:'x1',b:'x2',c:'x3',d:'x4'}");
}
//=================================================================================================================
@@ -527,79 +527,79 @@ public class PathAnnotationTest {
@Test
public void h01a_noPath() throws Exception {
- h.get("/h/ha1/hb1/f/x1/x2").execute().assertBody("noPath: {a:'x1',b:'x2',ha:'ha1',hb:'hb1'}");
+ h.get("/h/ha1/hb1/f/x1/x2").run().assertBody().is("noPath: {a:'x1',b:'x2',ha:'ha1',hb:'hb1'}");
}
@Test
public void h01b_incompletePath() throws Exception {
// These are 405 instead of 404 because when children don't match, we try to find a matching Java method.
- h.get("/h/ha1/hb1/f/x1").execute().assertStatus(404);
- h.get("/h/ha1/hb1/f").execute().assertStatus(404);
- h.get("/h/ha1/hb1").execute().assertStatus(404);
- h.get("/h/ha1").execute().assertStatus(404);
- h.get("/h").execute().assertStatus(404);
+ h.get("/h/ha1/hb1/f/x1").run().assertStatus().equals(404);
+ h.get("/h/ha1/hb1/f").run().assertStatus().equals(404);
+ h.get("/h/ha1/hb1").run().assertStatus().equals(404);
+ h.get("/h/ha1").run().assertStatus().equals(404);
+ h.get("/h").run().assertStatus().equals(404);
}
@Test
public void h01c_noPath_blanks() throws Exception {
- h.get("/h//hb1/f/x1/x2").execute().assertStatus(404);
- h.get("/h/ha1//f/x1/x2").execute().assertStatus(404);
- h.get("/h/ha1/hb1/f//x2").execute().assertStatus(404);
- h.get("/h/ha1/hb1/f/x1/").execute().assertStatus(404);
- h.get("/h///f//").execute().assertStatus(404);
+ h.get("/h//hb1/f/x1/x2").run().assertStatus().equals(404);
+ h.get("/h/ha1//f/x1/x2").run().assertStatus().equals(404);
+ h.get("/h/ha1/hb1/f//x2").run().assertStatus().equals(404);
+ h.get("/h/ha1/hb1/f/x1/").run().assertStatus().equals(404);
+ h.get("/h///f//").run().assertStatus().equals(404);
}
@Test
public void h02a_noPath2() throws Exception {
- h.get("/h/ha1/hb1/f/x1/x2/foo").execute().assertBody("noPath2: {'/*':'foo','/**':'foo',a:'x1',b:'x2',ha:'ha1',hb:'hb1'}");
+ h.get("/h/ha1/hb1/f/x1/x2/foo").run().assertBody().is("noPath2: {'/*':'foo','/**':'foo',a:'x1',b:'x2',ha:'ha1',hb:'hb1'}");
}
@Test
public void h02b_noPath2_blanks() throws Exception {
- h.get("/h//hb1/f/x1/x2/foo").execute().assertStatus(404);
- h.get("/h/ha1//f/x1/x2/foo").execute().assertStatus(404);
- h.get("/h/ha1/hb1/f//x2/foo").execute().assertStatus(404);
- h.get("/h/ha1/hb1/f/x1//foo").execute().assertStatus(404);
- h.get("/h///f///foo").execute().assertStatus(404);
+ h.get("/h//hb1/f/x1/x2/foo").run().assertStatus().equals(404);
+ h.get("/h/ha1//f/x1/x2/foo").run().assertStatus().equals(404);
+ h.get("/h/ha1/hb1/f//x2/foo").run().assertStatus().equals(404);
+ h.get("/h/ha1/hb1/f/x1//foo").run().assertStatus().equals(404);
+ h.get("/h///f///foo").run().assertStatus().equals(404);
}
@Test
public void h03a_noVars() throws Exception {
- h.get("/h/ha1/hb1/f/x1/x2/a").execute().assertBody("noVars: {a:'x1',b:'x2',ha:'ha1',hb:'hb1'}");
+ h.get("/h/ha1/hb1/f/x1/x2/a").run().assertBody().is("noVars: {a:'x1',b:'x2',ha:'ha1',hb:'hb1'}");
}
@Test
public void h03b_noVars_blanks() throws Exception {
- h.get("/h//hb1/f/x1/x2/a").execute().assertStatus(404);
- h.get("/h/ha1//f/x1/x2/a").execute().assertStatus(404);
- h.get("/h/ha1/hb1/f//x2/a").execute().assertStatus(404);
- h.get("/h/ha1/hb1/f/x1//a").execute().assertStatus(404);
- h.get("/h///f///a").execute().assertStatus(404);
+ h.get("/h//hb1/f/x1/x2/a").run().assertStatus().equals(404);
+ h.get("/h/ha1//f/x1/x2/a").run().assertStatus().equals(404);
+ h.get("/h/ha1/hb1/f//x2/a").run().assertStatus().equals(404);
+ h.get("/h/ha1/hb1/f/x1//a").run().assertStatus().equals(404);
+ h.get("/h///f///a").run().assertStatus().equals(404);
}
@Test
public void h04_twoVars() throws Exception {
- h.get("/h/ha1/hb1/f/x1/x2/b/x3/x4").execute().assertBody("twoVars: {a:'x1',b:'x2',c:'x3',d:'x4',ha:'ha1',hb:'hb1'}");
+ h.get("/h/ha1/hb1/f/x1/x2/b/x3/x4").run().assertBody().is("twoVars: {a:'x1',b:'x2',c:'x3',d:'x4',ha:'ha1',hb:'hb1'}");
}
@Test
public void h05_twoVarsOverlapping() throws Exception {
- h.get("/h/ha1/hb1/f/x1/x2/c/x3/x4").execute().assertBody("twoVarsOverlapping: {a:'x3',b:'x4',ha:'ha1',hb:'hb1'}");
+ h.get("/h/ha1/hb1/f/x1/x2/c/x3/x4").run().assertBody().is("twoVarsOverlapping: {a:'x3',b:'x4',ha:'ha1',hb:'hb1'}");
}
@Test
public void h06a_withRemainder() throws Exception {
- h.get("/h/ha1/hb1/f/x1/x2/d/x3/x4").execute().assertBody("withRemainder: {a:'x1',b:'x2',c:'x3',d:'x4',ha:'ha1',hb:'hb1'}");
+ h.get("/h/ha1/hb1/f/x1/x2/d/x3/x4").run().assertBody().is("withRemainder: {a:'x1',b:'x2',c:'x3',d:'x4',ha:'ha1',hb:'hb1'}");
}
@Test
public void h06b_withRemainderBlank() throws Exception {
- h.get("/h/ha1/hb1/f/x1/x2/d/x3/x4/").execute().assertBody("withRemainder: {'/*':'','/**':'',a:'x1',b:'x2',c:'x3',d:'x4',ha:'ha1',hb:'hb1'}");
+ h.get("/h/ha1/hb1/f/x1/x2/d/x3/x4/").run().assertBody().is("withRemainder: {'/*':'','/**':'',a:'x1',b:'x2',c:'x3',d:'x4',ha:'ha1',hb:'hb1'}");
}
@Test
public void h06c_withRemainderWithStuff() throws Exception {
- h.get("/h/ha1/hb1/f/x1/x2/d/x3/x4/foo/bar").execute().assertBody("withRemainder: {'/*':'foo/bar','/**':'foo/bar',a:'x1',b:'x2',c:'x3',d:'x4',ha:'ha1',hb:'hb1'}");
+ h.get("/h/ha1/hb1/f/x1/x2/d/x3/x4/foo/bar").run().assertBody().is("withRemainder: {'/*':'foo/bar','/**':'foo/bar',a:'x1',b:'x2',c:'x3',d:'x4',ha:'ha1',hb:'hb1'}");
}
//=================================================================================================================
@@ -613,65 +613,65 @@ public class PathAnnotationTest {
@Test
public void i01a_noPath() throws Exception {
- i.get("/i/ia1/ib1/h/ha1/hb1/f/x1/x2").execute().assertBody("noPath: {a:'x1',b:'x2',ha:'ha1',hb:'hb1',ia:'ia1',ib:'ib1'}");
+ i.get("/i/ia1/ib1/h/ha1/hb1/f/x1/x2").run().assertBody().is("noPath: {a:'x1',b:'x2',ha:'ha1',hb:'hb1',ia:'ia1',ib:'ib1'}");
}
@Test
public void i01b_incompletePath() throws Exception {
- i.get("/i/ia1/ib1/h/ha1/hb1/f/x1").execute().assertStatus(404);
- i.get("/i/ia1/ib1/h/ha1/hb1/f").execute().assertStatus(404);
- i.get("/i/ia1/ib1/h/ha1/hb1").execute().assertStatus(404);
- i.get("/i/ia1/ib1/h/ha1").execute().assertStatus(404);
- i.get("/i/ia1/ib1/h").execute().assertStatus(404);
- i.get("/i/ia1/ib1").execute().assertStatus(404);
- i.get("/i/ia1").execute().assertStatus(404);
- i.get("/i").execute().assertStatus(404);
+ i.get("/i/ia1/ib1/h/ha1/hb1/f/x1").run().assertStatus().equals(404);
+ i.get("/i/ia1/ib1/h/ha1/hb1/f").run().assertStatus().equals(404);
+ i.get("/i/ia1/ib1/h/ha1/hb1").run().assertStatus().equals(404);
+ i.get("/i/ia1/ib1/h/ha1").run().assertStatus().equals(404);
+ i.get("/i/ia1/ib1/h").run().assertStatus().equals(404);
+ i.get("/i/ia1/ib1").run().assertStatus().equals(404);
+ i.get("/i/ia1").run().assertStatus().equals(404);
+ i.get("/i").run().assertStatus().equals(404);
}
@Test
public void i01c_noPath_blanks() throws Exception {
- i.get("/i//ib1/h/ha1/hb1/f/x1/x2").execute().assertStatus(404);
- i.get("/i/ia1//h/ha1/hb1/f/x1/x2").execute().assertStatus(404);
- i.get("/i/ia1/ib1/h//hb1/f/x1/x2").execute().assertStatus(404);
- i.get("/i/ia1/ib1/h/ha1//f/x1/x2").execute().assertStatus(404);
- i.get("/i/ia1/ib1/h/ha1/hb1/f//x2").execute().assertStatus(404);
- i.get("/i/ia1/ib1/h/ha1/hb1/f/x1/").execute().assertStatus(404);
- i.get("/i///h///f//").execute().assertStatus(404);
+ i.get("/i//ib1/h/ha1/hb1/f/x1/x2").run().assertStatus().equals(404);
+ i.get("/i/ia1//h/ha1/hb1/f/x1/x2").run().assertStatus().equals(404);
+ i.get("/i/ia1/ib1/h//hb1/f/x1/x2").run().assertStatus().equals(404);
+ i.get("/i/ia1/ib1/h/ha1//f/x1/x2").run().assertStatus().equals(404);
+ i.get("/i/ia1/ib1/h/ha1/hb1/f//x2").run().assertStatus().equals(404);
+ i.get("/i/ia1/ib1/h/ha1/hb1/f/x1/").run().assertStatus().equals(404);
+ i.get("/i///h///f//").run().assertStatus().equals(404);
}
@Test
public void i02_noPath2() throws Exception {
- i.get("/i/ia1/ib1/h/ha1/hb1/f/x1/x2/foo").execute().assertBody("noPath2: {'/*':'foo','/**':'foo',a:'x1',b:'x2',ha:'ha1',hb:'hb1',ia:'ia1',ib:'ib1'}");
+ i.get("/i/ia1/ib1/h/ha1/hb1/f/x1/x2/foo").run().assertBody().is("noPath2: {'/*':'foo','/**':'foo',a:'x1',b:'x2',ha:'ha1',hb:'hb1',ia:'ia1',ib:'ib1'}");
}
@Test
public void i03_noVars() throws Exception {
- i.get("/i/ia1/ib1/h/ha1/hb1/f/x1/x2/a").execute().assertBody("noVars: {a:'x1',b:'x2',ha:'ha1',hb:'hb1',ia:'ia1',ib:'ib1'}");
+ i.get("/i/ia1/ib1/h/ha1/hb1/f/x1/x2/a").run().assertBody().is("noVars: {a:'x1',b:'x2',ha:'ha1',hb:'hb1',ia:'ia1',ib:'ib1'}");
}
@Test
public void i04_twoVars() throws Exception {
- i.get("/i/ia1/ib1/h/ha1/hb1/f/x1/x2/b/x3/x4").execute().assertBody("twoVars: {a:'x1',b:'x2',c:'x3',d:'x4',ha:'ha1',hb:'hb1',ia:'ia1',ib:'ib1'}");
+ i.get("/i/ia1/ib1/h/ha1/hb1/f/x1/x2/b/x3/x4").run().assertBody().is("twoVars: {a:'x1',b:'x2',c:'x3',d:'x4',ha:'ha1',hb:'hb1',ia:'ia1',ib:'ib1'}");
}
@Test
public void i05_twoVarsOverlapping() throws Exception {
- i.get("/i/ia1/ib1/h/ha1/hb1/f/x1/x2/c/x3/x4").execute().assertBody("twoVarsOverlapping: {a:'x3',b:'x4',ha:'ha1',hb:'hb1',ia:'ia1',ib:'ib1'}");
+ i.get("/i/ia1/ib1/h/ha1/hb1/f/x1/x2/c/x3/x4").run().assertBody().is("twoVarsOverlapping: {a:'x3',b:'x4',ha:'ha1',hb:'hb1',ia:'ia1',ib:'ib1'}");
}
@Test
public void i06a_withRemainder() throws Exception {
- i.get("/i/ia1/ib1/h/ha1/hb1/f/x1/x2/d/x3/x4").execute().assertBody("withRemainder: {a:'x1',b:'x2',c:'x3',d:'x4',ha:'ha1',hb:'hb1',ia:'ia1',ib:'ib1'}");
+ i.get("/i/ia1/ib1/h/ha1/hb1/f/x1/x2/d/x3/x4").run().assertBody().is("withRemainder: {a:'x1',b:'x2',c:'x3',d:'x4',ha:'ha1',hb:'hb1',ia:'ia1',ib:'ib1'}");
}
@Test
public void i06b_withRemainderBlank() throws Exception {
- i.get("/i/ia1/ib1/h/ha1/hb1/f/x1/x2/d/x3/x4/").execute().assertBody("withRemainder: {'/*':'','/**':'',a:'x1',b:'x2',c:'x3',d:'x4',ha:'ha1',hb:'hb1',ia:'ia1',ib:'ib1'}");
+ i.get("/i/ia1/ib1/h/ha1/hb1/f/x1/x2/d/x3/x4/").run().assertBody().is("withRemainder: {'/*':'','/**':'',a:'x1',b:'x2',c:'x3',d:'x4',ha:'ha1',hb:'hb1',ia:'ia1',ib:'ib1'}");
}
@Test
public void i06c_withRemainderWithStuff() throws Exception {
- i.get("/i/ia1/ib1/h/ha1/hb1/f/x1/x2/d/x3/x4/foo/bar").execute().assertBody("withRemainder: {'/*':'foo/bar','/**':'foo/bar',a:'x1',b:'x2',c:'x3',d:'x4',ha:'ha1',hb:'hb1',ia:'ia1',ib:'ib1'}");
+ i.get("/i/ia1/ib1/h/ha1/hb1/f/x1/x2/d/x3/x4/foo/bar").run().assertBody().is("withRemainder: {'/*':'foo/bar','/**':'foo/bar',a:'x1',b:'x2',c:'x3',d:'x4',ha:'ha1',hb:'hb1',ia:'ia1',ib:'ib1'}");
}
//=================================================================================================================
@@ -704,22 +704,22 @@ public class PathAnnotationTest {
@Test
public void j01_optionalParam_integer() throws Exception {
- j.get("/a/123").execute().assertStatus(200).assertBody("123");
+ j.get("/a/123").run().assertStatus().equals(200).assertBody().is("123");
}
@Test
public void j02_optionalParam_bean() throws Exception {
- j.get("/b/a=1,b=foo").execute().assertStatus(200).assertBody("{a:1,b:'foo'}");
+ j.get("/b/a=1,b=foo").run().assertStatus().equals(200).assertBody().is("{a:1,b:'foo'}");
}
@Test
public void j03_optionalParam_listOfBeans() throws Exception {
- j.get("/c/@((a=1,b=foo))").execute().assertStatus(200).assertBody("[{a:1,b:'foo'}]");
+ j.get("/c/@((a=1,b=foo))").run().assertStatus().equals(200).assertBody().is("[{a:1,b:'foo'}]");
}
@Test
public void j04_optionalParam_listOfOptionals() throws Exception {
- j.get("/d/@((a=1,b=foo))").execute().assertStatus(200).assertBody("[{a:1,b:'foo'}]");
+ j.get("/d/@((a=1,b=foo))").run().assertStatus().equals(200).assertBody().is("[{a:1,b:'foo'}]");
}
@@ -1125,10 +1125,10 @@ public class PathAnnotationTest {
@Test
public void u01_nonRequiredPath() throws Exception {
- u1.get("/u1/foo/u2").execute().assertStatus(200).assertBody("foo");
- u1.get("/u1/foo/u2/foo/xxx").execute().assertStatus(200).assertBody("foo,xxx");
- u2.get("/").execute().assertStatus(200).assertBody("nil");
- u2.get("/foo/xxx").execute().assertStatus(200).assertBody("nil,xxx");
+ u1.get("/u1/foo/u2").run().assertStatus().equals(200).assertBody().is("foo");
+ u1.get("/u1/foo/u2/foo/xxx").run().assertStatus().equals(200).assertBody().is("foo,xxx");
+ u2.get("/").run().assertStatus().equals(200).assertBody().is("nil");
+ u2.get("/foo/xxx").run().assertStatus().equals(200).assertBody().is("nil,xxx");
}
//=================================================================================================================
@@ -1155,13 +1155,13 @@ public class PathAnnotationTest {
@Test
public void v01_multiplePaths() throws Exception {
- v1.get("/v1/v1foo/v2").execute().assertStatus(200).assertBody("1,v1foo,nil");
- v1.get("/v1/v1foo/v2/v2foo").execute().assertStatus(200).assertBody("1,v1foo,v2foo");
- v1.get("/v1/v1foo/v2/foo").execute().assertStatus(200).assertBody("2,v1foo,nil");
- v1.get("/v1/v1foo/v2/foo/v2foo").execute().assertStatus(200).assertBody("2,v1foo,v2foo");
- v2.get("/v2").execute().assertStatus(200).assertBody("1,nil,nil");
- v2.get("/v2/v2foo").execute().assertStatus(200).assertBody("1,nil,v2foo");
- v2.get("/v2/foo").execute().assertStatus(200).assertBody("2,nil,nil");
- v2.get("/v2/foo/v2foo").execute().assertStatus(200).assertBody("2,nil,v2foo");
+ v1.get("/v1/v1foo/v2").run().assertStatus().equals(200).assertBody().is("1,v1foo,nil");
+ v1.get("/v1/v1foo/v2/v2foo").run().assertStatus().equals(200).assertBody().is("1,v1foo,v2foo");
+ v1.get("/v1/v1foo/v2/foo").run().assertStatus().equals(200).assertBody().is("2,v1foo,nil");
+ v1.get("/v1/v1foo/v2/foo/v2foo").run().assertStatus().equals(200).assertBody().is("2,v1foo,v2foo");
+ v2.get("/v2").run().assertStatus().equals(200).assertBody().is("1,nil,nil");
+ v2.get("/v2/v2foo").run().assertStatus().equals(200).assertBody().is("1,nil,v2foo");
+ v2.get("/v2/foo").run().assertStatus().equals(200).assertBody().is("2,nil,nil");
+ v2.get("/v2/foo/v2foo").run().assertStatus().equals(200).assertBody().is("2,nil,v2foo");
}
}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/PathRemainderAnnotationTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/PathRemainderAnnotationTest.java
index 70caf3b..f50c575 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/PathRemainderAnnotationTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/PathRemainderAnnotationTest.java
@@ -43,15 +43,15 @@ public class PathRemainderAnnotationTest {
@Test
public void a01_withoutRemainder() throws Exception {
- a.get("/").execute().assertBody("");
+ a.get("/").run().assertBody().is("");
}
@Test
public void a02_withRemainder() throws Exception {
- a.get("/foo").execute().assertBody("foo");
+ a.get("/foo").run().assertBody().is("foo");
}
@Test
public void a03_withRemainder2() throws Exception {
- a.get("/foo/bar").execute().assertBody("foo/bar");
+ a.get("/foo/bar").run().assertBody().is("foo/bar");
}
//=================================================================================================================
@@ -84,21 +84,21 @@ public class PathRemainderAnnotationTest {
@Test
public void b01_optionalParam_integer() throws Exception {
- b.get("/a/123").execute().assertStatus(200).assertBody("123");
+ b.get("/a/123").run().assertStatus().equals(200).assertBody().is("123");
}
@Test
public void b02_optionalParam_bean() throws Exception {
- b.get("/b/a=1,b=foo").execute().assertStatus(200).assertBody("{a:1,b:'foo'}");
+ b.get("/b/a=1,b=foo").run().assertStatus().equals(200).assertBody().is("{a:1,b:'foo'}");
}
@Test
public void b03_optionalParam_listOfBeans() throws Exception {
- b.get("/c/@((a=1,b=foo))").execute().assertStatus(200).assertBody("[{a:1,b:'foo'}]");
+ b.get("/c/@((a=1,b=foo))").run().assertStatus().equals(200).assertBody().is("[{a:1,b:'foo'}]");
}
@Test
public void b04_optionalParam_listOfOptionals() throws Exception {
- b.get("/d/@((a=1,b=foo))").execute().assertStatus(200).assertBody("[{a:1,b:'foo'}]");
+ b.get("/d/@((a=1,b=foo))").run().assertStatus().equals(200).assertBody().is("[{a:1,b:'foo'}]");
}
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/QueryAnnotationTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/QueryAnnotationTest.java
index b43e01d..85cec3a 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/QueryAnnotationTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/QueryAnnotationTest.java
@@ -54,33 +54,33 @@ public class QueryAnnotationTest {
@Test
public void a01_get() throws Exception {
- a.get("?p1=p1&p2=2").execute().assertBody("p1=[p1,p1,p1],p2=[2,2,2]");
- a.get("?p1&p2").execute().assertBody("p1=[null,null,null],p2=[0,null,0]");
- a.get("?p1=&p2=").execute().assertBody("p1=[,,],p2=[0,,0]");
- a.get("/").execute().assertBody("p1=[null,null,null],p2=[0,null,0]");
- a.get("?p1").execute().assertBody("p1=[null,null,null],p2=[0,null,0]");
- a.get("?p1=").execute().assertBody("p1=[,,],p2=[0,null,0]");
- a.get("?p2").execute().assertBody("p1=[null,null,null],p2=[0,null,0]");
- a.get("?p2=").execute().assertBody("p1=[null,null,null],p2=[0,,0]");
- a.get("?p1=foo&p2").execute().assertBody("p1=[foo,foo,foo],p2=[0,null,0]");
- a.get("?p1&p2=1").execute().assertBody("p1=[null,null,null],p2=[1,1,1]");
+ a.get("?p1=p1&p2=2").run().assertBody().is("p1=[p1,p1,p1],p2=[2,2,2]");
+ a.get("?p1&p2").run().assertBody().is("p1=[null,null,null],p2=[0,null,0]");
+ a.get("?p1=&p2=").run().assertBody().is("p1=[,,],p2=[0,,0]");
+ a.get("/").run().assertBody().is("p1=[null,null,null],p2=[0,null,0]");
+ a.get("?p1").run().assertBody().is("p1=[null,null,null],p2=[0,null,0]");
+ a.get("?p1=").run().assertBody().is("p1=[,,],p2=[0,null,0]");
+ a.get("?p2").run().assertBody().is("p1=[null,null,null],p2=[0,null,0]");
+ a.get("?p2=").run().assertBody().is("p1=[null,null,null],p2=[0,,0]");
+ a.get("?p1=foo&p2").run().assertBody().is("p1=[foo,foo,foo],p2=[0,null,0]");
+ a.get("?p1&p2=1").run().assertBody().is("p1=[null,null,null],p2=[1,1,1]");
String x = "a%2Fb%25c%3Dd+e"; // [x/y%z=a+b]
- a.get("?p1="+x+"&p2=1").execute().assertBody("p1=[a/b%c=d e,a/b%c=d e,a/b%c=d e],p2=[1,1,1]");
+ a.get("?p1="+x+"&p2=1").run().assertBody().is("p1=[a/b%c=d e,a/b%c=d e,a/b%c=d e],p2=[1,1,1]");
}
@Test
public void a02_post() throws Exception {
- a.post("?p1=p1&p2=2", null).execute().assertBody("p1=[p1,p1,p1],p2=[2,2,2]");
- a.post("?p1&p2", null).execute().assertBody("p1=[null,null,null],p2=[0,null,0]");
- a.post("?p1=&p2=", null).execute().assertBody("p1=[,,],p2=[0,,0]");
- a.post("/", null).execute().assertBody("p1=[null,null,null],p2=[0,null,0]");
- a.post("?p1", null).execute().assertBody("p1=[null,null,null],p2=[0,null,0]");
- a.post("?p1=", null).execute().assertBody("p1=[,,],p2=[0,null,0]");
- a.post("?p2", null).execute().assertBody("p1=[null,null,null],p2=[0,null,0]");
- a.post("?p2=", null).execute().assertBody("p1=[null,null,null],p2=[0,,0]");
- a.post("?p1=foo&p2", null).execute().assertBody("p1=[foo,foo,foo],p2=[0,null,0]");
- a.post("?p1&p2=1", null).execute().assertBody("p1=[null,null,null],p2=[1,1,1]");
+ a.post("?p1=p1&p2=2", null).run().assertBody().is("p1=[p1,p1,p1],p2=[2,2,2]");
+ a.post("?p1&p2", null).run().assertBody().is("p1=[null,null,null],p2=[0,null,0]");
+ a.post("?p1=&p2=", null).run().assertBody().is("p1=[,,],p2=[0,,0]");
+ a.post("/", null).run().assertBody().is("p1=[null,null,null],p2=[0,null,0]");
+ a.post("?p1", null).run().assertBody().is("p1=[null,null,null],p2=[0,null,0]");
+ a.post("?p1=", null).run().assertBody().is("p1=[,,],p2=[0,null,0]");
+ a.post("?p2", null).run().assertBody().is("p1=[null,null,null],p2=[0,null,0]");
+ a.post("?p2=", null).run().assertBody().is("p1=[null,null,null],p2=[0,,0]");
+ a.post("?p1=foo&p2", null).run().assertBody().is("p1=[foo,foo,foo],p2=[0,null,0]");
+ a.post("?p1&p2=1", null).run().assertBody().is("p1=[null,null,null],p2=[1,1,1]");
String x = "a%2Fb%25c%3Dd+e"; // [x/y%z=a+b]
- a.post("?p1="+x+"&p2=1", null).execute().assertBody("p1=[a/b%c=d e,a/b%c=d e,a/b%c=d e],p2=[1,1,1]");
+ a.post("?p1="+x+"&p2=1", null).run().assertBody().is("p1=[a/b%c=d e,a/b%c=d e,a/b%c=d e],p2=[1,1,1]");
}
//=================================================================================================================
@@ -114,23 +114,23 @@ public class QueryAnnotationTest {
@Test
public void b01_get1() throws Exception {
- b.get("/get1?p1=p1").execute().assertBody("p1=[p1,p1,p1]");
- b.get("/get1?p1='p1'").execute().assertBody("p1=['p1','p1','p1']");
+ b.get("/get1?p1=p1").run().assertBody().is("p1=[p1,p1,p1]");
+ b.get("/get1?p1='p1'").run().assertBody().is("p1=['p1','p1','p1']");
}
@Test
public void b02_get2() throws Exception {
- b.get("/get2?p1=p1").execute().assertBody("p1=[p1,p1,p1]");
- b.get("/get2?p1='p1'").execute().assertBody("p1=[p1,'p1','p1']");
+ b.get("/get2?p1=p1").run().assertBody().is("p1=[p1,p1,p1]");
+ b.get("/get2?p1='p1'").run().assertBody().is("p1=[p1,'p1','p1']");
}
@Test
public void b03_post1() throws Exception {
- b.post("/post1?p1=p1", null).execute().assertBody("p1=[p1,p1,p1]");
- b.post("/post1?p1='p1'", null).execute().assertBody("p1=['p1','p1','p1']");
+ b.post("/post1?p1=p1", null).run().assertBody().is("p1=[p1,p1,p1]");
+ b.post("/post1?p1='p1'", null).run().assertBody().is("p1=['p1','p1','p1']");
}
@Test
public void b04_post2() throws Exception {
- b.post("/post2?p1=p1", null).execute().assertBody("p1=[p1,p1,p1]");
- b.post("/post2?p1='p1'", null).execute().assertBody("p1=[p1,'p1','p1']");
+ b.post("/post2?p1=p1", null).run().assertBody().is("p1=[p1,p1,p1]");
+ b.post("/post2?p1='p1'", null).run().assertBody().is("p1=[p1,'p1','p1']");
}
//=================================================================================================================
@@ -174,33 +174,33 @@ public class QueryAnnotationTest {
@Test
public void c01_StringArray() throws Exception {
- c.get("/c01?x=a").execute().assertBody("['a']");
- c.get("/c01?x=a&x=b").execute().assertBody("['a','b']");
+ c.get("/c01?x=a").run().assertBody().is("['a']");
+ c.get("/c01?x=a&x=b").run().assertBody().is("['a','b']");
}
@Test
public void c02_intArray() throws Exception {
- c.get("/c02?x=1").execute().assertBody("[1]");
- c.get("/c02?x=1&x=2").execute().assertBody("[1,2]");
+ c.get("/c02?x=1").run().assertBody().is("[1]");
+ c.get("/c02?x=1&x=2").run().assertBody().is("[1,2]");
}
@Test
public void c03_ListOfStrings() throws Exception {
- c.get("/c03?x=a").execute().assertBody("['a']");
- c.get("/c03?x=a&x=b").execute().assertBody("['a','b']");
+ c.get("/c03?x=a").run().assertBody().is("['a']");
+ c.get("/c03?x=a&x=b").run().assertBody().is("['a','b']");
}
@Test
public void c04_ListOfIntegers() throws Exception {
- c.get("/c04?x=1").execute().assertBody("[1]");
- c.get("/c04?x=1&x=2").execute().assertBody("[1,2]");
+ c.get("/c04?x=1").run().assertBody().is("[1]");
+ c.get("/c04?x=1&x=2").run().assertBody().is("[1,2]");
}
@Test
public void c05_BeanArray() throws Exception {
- c.get("/c05?x=a=1,b=2,c=false").execute().assertBody("[{a:'1',b:2,c:false}]");
- c.get("/c05?x=a=1,b=2,c=false&x=a=3,b=4,c=true").execute().assertBody("[{a:'1',b:2,c:false},{a:'3',b:4,c:true}]");
+ c.get("/c05?x=a=1,b=2,c=false").run().assertBody().is("[{a:'1',b:2,c:false}]");
+ c.get("/c05?x=a=1,b=2,c=false&x=a=3,b=4,c=true").run().assertBody().is("[{a:'1',b:2,c:false},{a:'3',b:4,c:true}]");
}
@Test
public void c06_ListOfBeans() throws Exception {
- c.get("/c06?x=a=1,b=2,c=false").execute().assertBody("[{a:'1',b:2,c:false}]");
- c.get("/c06?x=a=1,b=2,c=false&x=a=3,b=4,c=true").execute().assertBody("[{a:'1',b:2,c:false},{a:'3',b:4,c:true}]");
+ c.get("/c06?x=a=1,b=2,c=false").run().assertBody().is("[{a:'1',b:2,c:false}]");
+ c.get("/c06?x=a=1,b=2,c=false&x=a=3,b=4,c=true").run().assertBody().is("[{a:'1',b:2,c:false},{a:'3',b:4,c:true}]");
}
//=================================================================================================================
@@ -242,26 +242,26 @@ public class QueryAnnotationTest {
@Test
public void d01_defaultQuery() throws Exception {
- d.get("/d01").execute().assertBody("{f1:'1',f2:'2',f3:'3'}");
- d.get("/d01").query("f1",4).query("f2",5).query("f3",6).execute().assertBody("{f1:'4',f2:'5',f3:'6'}");
+ d.get("/d01").run().assertBody().is("{f1:'1',f2:'2',f3:'3'}");
+ d.get("/d01").query("f1",4).query("f2",5).query("f3",6).run().assertBody().is("{f1:'4',f2:'5',f3:'6'}");
}
@Test
public void d02_annotatedQuery() throws Exception {
- d.get("/d02").execute().assertBody("{f1:null,f2:null,f3:null}");
- d.get("/d02").query("f1",4).query("f2",5).query("f3",6).execute().assertBody("{f1:'4',f2:'5',f3:'6'}");
+ d.get("/d02").run().assertBody().is("{f1:null,f2:null,f3:null}");
+ d.get("/d02").query("f1",4).query("f2",5).query("f3",6).run().assertBody().is("{f1:'4',f2:'5',f3:'6'}");
}
@Test
public void d03_annotatedQueryDefault() throws Exception {
- d.get("/d03").execute().assertBody("{f1:'1',f2:'2',f3:'3'}");
- d.get("/d03").query("f1",4).query("f2",5).query("f3",6).execute().assertBody("{f1:'4',f2:'5',f3:'6'}");
+ d.get("/d03").run().assertBody().is("{f1:'1',f2:'2',f3:'3'}");
+ d.get("/d03").query("f1",4).query("f2",5).query("f3",6).run().assertBody().is("{f1:'4',f2:'5',f3:'6'}");
}
@Test
public void d04_annotatedAndDefaultQuery() throws Exception {
- d.get("/d04").execute().assertBody("{f1:'4',f2:'5',f3:'6'}");
- d.get("/d04").query("f1",7).query("f2",8).query("f3",9).execute().assertBody("{f1:'7',f2:'8',f3:'9'}");
+ d.get("/d04").run().assertBody().is("{f1:'4',f2:'5',f3:'6'}");
+ d.get("/d04").query("f1",7).query("f2",8).query("f3",9).run().assertBody().is("{f1:'7',f2:'8',f3:'9'}");
}
//=================================================================================================================
@@ -294,26 +294,26 @@ public class QueryAnnotationTest {
@Test
public void e01_optionalParam_integer() throws Exception {
- e.get("/a?f1=123").execute().assertStatus(200).assertBody("123");
- e.get("/a").execute().assertStatus(200).assertBody("null");
+ e.get("/a?f1=123").run().assertStatus().equals(200).assertBody().is("123");
+ e.get("/a").run().assertStatus().equals(200).assertBody().is("null");
}
@Test
public void e02_optionalParam_bean() throws Exception {
- e.get("/b?f1=a=1,b=foo").execute().assertStatus(200).assertBody("{a:1,b:'foo'}");
- e.get("/b").execute().assertStatus(200).assertBody("null");
+ e.get("/b?f1=a=1,b=foo").run().assertStatus().equals(200).assertBody().is("{a:1,b:'foo'}");
+ e.get("/b").run().assertStatus().equals(200).assertBody().is("null");
}
@Test
public void e03_optionalParam_listOfBeans() throws Exception {
- e.get("/c?f1=@((a=1,b=foo))").execute().assertStatus(200).assertBody("[{a:1,b:'foo'}]");
- e.get("/c").execute().assertStatus(200).assertBody("null");
+ e.get("/c?f1=@((a=1,b=foo))").run().assertStatus().equals(200).assertBody().is("[{a:1,b:'foo'}]");
+ e.get("/c").run().assertStatus().equals(200).assertBody().is("null");
}
@Test
public void e04_optionalParam_listOfOptionals() throws Exception {
- e.get("/d?f1=@((a=1,b=foo))").execute().assertStatus(200).assertBody("[{a:1,b:'foo'}]");
- e.get("/d").execute().assertStatus(200).assertBody("null");
+ e.get("/d?f1=@((a=1,b=foo))").run().assertStatus().equals(200).assertBody().is("[{a:1,b:'foo'}]");
+ e.get("/d").run().assertStatus().equals(200).assertBody().is("null");
}
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 af655ba..ca98b1f 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
@@ -71,11 +71,11 @@ public class ResponseAnnotationTest {
@Test
public void a01_codeOnClass() throws Exception {
- a.get("/a01").execute().assertStatus(201).assertBody("foo");
+ a.get("/a01").run().assertStatus().equals(201).assertBody().is("foo");
}
@Test
public void a02_codeOnThrown() throws Exception {
- a.get("/a02").execute().assertStatus(501);
+ a.get("/a02").run().assertStatus().equals(501);
}
//=================================================================================================================
@@ -124,19 +124,19 @@ public class ResponseAnnotationTest {
@Test
public void b01_useOnMethod() throws Exception {
- b.get("/b01").execute().assertStatus(200).assertBody("foo");
+ b.get("/b01").run().assertStatus().equals(200).assertBody().is("foo");
}
@Test
public void b03_useOnClass() throws Exception {
- b.get("/b03").execute().assertStatus(200).assertBody("foo");
+ b.get("/b03").run().assertStatus().equals(200).assertBody().is("foo");
}
@Test
public void b05_useOnThrown() throws Exception {
- b.get("/b05").execute().assertStatus(500).assertBody("foo");
+ b.get("/b05").run().assertStatus().equals(500).assertBody().is("foo");
}
@Test
public void b07_useOnParameter() throws Exception {
- b.get("/b07").execute().assertStatus(200).assertBody("foo");
+ b.get("/b07").run().assertStatus().equals(200).assertBody().is("foo");
}
@@ -215,35 +215,35 @@ public class ResponseAnnotationTest {
@Test
public void d01_useOnMethod() throws Exception {
- d.get("/d01").execute().assertStatus(200).assertBody("foo|bar");
+ d.get("/d01").run().assertStatus().equals(200).assertBody().is("foo|bar");
}
@Test
public void d02_useOnClass() throws Exception {
- d.get("/d02").execute().assertStatus(200).assertBody("foo|bar");
+ d.get("/d02").run().assertStatus().equals(200).assertBody().is("foo|bar");
}
@Test
public void d03_useOnThrown() throws Exception {
- d.get("/d03").execute().assertStatus(500).assertBody("foo|bar");
+ d.get("/d03").run().assertStatus().equals(500).assertBody().is("foo|bar");
}
@Test
public void d04_useOnParameter() throws Exception {
- d.get("/d04").execute().assertStatus(200).assertBody("foo|bar");
+ d.get("/d04").run().assertStatus().equals(200).assertBody().is("foo|bar");
}
@Test
public void d05_useOnMethodBytes() throws Exception {
- d.get("/d05").execute().assertStatus(200).assertBody("Zm9v");
+ d.get("/d05").run().assertStatus().equals(200).assertBody().is("Zm9v");
}
@Test
public void d06_useOnClassBytes() throws Exception {
- d.get("/d06").execute().assertStatus(200).assertBody("Zm9v");
+ d.get("/d06").run().assertStatus().equals(200).assertBody().is("Zm9v");
}
@Test
public void d07_useOnThrownBytes() throws Exception {
- d.get("/d07").execute().assertStatus(500).assertBody("Zm9v");
+ d.get("/d07").run().assertStatus().equals(500).assertBody().is("Zm9v");
}
@Test
public void d08_useOnParameterBytes() throws Exception {
- d.get("/d08").execute().assertStatus(200).assertBody("Zm9v");
+ d.get("/d08").run().assertStatus().equals(200).assertBody().is("Zm9v");
}
//-----------------------------------------------------------------------------------------------------------------
@@ -286,19 +286,19 @@ public class ResponseAnnotationTest {
@Test
public void e01_basic_onParameter() throws Exception {
- e.get("/e01").execute().assertStatus(200).assertBody("foo");
+ e.get("/e01").run().assertStatus().equals(200).assertBody().is("foo");
}
@Test
public void e02_basic_onType() throws Exception {
- e.get("/e02").execute().assertStatus(200).assertBody("foo");
+ e.get("/e02").run().assertStatus().equals(200).assertBody().is("foo");
}
@Test
public void e03_basic_onMethod() throws Exception {
- e.get("/e03").execute().assertStatus(200).assertBody("foo");
+ e.get("/e03").run().assertStatus().equals(200).assertBody().is("foo");
}
@Test
public void e04_basic_onReturnedType() throws Exception {
- e.get("/e04").execute().assertStatus(200).assertBody("foo");
+ e.get("/e04").run().assertStatus().equals(200).assertBody().is("foo");
}
//-----------------------------------------------------------------------------------------------------------------
@@ -339,7 +339,7 @@ public class ResponseAnnotationTest {
@Test
public void f01a_basic_onParameter() throws Exception {
- f.get("/f01").execute().assertStatus(200).assertBody("1|2");
+ f.get("/f01").run().assertStatus().equals(200).assertBody().is("1|2");
}
@Test
public void f01b_basic_onParameter_swagger() throws Exception {
@@ -348,7 +348,7 @@ public class ResponseAnnotationTest {
}
@Test
public void f02a_basic_onType() throws Exception {
- f.get("/f02").execute().assertStatus(200).assertBody("1|2");
+ f.get("/f02").run().assertStatus().equals(200).assertBody().is("1|2");
}
@Test
public void f02b_basic_onParameter_swagger() throws Exception {
@@ -357,7 +357,7 @@ public class ResponseAnnotationTest {
}
@Test
public void f03a_basic_onMethod() throws Exception {
- f.get("/f03").execute().assertStatus(200).assertBody("1|2");
+ f.get("/f03").run().assertStatus().equals(200).assertBody().is("1|2");
}
@Test
public void f03b_basic_onParameter_swagger() throws Exception {
@@ -366,7 +366,7 @@ public class ResponseAnnotationTest {
}
@Test
public void f04a_basic_onReturnedType() throws Exception {
- f.get("/f04").execute().assertStatus(200).assertBody("1|2");
+ f.get("/f04").run().assertStatus().equals(200).assertBody().is("1|2");
}
@Test
public void f04b_basic_onParameter_swagger() throws Exception {
@@ -412,7 +412,7 @@ public class ResponseAnnotationTest {
@Test
public void g01a_basic_onParameter() throws Exception {
- g.get("/g01").json().execute().assertStatus(200).assertBody("[1,2]");
+ g.get("/g01").json().run().assertStatus().equals(200).assertBody().is("[1,2]");
}
@Test
public void g01b_basic_onParameter_swagger() throws Exception {
@@ -421,7 +421,7 @@ public class ResponseAnnotationTest {
}
@Test
public void g02a_basic_onType() throws Exception {
- g.get("/g02").json().execute().assertStatus(200).assertBody("[1,2]");
+ g.get("/g02").json().run().assertStatus().equals(200).assertBody().is("[1,2]");
}
@Test
public void g02b_basic_onParameter_swagger() throws Exception {
@@ -430,7 +430,7 @@ public class ResponseAnnotationTest {
}
@Test
public void g03a_basic_onMethod() throws Exception {
- g.get("/g03").json().execute().assertStatus(200).assertBody("[1,2]");
+ g.get("/g03").json().run().assertStatus().equals(200).assertBody().is("[1,2]");
}
@Test
public void g03b_basic_onParameter_swagger() throws Exception {
@@ -439,7 +439,7 @@ public class ResponseAnnotationTest {
}
@Test
public void g04a_basic_onReturnedType() throws Exception {
- g.get("/g04").json().execute().assertStatus(200).assertBody("[1,2]");
+ g.get("/g04").json().run().assertStatus().equals(200).assertBody().is("[1,2]");
}
@Test
public void g04b_basic_onParameter_swagger() throws Exception {
@@ -468,7 +468,7 @@ public class ResponseAnnotationTest {
@Test
public void j01a_basic() throws Exception {
- j.post("/j01", "foo").accept("text/plain").execute().assertStatus(200).assertBody("foo").assertHeader("Content-Type", "text/plain");
+ j.post("/j01", "foo").accept("text/plain").run().assertStatus().equals(200).assertBody().is("foo").assertHeader("Content-Type").is("text/plain");
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RestHookTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RestHookTest.java
index a4bd0e9..4eecbbe 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RestHookTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RestHookTest.java
@@ -99,14 +99,14 @@ public class RestHookTest {
@Test
public void a01_preCall_propertiesOverriddenByAnnotation() throws Exception {
- a.put("/propertiesOverriddenByAnnotation", null).contentType("text/a1").execute().assertBody("p1=sp1,p2=xp2,p3=mp3,p4=xp4,p5=xp5");
- a.put("/propertiesOverriddenByAnnotation", null).contentType("text/a1").header("Override-Content-Type", "text/a2").execute().assertBody("p1=sp1,p2=xp2,p3=mp3,p4=xp4,p5=xp5");
+ a.put("/propertiesOverriddenByAnnotation", null).contentType("text/a1").run().assertBody().is("p1=sp1,p2=xp2,p3=mp3,p4=xp4,p5=xp5");
+ a.put("/propertiesOverriddenByAnnotation", null).contentType("text/a1").header("Override-Content-Type", "text/a2").run().assertBody().is("p1=sp1,p2=xp2,p3=mp3,p4=xp4,p5=xp5");
}
@Test
public void a02_preCall_propertiesOverriddenProgrammatically() throws Exception {
- a.put("/propertiesOverriddenProgrammatically", null).contentType("text/a1").execute().assertBody("p1=sp1,p2=xp2,p3=pp3,p4=pp4,p5=xp5");
- a.put("/propertiesOverriddenProgrammatically", null).contentType("text/a1").header("Override-Content-Type", "text/a2").execute().assertBody("p1=sp1,p2=xp2,p3=pp3,p4=pp4,p5=xp5");
+ a.put("/propertiesOverriddenProgrammatically", null).contentType("text/a1").run().assertBody().is("p1=sp1,p2=xp2,p3=pp3,p4=pp4,p5=xp5");
+ a.put("/propertiesOverriddenProgrammatically", null).contentType("text/a1").header("Override-Content-Type", "text/a2").run().assertBody().is("p1=sp1,p2=xp2,p3=pp3,p4=pp4,p5=xp5");
}
//=================================================================================================================
@@ -185,27 +185,27 @@ public class RestHookTest {
@Test
public void b01a_postCall_propertiesOverridenByAnnotation() throws Exception {
- b.put("/propertiesOverridenByAnnotation", null).accept("text/s1").execute().assertBody("p1=sp1,p2=xp2,p3=mp3,p4=xp4,p5=xp5");
- b.put("/propertiesOverridenByAnnotation", null).accept("text/s1").header("Override-Accept", "text/s2").execute().assertBody("p1=sp1,p2=xp2,p3=mp3,p4=xp4,p5=xp5");
- b.put("/propertiesOverridenByAnnotation", null).accept("text/s1").header("Override-Content-Type", "text/s3").execute().assertBody("p1=sp1,p2=xp2,p3=mp3,p4=xp4,p5=xp5");
+ b.put("/propertiesOverridenByAnnotation", null).accept("text/s1").run().assertBody().is("p1=sp1,p2=xp2,p3=mp3,p4=xp4,p5=xp5");
+ b.put("/propertiesOverridenByAnnotation", null).accept("text/s1").header("Override-Accept", "text/s2").run().assertBody().is("p1=sp1,p2=xp2,p3=mp3,p4=xp4,p5=xp5");
+ b.put("/propertiesOverridenByAnnotation", null).accept("text/s1").header("Override-Content-Type", "text/s3").run().assertBody().is("p1=sp1,p2=xp2,p3=mp3,p4=xp4,p5=xp5");
}
@Test
public void b01b_postCall_propertiesOverridenByAnnotation_defaultAccept() throws Exception {
- b.put("/propertiesOverridenByAnnotation", null).execute().assertBody("p1=sp1,p2=xp2,p3=mp3,p4=xp4,p5=xp5");
- b.put("/propertiesOverridenByAnnotation", null).header("Override-Accept", "text/s3").execute().assertBody("p1=sp1,p2=xp2,p3=mp3,p4=xp4,p5=xp5");
- b.put("/propertiesOverridenByAnnotation", null).header("Override-Content-Type", "text/s3").execute().assertBody("p1=sp1,p2=xp2,p3=mp3,p4=xp4,p5=xp5");
+ b.put("/propertiesOverridenByAnnotation", null).run().assertBody().is("p1=sp1,p2=xp2,p3=mp3,p4=xp4,p5=xp5");
+ b.put("/propertiesOverridenByAnnotation", null).header("Override-Accept", "text/s3").run().assertBody().is("p1=sp1,p2=xp2,p3=mp3,p4=xp4,p5=xp5");
+ b.put("/propertiesOverridenByAnnotation", null).header("Override-Content-Type", "text/s3").run().assertBody().is("p1=sp1,p2=xp2,p3=mp3,p4=xp4,p5=xp5");
}
@Test
public void b02a_postCall_propertiesOverriddenProgramatically() throws Exception {
- b.put("/propertiesOverriddenProgramatically", null).accept("text/s1").execute().assertBody("p1=sp1,p2=xp2,p3=pp3,p4=xp4,p5=xp5");
- b.put("/propertiesOverriddenProgramatically", null).accept("text/s1").header("Override-Accept", "text/s2").execute().assertBody("p1=sp1,p2=xp2,p3=pp3,p4=xp4,p5=xp5");
- b.put("/propertiesOverriddenProgramatically", null).accept("text/s1").header("Override-Content-Type", "text/s3").execute().assertBody("p1=sp1,p2=xp2,p3=pp3,p4=xp4,p5=xp5");
+ b.put("/propertiesOverriddenProgramatically", null).accept("text/s1").run().assertBody().is("p1=sp1,p2=xp2,p3=pp3,p4=xp4,p5=xp5");
+ b.put("/propertiesOverriddenProgramatically", null).accept("text/s1").header("Override-Accept", "text/s2").run().assertBody().is("p1=sp1,p2=xp2,p3=pp3,p4=xp4,p5=xp5");
+ b.put("/propertiesOverriddenProgramatically", null).accept("text/s1").header("Override-Content-Type", "text/s3").run().assertBody().is("p1=sp1,p2=xp2,p3=pp3,p4=xp4,p5=xp5");
}
@Test
public void b02b_postCall_propertiesOverriddenProgramatically_defaultAccept() throws Exception {
- b.put("/propertiesOverriddenProgramatically", null).execute().assertBody("p1=sp1,p2=xp2,p3=pp3,p4=xp4,p5=xp5");
- b.put("/propertiesOverriddenProgramatically", null).header("Override-Accept", "text/s3").execute().assertBody("p1=sp1,p2=xp2,p3=pp3,p4=xp4,p5=xp5");
- b.put("/propertiesOverriddenProgramatically", null).header("Override-Content-Type", "text/s3").execute().assertBody("p1=sp1,p2=xp2,p3=pp3,p4=xp4,p5=xp5");
+ b.put("/propertiesOverriddenProgramatically", null).run().assertBody().is("p1=sp1,p2=xp2,p3=pp3,p4=xp4,p5=xp5");
+ b.put("/propertiesOverriddenProgramatically", null).header("Override-Accept", "text/s3").run().assertBody().is("p1=sp1,p2=xp2,p3=pp3,p4=xp4,p5=xp5");
+ b.put("/propertiesOverriddenProgramatically", null).header("Override-Content-Type", "text/s3").run().assertBody().is("p1=sp1,p2=xp2,p3=pp3,p4=xp4,p5=xp5");
}
//====================================================================================================
@@ -279,9 +279,9 @@ public class RestHookTest {
@Test
public void c01_init() throws Exception {
- c.get("/super/events").execute().assertBody("['super-1a','super-1b','super-1c','super-2a']");
- c.get("/sub/events").execute().assertBody("['sub-1a','sub-1b','sub-1c','super-2a','sub-2b']");
- c.get("/sub/child/events").execute().assertBody("['super-1a','super-1b','child-1c','super-2a','child-2b']");
+ c.get("/super/events").run().assertBody().is("['super-1a','super-1b','super-1c','super-2a']");
+ c.get("/sub/events").run().assertBody().is("['sub-1a','sub-1b','sub-1c','super-2a','sub-2b']");
+ c.get("/sub/child/events").run().assertBody().is("['super-1a','super-1b','child-1c','super-2a','child-2b']");
}
//====================================================================================================
@@ -367,13 +367,13 @@ public class RestHookTest {
@Test
public void d01_postInit() throws Exception {
- d.get("/super/events").execute().assertBody("['super-1a','super-1b','super-1c','super-2a']");
- d.get("/sub/events").execute().assertBody("['sub-1a','sub-1b','sub-1c','super-2a','sub-2b']");
- d.get("/sub/child/events").execute().assertBody("['super-1a','super-1b','child-1c','super-2a','child-2b']");
+ d.get("/super/events").run().assertBody().is("['super-1a','super-1b','super-1c','super-2a']");
+ d.get("/sub/events").run().assertBody().is("['sub-1a','sub-1b','sub-1c','super-2a','sub-2b']");
+ d.get("/sub/child/events").run().assertBody().is("['super-1a','super-1b','child-1c','super-2a','child-2b']");
}
@Test
public void d02_postInit_order() throws Exception {
- d.get("/sub/lastCalled").execute().assertBody("CHILD");
+ d.get("/sub/lastCalled").run().assertBody().is("CHILD");
}
//====================================================================================================
@@ -465,13 +465,13 @@ public class RestHookTest {
@Test
public void e01_postInitChildFirst() throws Exception {
- e.get("/super/postInitChildFirstEvents").execute().assertBody("['super-1a','super-1b','super-1c','super-2a']");
- e.get("/sub/postInitChildFirstEvents").execute().assertBody("['sub-1a','sub-1b','sub-1c','super-2a','sub-2b']");
- e.get("/sub/child/postInitChildFirstEvents").execute().assertBody("['super-1a','super-1b','child-1c','super-2a','child-2b']");
+ e.get("/super/postInitChildFirstEvents").run().assertBody().is("['super-1a','super-1b','super-1c','super-2a']");
+ e.get("/sub/postInitChildFirstEvents").run().assertBody().is("['sub-1a','sub-1b','sub-1c','super-2a','sub-2b']");
+ e.get("/sub/child/postInitChildFirstEvents").run().assertBody().is("['super-1a','super-1b','child-1c','super-2a','child-2b']");
}
@Test
public void e02_postInitChildFirst_order() throws Exception {
- e.get("/sub/lastCalled").execute().assertBody("PARENT");
+ e.get("/sub/lastCalled").run().assertBody().is("PARENT");
}
//====================================================================================================
@@ -522,7 +522,7 @@ public class RestHookTest {
@Test
public void f01_startCall() throws Exception {
- f.get("/").execute().assertBody("{'1':'true','2':'true','3':'true','4':'true'}");
+ f.get("/").run().assertBody().is("{'1':'true','2':'true','3':'true','4':'true'}");
}
//====================================================================================================
@@ -573,7 +573,7 @@ public class RestHookTest {
@Test
public void g01_preCall() throws Exception {
- g.get("/").execute().assertBody("{'1':'true','2':'true','3':'true','4':'true'}");
+ g.get("/").run().assertBody().is("{'1':'true','2':'true','3':'true','4':'true'}");
}
//====================================================================================================
@@ -620,10 +620,10 @@ public class RestHookTest {
@Test
public void h01_postCall() throws Exception {
- h.get("/").execute()
- .assertHeader("post1-called", "true")
- .assertHeader("post2-called", "true")
- .assertHeader("post3-called", "true")
- .assertHeader("post4-called", "true");
+ h.get("/").run()
+ .assertHeader("post1-called").is("true")
+ .assertHeader("post2-called").is("true")
+ .assertHeader("post3-called").is("true")
+ .assertHeader("post4-called").is("true");
}
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RestMethodInheritTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RestMethodInheritTest.java
index 68654ea..2cd58e2 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RestMethodInheritTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RestMethodInheritTest.java
@@ -156,15 +156,15 @@ public class RestMethodInheritTest {
@Test
public void a01_serializers_default() throws Exception {
- a.get("/default").execute().assertBody("['text/s3','text/s4','text/s1','text/s2']");
+ a.get("/default").run().assertBody().is("['text/s3','text/s4','text/s1','text/s2']");
}
@Test
public void a02_serializers_onMethod() throws Exception {
- a.get("/onMethod").execute().assertBody("['text/s5']");
+ a.get("/onMethod").run().assertBody().is("['text/s5']");
}
@Test
public void a03_serializers_onMethodInherit() throws Exception {
- a.get("/onMethodInherit").execute().assertBody("['text/s5','text/s3','text/s4','text/s1','text/s2']");
+ a.get("/onMethodInherit").run().assertBody().is("['text/s5','text/s3','text/s4','text/s1','text/s2']");
}
//=================================================================================================================
@@ -199,15 +199,15 @@ public class RestMethodInheritTest {
@Test
public void b01_parsers_default() throws Exception {
- b.get("/default").execute().assertBody("['text/p3','text/p4','text/p1','text/p2']");
+ b.get("/default").run().assertBody().is("['text/p3','text/p4','text/p1','text/p2']");
}
@Test
public void b02_parsers_onMethod() throws Exception {
- b.get("/onMethod").execute().assertBody("['text/p5']");
+ b.get("/onMethod").run().assertBody().is("['text/p5']");
}
@Test
public void b03_parsers_onMethodInherit() throws Exception {
- b.get("/onMethodInherit").execute().assertBody("['text/p5','text/p3','text/p4','text/p1','text/p2']");
+ b.get("/onMethodInherit").run().assertBody().is("['text/p5','text/p3','text/p4','text/p1','text/p2']");
}
//=================================================================================================================
@@ -250,19 +250,19 @@ public class RestMethodInheritTest {
@Test
public void d01_transforms_default() throws Exception {
- d.get("/d01").json().execute().assertBody("['F1','F2','Foo3']");
+ d.get("/d01").json().run().assertBody().is("['F1','F2','Foo3']");
}
@Test
public void d02_transforms_inheritTransforms() throws Exception {
- d.get("/d02").json().execute().assertBody("['F1','F2','F3']");
+ d.get("/d02").json().run().assertBody().is("['F1','F2','F3']");
}
@Test
public void d03_transforms_overrideSerializer() throws Exception {
- d.get("/d03").json().execute().assertBody("['Foo1','Foo2','F3']");
+ d.get("/d03").json().run().assertBody().is("['Foo1','Foo2','F3']");
}
@Test
public void d04_transforms_overrideSerializerInheritTransforms() throws Exception {
- d.get("/d04").json().execute().assertBody("['F1','F2','F3']");
+ d.get("/d04").json().run().assertBody().is("['F1','F2','F3']");
}
//=================================================================================================================
@@ -309,14 +309,14 @@ public class RestMethodInheritTest {
@Test
public void e01_properties_default() throws Exception {
- e.get("/e01").execute().assertBody("{p1:'v1',p2:'v2a',p3:'v3',p4:'v4'}");
+ e.get("/e01").run().assertBody().is("{p1:'v1',p2:'v2a',p3:'v3',p4:'v4'}");
}
@Test
public void e02a_properties_override_false() throws Exception {
- e.get("/e02").execute().assertBody("{p1:'v1',p2:'v2a',p3:'v3',p4:'v4a',p5:'v5'}");
+ e.get("/e02").run().assertBody().is("{p1:'v1',p2:'v2a',p3:'v3',p4:'v4a',p5:'v5'}");
}
@Test
public void e02b_properties_override_true() throws Exception {
- e.get("/e02?override").execute().assertBody("{p1:'x',p2:'x',p3:'x',p4:'x',p5:'x'}");
+ e.get("/e02?override").run().assertBody().is("{p1:'x',p2:'x',p3:'x',p4:'x',p5:'x'}");
}
}
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 3b4ce46..4428a24 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
@@ -128,39 +128,39 @@ public class RestResourceParsersTest {
@Test
public void a01_parserOnClass() throws Exception {
- a.put("/parserOnClass", "test1").contentType("text/a").execute().assertBody("text/a - test1");
- a.put("/parserOnClass?noTrace=true", "test1").contentType("text/b").execute()
- .assertStatus(415)
- .assertBodyContains(
+ a.put("/parserOnClass", "test1").contentType("text/a").run().assertBody().is("text/a - test1");
+ a.put("/parserOnClass?noTrace=true", "test1").contentType("text/b").run()
+ .assertStatus().equals(415)
+ .assertBody().contains(
"Unsupported media-type in request header 'Content-Type': 'text/b'",
"Supported media-types: ['text/a"
);
}
@Test
public void a02_parserOnMethod() throws Exception {
- a.put("/parserOnMethod", "test2").contentType("text/b").execute().assertBody("text/b - test2");
- a.put("/parserOnMethod?noTrace=true", "test2").contentType("text/a").execute()
- .assertStatus(415)
- .assertBodyContains(
+ a.put("/parserOnMethod", "test2").contentType("text/b").run().assertBody().is("text/b - test2");
+ a.put("/parserOnMethod?noTrace=true", "test2").contentType("text/a").run()
+ .assertStatus().equals(415)
+ .assertBody().contains(
"Unsupported media-type in request header 'Content-Type': 'text/a'",
"Supported media-types: ['text/b']"
);
}
@Test
public void a03_parserOverriddenOnMethod() throws Exception {
- a.put("/parserOverriddenOnMethod", "test3").contentType("text/a").execute().assertBody("text/a - test3");
- a.put("/parserOverriddenOnMethod", "test3").contentType("text/b").execute().assertBody("text/b - test3");
+ a.put("/parserOverriddenOnMethod", "test3").contentType("text/a").run().assertBody().is("text/a - test3");
+ a.put("/parserOverriddenOnMethod", "test3").contentType("text/b").run().assertBody().is("text/b - test3");
}
@Test
public void a04_parserWithDifferentMediaTypes() throws Exception {
- a.put("/parserWithDifferentMediaTypes", "test4").contentType("text/a").execute().assertBody("text/a - test4");
- a.put("/parserWithDifferentMediaTypes", "test4").contentType("text/d").execute().assertBody("text/d - test4");
+ a.put("/parserWithDifferentMediaTypes", "test4").contentType("text/a").run().assertBody().is("text/a - test4");
+ a.put("/parserWithDifferentMediaTypes", "test4").contentType("text/d").run().assertBody().is("text/d - test4");
}
@Test
public void a05_validErrorResponse() throws Exception {
- a.put("/validErrorResponse?noTrace=true", "test1").contentType("text/bad").execute()
- .assertStatus(415)
- .assertBodyContains(
+ a.put("/validErrorResponse?noTrace=true", "test1").contentType("text/bad").run()
+ .assertStatus().equals(415)
+ .assertBody().contains(
"Unsupported media-type in request header 'Content-Type': 'text/bad'",
"Supported media-types: ['text/a"
);
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RestResourcePojoSwapsTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RestResourcePojoSwapsTest.java
index ae1b9c4..a8cd9d7 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RestResourcePojoSwapsTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RestResourcePojoSwapsTest.java
@@ -123,15 +123,15 @@ public class RestResourcePojoSwapsTest {
@Test
public void a01_classTransformOverridesParentClassTransform() throws Exception {
- a.get("/classTransformOverridesParentClassTransform").json().execute().assertBody("'A2-0'");
- a.put("/classTransformOverridesParentClassTransform", "'A2-1'").json().execute().assertBody("'A2-1'");
- a.put("/classTransformOverridesParentClassTransform/A2-2", null).json().execute().assertBody("'A2-2'");
+ a.get("/classTransformOverridesParentClassTransform").json().run().assertBody().is("'A2-0'");
+ a.put("/classTransformOverridesParentClassTransform", "'A2-1'").json().run().assertBody().is("'A2-1'");
+ a.put("/classTransformOverridesParentClassTransform/A2-2", null).json().run().assertBody().is("'A2-2'");
}
@Test
public void a02_methodTransformOverridesClassTransform() throws Exception {
- a.get("/methodTransformOverridesClassTransform").json().execute().assertBody("'A3-0'");
- a.put("/methodTransformOverridesClassTransform", "'A3-1'").json().execute().assertBody("'A3-1'");
- a.put("/methodTransformOverridesClassTransform/A3-2", null).json().execute().assertBody("'A3-2'");
+ a.get("/methodTransformOverridesClassTransform").json().run().assertBody().is("'A3-0'");
+ a.put("/methodTransformOverridesClassTransform", "'A3-1'").json().run().assertBody().is("'A3-1'");
+ a.put("/methodTransformOverridesClassTransform/A3-2", null).json().run().assertBody().is("'A3-2'");
}
}
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 580dba3..0ec9f34 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
@@ -36,16 +36,16 @@ public class RoleGuardTest {
@Test
public void a01a_onClass_simple_pass() throws Exception {
- a1.get().roles("foo").execute().assertStatus(200);
- a1.get().roles("foo","bar").execute().assertStatus(200);
- a1.get().roles("bar","foo").execute().assertStatus(200);
+ a1.get().roles("foo").run().assertStatus().equals(200);
+ a1.get().roles("foo","bar").run().assertStatus().equals(200);
+ a1.get().roles("bar","foo").run().assertStatus().equals(200);
}
@Test
public void a01b_onClass_simple_fail() throws Exception {
- a1.get().execute().assertStatus(403);
- a1.get().roles("foo2").execute().assertStatus(403);
- a1.get().roles("foo2","bar").execute().assertStatus(403);
+ a1.get().run().assertStatus().equals(403);
+ a1.get().roles("foo2").run().assertStatus().equals(403);
+ a1.get().roles("foo2","bar").run().assertStatus().equals(403);
}
//-----------------------------------------------------------------------------------------------------------------
@@ -63,16 +63,16 @@ public class RoleGuardTest {
@Test
public void a02a_onMethod_simple_pass() throws Exception {
- a2.get().roles("foo").execute().assertStatus(200);
- a2.get().roles("foo","bar").execute().assertStatus(200);
- a2.get().roles("bar","foo").execute().assertStatus(200);
+ a2.get().roles("foo").run().assertStatus().equals(200);
+ a2.get().roles("foo","bar").run().assertStatus().equals(200);
+ a2.get().roles("bar","foo").run().assertStatus().equals(200);
}
@Test
public void a02b_onMethod_simple_fail() throws Exception {
- a2.get().execute().assertStatus(403);
- a2.get().roles("foo2").execute().assertStatus(403);
- a2.get().roles("foo2","bar").execute().assertStatus(403);
+ a2.get().run().assertStatus().equals(403);
+ a2.get().roles("foo2").run().assertStatus().equals(403);
+ a2.get().roles("foo2","bar").run().assertStatus().equals(403);
}
//-----------------------------------------------------------------------------------------------------------------
@@ -90,18 +90,18 @@ public class RoleGuardTest {
@Test
public void a03a_onBoth_simple_pass() throws Exception {
- a3.get().roles("foo","bar").execute().assertStatus(200);
- a3.get().roles("bar","foo").execute().assertStatus(200);
- a3.get().roles("bar","foo","baz").execute().assertStatus(200);
+ a3.get().roles("foo","bar").run().assertStatus().equals(200);
+ a3.get().roles("bar","foo").run().assertStatus().equals(200);
+ a3.get().roles("bar","foo","baz").run().assertStatus().equals(200);
}
@Test
public void a03b_onBoth_simple_fail() throws Exception {
- a3.get().execute().assertStatus(403);
- a3.get().roles("foo").execute().assertStatus(403);
- a3.get().roles("bar").execute().assertStatus(403);
- a3.get().roles("foo2").execute().assertStatus(403);
- a3.get().roles("foo2","bar").execute().assertStatus(403);
+ a3.get().run().assertStatus().equals(403);
+ a3.get().roles("foo").run().assertStatus().equals(403);
+ a3.get().roles("bar").run().assertStatus().equals(403);
+ a3.get().roles("foo2").run().assertStatus().equals(403);
+ a3.get().roles("foo2","bar").run().assertStatus().equals(403);
}
//-----------------------------------------------------------------------------------------------------------------
@@ -129,21 +129,21 @@ public class RoleGuardTest {
@Test
public void a04a_inheritence_simple_pass() throws Exception {
- a4.get().roles("foo","bar","baz","qux").execute().assertStatus(200);
- a4.get().roles("foo","bar","baz","qux","quux").execute().assertStatus(200);
+ a4.get().roles("foo","bar","baz","qux").run().assertStatus().equals(200);
+ a4.get().roles("foo","bar","baz","qux","quux").run().assertStatus().equals(200);
}
@Test
public void a04b_inheritence_simple_fail() throws Exception {
- a3.get().execute().assertStatus(403);
- a3.get().roles("foo").execute().assertStatus(403);
- a3.get().roles("bar").execute().assertStatus(403);
- a3.get().roles("baz").execute().assertStatus(403);
- a3.get().roles("qux").execute().assertStatus(403);
- a4.get().roles("foo","bar","baz").execute().assertStatus(403);
- a4.get().roles("foo","bar","qux").execute().assertStatus(403);
- a4.get().roles("foo","baz","qux").execute().assertStatus(403);
- a4.get().roles("bar","baz","qux").execute().assertStatus(403);
+ a3.get().run().assertStatus().equals(403);
+ a3.get().roles("foo").run().assertStatus().equals(403);
+ a3.get().roles("bar").run().assertStatus().equals(403);
+ a3.get().roles("baz").run().assertStatus().equals(403);
+ a3.get().roles("qux").run().assertStatus().equals(403);
+ a4.get().roles("foo","bar","baz").run().assertStatus().equals(403);
+ a4.get().roles("foo","bar","qux").run().assertStatus().equals(403);
+ a4.get().roles("foo","baz","qux").run().assertStatus().equals(403);
+ a4.get().roles("bar","baz","qux").run().assertStatus().equals(403);
}
//-----------------------------------------------------------------------------------------------------------------
@@ -194,130 +194,130 @@ public class RoleGuardTest {
@Test
public void b01a_orsWithComma_pass() throws Exception {
// @Rest(roleGuard="foo,bar")
- b1a.get().roles("foo").execute().assertStatus(200);
- b1a.get().roles("bar").execute().assertStatus(200);
- b1a.get().roles("foo","bar").execute().assertStatus(200);
- b1a.get().roles("foo","bar","baz").execute().assertStatus(200);
+ b1a.get().roles("foo").run().assertStatus().equals(200);
+ b1a.get().roles("bar").run().assertStatus().equals(200);
+ b1a.get().roles("foo","bar").run().assertStatus().equals(200);
+ b1a.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void b01b_orsWithComma_fail() throws Exception {
// @Rest(roleGuard="foo,bar")
- b1a.get().roles().execute().assertStatus(403);
- b1a.get().roles("baz").execute().assertStatus(403);
+ b1a.get().roles().run().assertStatus().equals(403);
+ b1a.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void b01c_orsWithSinglePipe_pass() throws Exception {
// @Rest(roleGuard="foo | bar")
- b1b.get().roles("foo").execute().assertStatus(200);
- b1b.get().roles("bar").execute().assertStatus(200);
- b1b.get().roles("foo","bar").execute().assertStatus(200);
- b1b.get().roles("foo","bar","baz").execute().assertStatus(200);
+ b1b.get().roles("foo").run().assertStatus().equals(200);
+ b1b.get().roles("bar").run().assertStatus().equals(200);
+ b1b.get().roles("foo","bar").run().assertStatus().equals(200);
+ b1b.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void b01d_orsWithSinglePipe_fail() throws Exception {
// @Rest(roleGuard="foo | bar")
- b1b.get().roles().execute().assertStatus(403);
- b1b.get().roles("baz").execute().assertStatus(403);
+ b1b.get().roles().run().assertStatus().equals(403);
+ b1b.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void b01e_orsWithDoublePipe_pass() throws Exception {
// @Rest(roleGuard="foo || bar")
- b1c.get().roles("foo").execute().assertStatus(200);
- b1c.get().roles("bar").execute().assertStatus(200);
- b1c.get().roles("foo","bar").execute().assertStatus(200);
- b1c.get().roles("foo","bar","baz").execute().assertStatus(200);
+ b1c.get().roles("foo").run().assertStatus().equals(200);
+ b1c.get().roles("bar").run().assertStatus().equals(200);
+ b1c.get().roles("foo","bar").run().assertStatus().equals(200);
+ b1c.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void b01f_orsWithDoublePipe_fail() throws Exception {
// @Rest(roleGuard="foo || bar")
- b1c.get().roles().execute().assertStatus(403);
- b1c.get().roles("baz").execute().assertStatus(403);
+ b1c.get().roles().run().assertStatus().equals(403);
+ b1c.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void b01g_andsWithSingleAmp_pass() throws Exception {
// @Rest(roleGuard="foo & bar")
- b1d.get().roles("foo","bar").execute().assertStatus(200);
- b1d.get().roles("foo","bar","baz").execute().assertStatus(200);
+ b1d.get().roles("foo","bar").run().assertStatus().equals(200);
+ b1d.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void b01h_andsWithSingleAmp_fail() throws Exception {
// @Rest(roleGuard="foo & bar")
- b1d.get().roles().execute().assertStatus(403);
- b1d.get().roles("foo").execute().assertStatus(403);
- b1d.get().roles("bar").execute().assertStatus(403);
- b1d.get().roles("baz").execute().assertStatus(403);
+ b1d.get().roles().run().assertStatus().equals(403);
+ b1d.get().roles("foo").run().assertStatus().equals(403);
+ b1d.get().roles("bar").run().assertStatus().equals(403);
+ b1d.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void b01i_andsWithDoubleAmp_pass() throws Exception {
// @Rest(roleGuard="foo && bar")
- b1e.get().roles("foo","bar").execute().assertStatus(200);
- b1e.get().roles("foo","bar","baz").execute().assertStatus(200);
+ b1e.get().roles("foo","bar").run().assertStatus().equals(200);
+ b1e.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void b01j_andsWithDoubleAmp_fail() throws Exception {
// @Rest(roleGuard="foo && bar")
- b1e.get().roles().execute().assertStatus(403);
- b1e.get().roles("foo").execute().assertStatus(403);
- b1e.get().roles("bar").execute().assertStatus(403);
- b1e.get().roles("baz").execute().assertStatus(403);
+ b1e.get().roles().run().assertStatus().equals(403);
+ b1e.get().roles("foo").run().assertStatus().equals(403);
+ b1e.get().roles("bar").run().assertStatus().equals(403);
+ b1e.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void b01k_andsWithDoubleAmpAndParens_pass() throws Exception {
// @Rest(roleGuard="(foo) && (bar)")
- b1f.get().roles("foo","bar").execute().assertStatus(200);
- b1f.get().roles("foo","bar","baz").execute().assertStatus(200);
+ b1f.get().roles("foo","bar").run().assertStatus().equals(200);
+ b1f.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void b01l_andsWithDoubleAmpAndParens_fail() throws Exception {
// @Rest(roleGuard="(foo) && (bar)")
- b1f.get().roles().execute().assertStatus(403);
- b1f.get().roles("foo").execute().assertStatus(403);
- b1f.get().roles("bar").execute().assertStatus(403);
- b1f.get().roles("baz").execute().assertStatus(403);
+ b1f.get().roles().run().assertStatus().equals(403);
+ b1f.get().roles("foo").run().assertStatus().equals(403);
+ b1f.get().roles("bar").run().assertStatus().equals(403);
+ b1f.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void b01m_complex_pass() throws Exception {
// @Rest(roleGuard="foo && (bar || baz)")
- b1g.get().roles("foo","bar").execute().assertStatus(200);
- b1g.get().roles("foo","baz").execute().assertStatus(200);
- b1g.get().roles("foo","bar","baz").execute().assertStatus(200);
+ b1g.get().roles("foo","bar").run().assertStatus().equals(200);
+ b1g.get().roles("foo","baz").run().assertStatus().equals(200);
+ b1g.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void b01n_complex_fail() throws Exception {
// @Rest(roleGuard="foo && (bar || baz)")
- b1g.get().roles().execute().assertStatus(403);
- b1g.get().roles("foo").execute().assertStatus(403);
- b1g.get().roles("bar","baz").execute().assertStatus(403);
- b1g.get().roles("baz").execute().assertStatus(403);
+ b1g.get().roles().run().assertStatus().equals(403);
+ b1g.get().roles("foo").run().assertStatus().equals(403);
+ b1g.get().roles("bar","baz").run().assertStatus().equals(403);
+ b1g.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void b01o_complex_pass() throws Exception {
// @Rest(roleGuard="foo || (bar && baz)")
- b1h.get().roles("foo").execute().assertStatus(200);
- b1h.get().roles("bar","baz").execute().assertStatus(200);
- b1h.get().roles("foo","bar","baz").execute().assertStatus(200);
+ b1h.get().roles("foo").run().assertStatus().equals(200);
+ b1h.get().roles("bar","baz").run().assertStatus().equals(200);
+ b1h.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void b01p_complex_fail() throws Exception {
// @Rest(roleGuard="foo || (bar && baz)")
- b1h.get().roles().execute().assertStatus(403);
- b1h.get().roles("bar").execute().assertStatus(403);
- b1h.get().roles("baz").execute().assertStatus(403);
+ b1h.get().roles().run().assertStatus().equals(403);
+ b1h.get().roles("bar").run().assertStatus().equals(403);
+ b1h.get().roles("baz").run().assertStatus().equals(403);
}
//-----------------------------------------------------------------------------------------------------------------
@@ -400,130 +400,130 @@ public class RoleGuardTest {
@Test
public void b02a_orsWithComma_pass() throws Exception {
// @RestMethod(roleGuard="foo,bar")
- b2a.get().roles("foo").execute().assertStatus(200);
- b2a.get().roles("bar").execute().assertStatus(200);
- b2a.get().roles("foo","bar").execute().assertStatus(200);
- b2a.get().roles("foo","bar","baz").execute().assertStatus(200);
+ b2a.get().roles("foo").run().assertStatus().equals(200);
+ b2a.get().roles("bar").run().assertStatus().equals(200);
+ b2a.get().roles("foo","bar").run().assertStatus().equals(200);
+ b2a.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void b02b_orsWithComma_fail() throws Exception {
// @RestMethod(roleGuard="foo,bar")
- b2a.get().roles().execute().assertStatus(403);
- b2a.get().roles("baz").execute().assertStatus(403);
+ b2a.get().roles().run().assertStatus().equals(403);
+ b2a.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void b02c_orsWithSinglePipe_pass() throws Exception {
// @RestMethod(roleGuard="foo | bar")
- b2b.get().roles("foo").execute().assertStatus(200);
- b2b.get().roles("bar").execute().assertStatus(200);
- b2b.get().roles("foo","bar").execute().assertStatus(200);
- b2b.get().roles("foo","bar","baz").execute().assertStatus(200);
+ b2b.get().roles("foo").run().assertStatus().equals(200);
+ b2b.get().roles("bar").run().assertStatus().equals(200);
+ b2b.get().roles("foo","bar").run().assertStatus().equals(200);
+ b2b.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void b02d_orsWithSinglePipe_fail() throws Exception {
// @RestMethod(roleGuard="foo | bar")
- b2b.get().roles().execute().assertStatus(403);
- b2b.get().roles("baz").execute().assertStatus(403);
+ b2b.get().roles().run().assertStatus().equals(403);
+ b2b.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void b02e_orsWithDoublePipe_pass() throws Exception {
// @RestMethod(roleGuard="foo || bar")
- b2c.get().roles("foo").execute().assertStatus(200);
- b2c.get().roles("bar").execute().assertStatus(200);
- b2c.get().roles("foo","bar").execute().assertStatus(200);
- b2c.get().roles("foo","bar","baz").execute().assertStatus(200);
+ b2c.get().roles("foo").run().assertStatus().equals(200);
+ b2c.get().roles("bar").run().assertStatus().equals(200);
+ b2c.get().roles("foo","bar").run().assertStatus().equals(200);
+ b2c.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void b02f_orsWithDoublePipe_fail() throws Exception {
// @RestMethod(roleGuard="foo || bar")
- b2c.get().roles().execute().assertStatus(403);
- b2c.get().roles("baz").execute().assertStatus(403);
+ b2c.get().roles().run().assertStatus().equals(403);
+ b2c.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void b02g_andsWithSingleAmp_pass() throws Exception {
// @RestMethod(roleGuard="foo & bar")
- b2d.get().roles("foo","bar").execute().assertStatus(200);
- b2d.get().roles("foo","bar","baz").execute().assertStatus(200);
+ b2d.get().roles("foo","bar").run().assertStatus().equals(200);
+ b2d.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void b02h_andsWithSingleAmp_fail() throws Exception {
// @RestMethod(roleGuard="foo & bar")
- b2d.get().roles().execute().assertStatus(403);
- b2d.get().roles("foo").execute().assertStatus(403);
- b2d.get().roles("bar").execute().assertStatus(403);
- b2d.get().roles("baz").execute().assertStatus(403);
+ b2d.get().roles().run().assertStatus().equals(403);
+ b2d.get().roles("foo").run().assertStatus().equals(403);
+ b2d.get().roles("bar").run().assertStatus().equals(403);
+ b2d.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void b02i_andsWithDoubleAmp_pass() throws Exception {
// @RestMethod(roleGuard="foo && bar")
- b2e.get().roles("foo","bar").execute().assertStatus(200);
- b2e.get().roles("foo","bar","baz").execute().assertStatus(200);
+ b2e.get().roles("foo","bar").run().assertStatus().equals(200);
+ b2e.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void b02j_andsWithDoubleAmp_fail() throws Exception {
// @RestMethod(roleGuard="foo && bar")
- b2e.get().roles().execute().assertStatus(403);
- b2e.get().roles("foo").execute().assertStatus(403);
- b2e.get().roles("bar").execute().assertStatus(403);
- b2e.get().roles("baz").execute().assertStatus(403);
+ b2e.get().roles().run().assertStatus().equals(403);
+ b2e.get().roles("foo").run().assertStatus().equals(403);
+ b2e.get().roles("bar").run().assertStatus().equals(403);
+ b2e.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void b02k_andsWithDoubleAmpAndParens_pass() throws Exception {
// @RestMethod(roleGuard="(foo) && (bar)")
- b2f.get().roles("foo","bar").execute().assertStatus(200);
- b2f.get().roles("foo","bar","baz").execute().assertStatus(200);
+ b2f.get().roles("foo","bar").run().assertStatus().equals(200);
+ b2f.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void b02l_andsWithDoubleAmpAndParens_fail() throws Exception {
// @RestMethod(roleGuard="(foo) && (bar)")
- b2f.get().roles().execute().assertStatus(403);
- b2f.get().roles("foo").execute().assertStatus(403);
- b2f.get().roles("bar").execute().assertStatus(403);
- b2f.get().roles("baz").execute().assertStatus(403);
+ b2f.get().roles().run().assertStatus().equals(403);
+ b2f.get().roles("foo").run().assertStatus().equals(403);
+ b2f.get().roles("bar").run().assertStatus().equals(403);
+ b2f.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void b02m_complex_pass() throws Exception {
// @RestMethod(roleGuard="foo && (bar || baz)")
- b2g.get().roles("foo","bar").execute().assertStatus(200);
- b2g.get().roles("foo","baz").execute().assertStatus(200);
- b2g.get().roles("foo","bar","baz").execute().assertStatus(200);
+ b2g.get().roles("foo","bar").run().assertStatus().equals(200);
+ b2g.get().roles("foo","baz").run().assertStatus().equals(200);
+ b2g.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void b02n_complex_fail() throws Exception {
// @RestMethod(roleGuard="foo && (bar || baz)")
- b2g.get().roles().execute().assertStatus(403);
- b2g.get().roles("foo").execute().assertStatus(403);
- b2g.get().roles("bar","baz").execute().assertStatus(403);
- b2g.get().roles("baz").execute().assertStatus(403);
+ b2g.get().roles().run().assertStatus().equals(403);
+ b2g.get().roles("foo").run().assertStatus().equals(403);
+ b2g.get().roles("bar","baz").run().assertStatus().equals(403);
+ b2g.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void b02o_complex_pass() throws Exception {
// @RestMethod(roleGuard="foo || (bar && baz)")
- b2h.get().roles("foo").execute().assertStatus(200);
- b2h.get().roles("bar","baz").execute().assertStatus(200);
- b2h.get().roles("foo","bar","baz").execute().assertStatus(200);
+ b2h.get().roles("foo").run().assertStatus().equals(200);
+ b2h.get().roles("bar","baz").run().assertStatus().equals(200);
+ b2h.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void b02p_complex_fail() throws Exception {
// @RestMethod(roleGuard="foo || (bar && baz)")
- b2h.get().roles().execute().assertStatus(403);
- b2h.get().roles("bar").execute().assertStatus(403);
- b2h.get().roles("baz").execute().assertStatus(403);
+ b2h.get().roles().run().assertStatus().equals(403);
+ b2h.get().roles("bar").run().assertStatus().equals(403);
+ b2h.get().roles("baz").run().assertStatus().equals(403);
}
//-----------------------------------------------------------------------------------------------------------------
@@ -574,130 +574,130 @@ public class RoleGuardTest {
@Test
public void c01a_orPatternsWithComma_pass() throws Exception {
// @Rest(roleGuard="fo*,*ar")
- c1a.get().roles("foo").execute().assertStatus(200);
- c1a.get().roles("bar").execute().assertStatus(200);
- c1a.get().roles("foo","bar").execute().assertStatus(200);
- c1a.get().roles("foo","bar","baz").execute().assertStatus(200);
+ c1a.get().roles("foo").run().assertStatus().equals(200);
+ c1a.get().roles("bar").run().assertStatus().equals(200);
+ c1a.get().roles("foo","bar").run().assertStatus().equals(200);
+ c1a.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void c01b_orPatternsWithComma_fail() throws Exception {
// @Rest(roleGuard="fo*,*ar")
- c1a.get().roles().execute().assertStatus(403);
- c1a.get().roles("baz").execute().assertStatus(403);
+ c1a.get().roles().run().assertStatus().equals(403);
+ c1a.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void c01c_orPatternsWithSinglePipe_pass() throws Exception {
// @Rest(roleGuard="fo* | *ar")
- c1b.get().roles("foo").execute().assertStatus(200);
- c1b.get().roles("bar").execute().assertStatus(200);
- c1b.get().roles("foo","bar").execute().assertStatus(200);
- c1b.get().roles("foo","bar","baz").execute().assertStatus(200);
+ c1b.get().roles("foo").run().assertStatus().equals(200);
+ c1b.get().roles("bar").run().assertStatus().equals(200);
+ c1b.get().roles("foo","bar").run().assertStatus().equals(200);
+ c1b.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void c01d_orPatternsWithSinglePipe_fail() throws Exception {
// @Rest(roleGuard="fo* | *ar")
- c1b.get().roles().execute().assertStatus(403);
- c1b.get().roles("baz").execute().assertStatus(403);
+ c1b.get().roles().run().assertStatus().equals(403);
+ c1b.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void c01e_orPatternsWithDoublePipe_pass() throws Exception {
// @Rest(roleGuard="fo* || *ar")
- c1c.get().roles("foo").execute().assertStatus(200);
- c1c.get().roles("bar").execute().assertStatus(200);
- c1c.get().roles("foo","bar").execute().assertStatus(200);
- c1c.get().roles("foo","bar","baz").execute().assertStatus(200);
+ c1c.get().roles("foo").run().assertStatus().equals(200);
+ c1c.get().roles("bar").run().assertStatus().equals(200);
+ c1c.get().roles("foo","bar").run().assertStatus().equals(200);
+ c1c.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void c01f_orPatternsWithDoublePipe_fail() throws Exception {
// @Rest(roleGuard="fo* || *ar")
- c1c.get().roles().execute().assertStatus(403);
- c1c.get().roles("baz").execute().assertStatus(403);
+ c1c.get().roles().run().assertStatus().equals(403);
+ c1c.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void c01g_andPatternsWithSingleAmp_pass() throws Exception {
// @Rest(roleGuard="fo* & *ar")
- c1d.get().roles("foo","bar").execute().assertStatus(200);
- c1d.get().roles("foo","bar","baz").execute().assertStatus(200);
+ c1d.get().roles("foo","bar").run().assertStatus().equals(200);
+ c1d.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void c01h_andPatternsWithSingleAmp_fail() throws Exception {
// @Rest(roleGuard="fo* & *ar")
- c1d.get().roles().execute().assertStatus(403);
- c1d.get().roles("foo").execute().assertStatus(403);
- c1d.get().roles("bar").execute().assertStatus(403);
- c1d.get().roles("baz").execute().assertStatus(403);
+ c1d.get().roles().run().assertStatus().equals(403);
+ c1d.get().roles("foo").run().assertStatus().equals(403);
+ c1d.get().roles("bar").run().assertStatus().equals(403);
+ c1d.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void c01i_andPatternsWithDoubleAmp_pass() throws Exception {
// @Rest(roleGuard="fo* && *ar")
- c1e.get().roles("foo","bar").execute().assertStatus(200);
- c1e.get().roles("foo","bar","baz").execute().assertStatus(200);
+ c1e.get().roles("foo","bar").run().assertStatus().equals(200);
+ c1e.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void c01j_andPatternsWithDoubleAmp_fail() throws Exception {
// @Rest(roleGuard="fo* && *ar")
- c1e.get().roles().execute().assertStatus(403);
- c1e.get().roles("foo").execute().assertStatus(403);
- c1e.get().roles("bar").execute().assertStatus(403);
- c1e.get().roles("baz").execute().assertStatus(403);
+ c1e.get().roles().run().assertStatus().equals(403);
+ c1e.get().roles("foo").run().assertStatus().equals(403);
+ c1e.get().roles("bar").run().assertStatus().equals(403);
+ c1e.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void c01k_andPatternsWithDoubleAmpAndParens_pass() throws Exception {
// @Rest(roleGuard="(fo*) && (*ar)")
- c1f.get().roles("foo","bar").execute().assertStatus(200);
- c1f.get().roles("foo","bar","baz").execute().assertStatus(200);
+ c1f.get().roles("foo","bar").run().assertStatus().equals(200);
+ c1f.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void c01l_andPatternsWithDoubleAmpAndParens_fail() throws Exception {
// @Rest(roleGuard="(fo*) && (*ar)")
- c1f.get().roles().execute().assertStatus(403);
- c1f.get().roles("foo").execute().assertStatus(403);
- c1f.get().roles("bar").execute().assertStatus(403);
- c1f.get().roles("baz").execute().assertStatus(403);
+ c1f.get().roles().run().assertStatus().equals(403);
+ c1f.get().roles("foo").run().assertStatus().equals(403);
+ c1f.get().roles("bar").run().assertStatus().equals(403);
+ c1f.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void c01m_complexPatterns_pass() throws Exception {
// @Rest(roleGuard="fo* && (*ar || *az)")
- c1g.get().roles("foo","bar").execute().assertStatus(200);
- c1g.get().roles("foo","baz").execute().assertStatus(200);
- c1g.get().roles("foo","bar","baz").execute().assertStatus(200);
+ c1g.get().roles("foo","bar").run().assertStatus().equals(200);
+ c1g.get().roles("foo","baz").run().assertStatus().equals(200);
+ c1g.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void c01n_complexPatterns_fail() throws Exception {
// @Rest(roleGuard="fo* && (*ar || *az)")
- c1g.get().roles().execute().assertStatus(403);
- c1g.get().roles("foo").execute().assertStatus(403);
- c1g.get().roles("bar","baz").execute().assertStatus(403);
- c1g.get().roles("baz").execute().assertStatus(403);
+ c1g.get().roles().run().assertStatus().equals(403);
+ c1g.get().roles("foo").run().assertStatus().equals(403);
+ c1g.get().roles("bar","baz").run().assertStatus().equals(403);
+ c1g.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void c01o_complexPatterns_pass() throws Exception {
// @Rest(roleGuard="fo* || (*ar && *az)")
- c1h.get().roles("foo").execute().assertStatus(200);
- c1h.get().roles("bar","baz").execute().assertStatus(200);
- c1h.get().roles("foo","bar","baz").execute().assertStatus(200);
+ c1h.get().roles("foo").run().assertStatus().equals(200);
+ c1h.get().roles("bar","baz").run().assertStatus().equals(200);
+ c1h.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void c01p_complexPatterns_fail() throws Exception {
// @Rest(roleGuard="fo* || (*ar && *az)")
- c1h.get().roles().execute().assertStatus(403);
- c1h.get().roles("bar").execute().assertStatus(403);
- c1h.get().roles("baz").execute().assertStatus(403);
+ c1h.get().roles().run().assertStatus().equals(403);
+ c1h.get().roles("bar").run().assertStatus().equals(403);
+ c1h.get().roles("baz").run().assertStatus().equals(403);
}
//-----------------------------------------------------------------------------------------------------------------
@@ -780,130 +780,130 @@ public class RoleGuardTest {
@Test
public void c02a_orPatternsWithComma_pass() throws Exception {
// @RestMethod(roleGuard="fo*,*ar")
- c2a.get().roles("foo").execute().assertStatus(200);
- c2a.get().roles("bar").execute().assertStatus(200);
- c2a.get().roles("foo","bar").execute().assertStatus(200);
- c2a.get().roles("foo","bar","baz").execute().assertStatus(200);
+ c2a.get().roles("foo").run().assertStatus().equals(200);
+ c2a.get().roles("bar").run().assertStatus().equals(200);
+ c2a.get().roles("foo","bar").run().assertStatus().equals(200);
+ c2a.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void c02b_orPatternsWithComma_fail() throws Exception {
// @RestMethod(roleGuard="fo*,*ar")
- c2a.get().roles().execute().assertStatus(403);
- c2a.get().roles("baz").execute().assertStatus(403);
+ c2a.get().roles().run().assertStatus().equals(403);
+ c2a.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void c02c_orPatternsWithSinglePipe_pass() throws Exception {
// @RestMethod(roleGuard="fo* | *ar")
- c2b.get().roles("foo").execute().assertStatus(200);
- c2b.get().roles("bar").execute().assertStatus(200);
- c2b.get().roles("foo","bar").execute().assertStatus(200);
- c2b.get().roles("foo","bar","baz").execute().assertStatus(200);
+ c2b.get().roles("foo").run().assertStatus().equals(200);
+ c2b.get().roles("bar").run().assertStatus().equals(200);
+ c2b.get().roles("foo","bar").run().assertStatus().equals(200);
+ c2b.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void c02d_orPatternsWithSinglePipe_fail() throws Exception {
// @RestMethod(roleGuard="fo* | *ar")
- c2b.get().roles().execute().assertStatus(403);
- c2b.get().roles("baz").execute().assertStatus(403);
+ c2b.get().roles().run().assertStatus().equals(403);
+ c2b.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void c02e_orPatternsWithDoublePipe_pass() throws Exception {
// @RestMethod(roleGuard="fo* || *ar")
- c2c.get().roles("foo").execute().assertStatus(200);
- c2c.get().roles("bar").execute().assertStatus(200);
- c2c.get().roles("foo","bar").execute().assertStatus(200);
- c2c.get().roles("foo","bar","baz").execute().assertStatus(200);
+ c2c.get().roles("foo").run().assertStatus().equals(200);
+ c2c.get().roles("bar").run().assertStatus().equals(200);
+ c2c.get().roles("foo","bar").run().assertStatus().equals(200);
+ c2c.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void c02f_orPatternsWithDoublePipe_fail() throws Exception {
// @RestMethod(roleGuard="foo || bar")
- c2c.get().roles().execute().assertStatus(403);
- c2c.get().roles("baz").execute().assertStatus(403);
+ c2c.get().roles().run().assertStatus().equals(403);
+ c2c.get().roles("baz").run().assertStatus().equals(403);
}
@Test
public void c02g_andPatternsWithSingleAmp_pass() throws Exception {
// @RestMethod(roleGuard="fo* & *ar")
- c2d.get().roles("foo","bar").execute().assertStatus(200);
- c2d.get().roles("foo","bar","baz").execute().assertStatus(200);
+ c2d.get().roles("foo","bar").run().assertStatus().equals(200);
+ c2d.get().roles("foo","bar","baz").run().assertStatus().equals(200);
}
@Test
public void c02h_andPatternsWithSingleAmp_fail() throws Exception {
// @RestMethod(roleGuard="fo* & *ar")
- c2d.get().roles().execute().assertStatus(403);
... 2324 lines suppressed ...