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/27 16:20:56 UTC
[juneau] branch master updated: MockRestClient improvements.
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 7960cfb MockRestClient improvements.
7960cfb is described below
commit 7960cfb1478e789d2259fbc921474087b96a5b2c
Author: JamesBognar <ja...@salesforce.com>
AuthorDate: Wed May 27 12:20:41 2020 -0400
MockRestClient improvements.
---
.../juneau/rest/mock2/MockServletResponse.java | 2 +-
.../org/apache/juneau/rest/StatusCodesTest.java | 28 +-
.../rest/annotation2/BodyAnnotationTest.java | 54 +--
.../rest/annotation2/FormDataAnnotationTest.java | 16 +-
.../rest/annotation2/HeaderAnnotationTest.java | 16 +-
.../rest/annotation2/PathAnnotationTest.java | 194 ++++-----
.../annotation2/PathRemainderAnnotationTest.java | 8 +-
.../rest/annotation2/QueryAnnotationTest.java | 16 +-
.../rest/annotation2/ResponseAnnotationTest.java | 54 +--
.../rest/annotation2/RestResourceParsersTest.java | 6 +-
.../juneau/rest/annotation2/RoleGuardTest.java | 474 ++++++++++-----------
.../apache/juneau/rest/exceptions/BasicTest.java | 270 ++++++------
.../juneau/rest/headers/AcceptCharsetTest.java | 2 +-
.../juneau/rest/headers/AcceptEncodingTest.java | 20 +-
.../org/apache/juneau/rest/headers/AcceptTest.java | 12 +-
.../juneau/rest/headers/ContentEncodingTest.java | 2 +-
.../juneau/rest/headers/ContentTypeTest.java | 14 +-
.../apache/juneau/rest/responses/BasicTest.java | 98 ++---
18 files changed, 643 insertions(+), 643 deletions(-)
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 ad53494..c650556 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
@@ -384,7 +384,7 @@ public class MockServletResponse implements HttpServletResponse, MockHttpRespons
*
* @return A new fluent-style assertion object.
*/
- public FluentIntegerAssertion<MockServletResponse> assertStatus() {
+ public FluentIntegerAssertion<MockServletResponse> assertStatusCode() {
return new FluentIntegerAssertion<>(getStatus(), this);
}
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 9d779ce..9816d52 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
@@ -45,7 +45,7 @@ public class StatusCodesTest {
public void a01a_OK() throws Exception {
a.put("/a01", "foo")
.run()
- .assertStatus().is(200);
+ .assertStatusCode().is(200);
}
//=================================================================================================================
@@ -113,7 +113,7 @@ public class StatusCodesTest {
b.put("/nonExistentBeanProperties?noTrace=true", "{f2:'foo'}")
.json()
.run()
- .assertStatus().is(400)
+ .assertStatusCode().is(400)
.assertBody().contains(
"Unknown property 'f2' encountered while trying to parse into class 'org.apache.juneau.rest.StatusCodesTest$B$B01'"
);
@@ -123,7 +123,7 @@ public class StatusCodesTest {
b.put("/nonExistentBeanProperties?noTrace=true", "{f1:'foo', f2:'foo'}")
.json()
.run()
- .assertStatus().is(400)
+ .assertStatusCode().is(400)
.assertBody().contains(
"Unknown property 'f2' encountered while trying to parse into class 'org.apache.juneau.rest.StatusCodesTest$B$B01'"
);
@@ -133,7 +133,7 @@ public class StatusCodesTest {
b.put("/wrongDataType?noTrace=true", "{f1:'foo'}")
.json()
.run()
- .assertStatus().is(400)
+ .assertStatusCode().is(400)
.assertBody().contains(
"Invalid number"
);
@@ -143,7 +143,7 @@ public class StatusCodesTest {
b.put("/parseIntoNonConstructableBean?noTrace=true", "{f1:1}")
.json()
.run()
- .assertStatus().is(400)
+ .assertStatusCode().is(400)
.assertBody().contains(
"could not be instantiated"
);
@@ -153,7 +153,7 @@ public class StatusCodesTest {
b.put("/parseIntoNonStaticInnerClass?noTrace=true", "{f1:1}")
.json()
.run()
- .assertStatus().is(400)
+ .assertStatusCode().is(400)
.assertBody().contains(
"could not be instantiated"
);
@@ -163,7 +163,7 @@ public class StatusCodesTest {
b.put("/parseIntoNonPublicInnerClass?noTrace=true", "{f1:1}")
.json()
.run()
- .assertStatus().is(400)
+ .assertStatusCode().is(400)
.assertBody().contains(
"Class is not public"
);
@@ -173,7 +173,7 @@ public class StatusCodesTest {
b.put("/thrownConstructorException?noTrace=true", "'foo'")
.json()
.run()
- .assertStatus().is(400)
+ .assertStatusCode().is(400)
.assertBody().contains(
"Test error"
);
@@ -183,7 +183,7 @@ public class StatusCodesTest {
b.put("/setParameterToInvalidTypes/123?noTrace=true&p1=foo", "'foo'")
.json()
.run()
- .assertStatus().is(400)
+ .assertStatusCode().is(400)
.assertBody().contains(
"Could not parse query parameter 'p1'."
);
@@ -193,7 +193,7 @@ public class StatusCodesTest {
b.put("/setParameterToInvalidTypes/foo?noTrace=true&p1=1", "'foo'")
.json()
.run()
- .assertStatus().is(400)
+ .assertStatusCode().is(400)
.assertBody().contains(
"Could not parse path parameter 'a1'."
);
@@ -204,7 +204,7 @@ public class StatusCodesTest {
.header("h1", "foo")
.json()
.run()
- .assertStatus().is(400)
+ .assertStatusCode().is(400)
.assertBody().contains(
"Could not parse header 'h1'."
);
@@ -227,7 +227,7 @@ public class StatusCodesTest {
public void c01_badPath() throws Exception {
c.get("/bad?noTrace=true")
.run()
- .assertStatus().is(404)
+ .assertStatusCode().is(404)
.assertBody().contains(
"Method 'GET' not found on resource with matching pattern on path '/bad'"
);
@@ -235,7 +235,7 @@ public class StatusCodesTest {
public void c02_badMethod() throws Exception {
c.put("?noTrace=true", null)
.run()
- .assertStatus().is(405)
+ .assertStatusCode().is(405)
.assertBody().contains(
"Method 'PUT' not found on resource."
);
@@ -264,7 +264,7 @@ public class StatusCodesTest {
public void d01() throws Exception {
d.get("/d?noTrace=true")
.run()
- .assertStatus().is(412)
+ .assertStatusCode().is(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/annotation2/BodyAnnotationTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/BodyAnnotationTest.java
index 02d2427..bb359cf 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
@@ -237,7 +237,7 @@ public class BodyAnnotationTest {
public void a08b_onParameter_Map_noContentType() throws Exception {
a.put("/Map", "(foo=123)")
.run()
- .assertStatus().is(415);
+ .assertStatusCode().is(415);
}
@Test
public void a09a_onParameter_enum() throws Exception {
@@ -261,7 +261,7 @@ public class BodyAnnotationTest {
public void a11b_onParameter_Bean_noContentType() throws Exception {
a.put("/Bean", "(f1=a)")
.run()
- .assertStatus().is(415);
+ .assertStatusCode().is(415);
}
@Test
public void a12a_onParameter_InputStream() throws Exception {
@@ -407,7 +407,7 @@ public class BodyAnnotationTest {
public void b02b_onPojo_Bean_noContentType() throws Exception {
b.put("/Bean", "(f1=a)")
.run()
- .assertStatus().is(415);
+ .assertStatusCode().is(415);
}
@Test
public void b03a_onPojo_BeanList() throws Exception {
@@ -419,7 +419,7 @@ public class BodyAnnotationTest {
public void b03b_onPojo_BeanList_noContentType() throws Exception {
b.put("/BeanList", "(f1=a)")
.run()
- .assertStatus().is(415);
+ .assertStatusCode().is(415);
}
@Test
public void b04a_onPojo_InputStreamTransform() throws Exception {
@@ -479,7 +479,7 @@ public class BodyAnnotationTest {
.assertBody().is("null");
a.put("/Integer?body=bad&noTrace=true", null)
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void c03_bodyParam_int() throws Exception {
@@ -497,7 +497,7 @@ public class BodyAnnotationTest {
.assertBody().is("0");
a.put("/int?body=bad&noTrace=true", null)
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void c04_bodyParam_Boolean() throws Exception {
@@ -515,7 +515,7 @@ public class BodyAnnotationTest {
.assertBody().is("null");
a.put("/Boolean?body=bad&noTrace=true", null)
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void c05_bodyParam_boolean() throws Exception {
@@ -533,7 +533,7 @@ public class BodyAnnotationTest {
.assertBody().is("false");
a.put("/boolean?body=bad&noTrace=true", null)
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void c06_bodyParam_Float() throws Exception {
@@ -551,7 +551,7 @@ public class BodyAnnotationTest {
.assertBody().is("null");
a.put("/Float?body=bad&noTrace=true", null)
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void c07_bodyParam_float() throws Exception {
@@ -569,7 +569,7 @@ public class BodyAnnotationTest {
.assertBody().is("0.0");
a.put("/float?body=bad&noTrace=true", null)
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void c08_bodyParam_Map() throws Exception {
@@ -587,7 +587,7 @@ public class BodyAnnotationTest {
.assertBody().is("null");
a.put("/Map?body=bad&noTrace=true", null)
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void c09_bodyParam_enum() throws Exception {
@@ -605,7 +605,7 @@ public class BodyAnnotationTest {
.assertBody().is("null");
a.put("/enum?body=bad&noTrace=true", null)
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void c11_bodyParam_Bean() throws Exception {
@@ -623,7 +623,7 @@ public class BodyAnnotationTest {
.assertBody().is("null");
a.put("/Bean?body=bad&noTrace=true", null)
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void c12_bodyParam_InputStream() throws Exception {
@@ -777,7 +777,7 @@ public class BodyAnnotationTest {
public void d04b_noMediaTypes_StringTransform_withContentType() throws Exception {
d.put("/StringTransform?noTrace=true", "a").json()
.run()
- .assertStatus().is(415);
+ .assertStatusCode().is(415);
}
@Test
public void d05a_noMediaTypes_InputStreamTransform() throws Exception {
@@ -813,7 +813,7 @@ public class BodyAnnotationTest {
public void d07b_noMediaTypes_StringTransformBodyOnPojo_withContentType() throws Exception {
d.put("/StringTransformBodyOnPojo?noTrace=true", "a").json()
.run()
- .assertStatus().is(415);
+ .assertStatusCode().is(415);
}
@Test
public void d08a_noMediaTypes_InputStreamTransformBodyOnPojo() throws Exception {
@@ -1118,11 +1118,11 @@ public class BodyAnnotationTest {
public void i01() throws Exception {
i.post("/", "").json()
.run()
- .assertStatus().is(400)
+ .assertStatusCode().is(400)
.assertBody().contains("Required value not provided.");
i.post("/", "{}").json()
.run()
- .assertStatus().is(200);
+ .assertStatusCode().is(200);
}
@Rest(serializers=JsonSerializer.class,parsers=JsonParser.class)
@@ -1140,11 +1140,11 @@ public class BodyAnnotationTest {
public void i02() throws Exception {
i2.post("/", "").json()
.run()
- .assertStatus().is(400)
+ .assertStatusCode().is(400)
.assertBody().contains("Required value not provided.");
i2.post("/", "{}").json()
.run()
- .assertStatus().is(200);
+ .assertStatusCode().is(200);
}
//=================================================================================================================
@@ -1179,11 +1179,11 @@ public class BodyAnnotationTest {
public void j01_optionalParam_integer() throws Exception {
j.post("/a", "123")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("123");
j.post("/a", "null")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("null");
}
@@ -1191,11 +1191,11 @@ public class BodyAnnotationTest {
public void j02_optionalParam_bean() throws Exception {
j.post("/b", new ABean().init())
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("{a:1,b:'foo'}");
j.post("/b", "null")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("null");
}
@@ -1204,11 +1204,11 @@ public class BodyAnnotationTest {
String body = SimpleJson.DEFAULT.toString(AList.of(new ABean().init()));
j.post("/c", body)
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("[{a:1,b:'foo'}]");
j.post("/c", "null")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("null");
}
@@ -1217,11 +1217,11 @@ public class BodyAnnotationTest {
String body = SimpleJson.DEFAULT.toString(AList.of(Optional.of(new ABean().init())));
j.post("/d", body)
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("[{a:1,b:'foo'}]");
j.post("/d", "null")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(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 c6c37c2..12999e8 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
@@ -186,11 +186,11 @@ public class FormDataAnnotationTest {
public void d01_optionalParam_integer() throws Exception {
d.post("/a", "f1=123")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("123");
d.post("/a", "null")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("null");
}
@@ -198,11 +198,11 @@ public class FormDataAnnotationTest {
public void d02_optionalParam_bean() throws Exception {
d.post("/b", "f1=a=1,b=foo")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("{a:1,b:'foo'}");
d.post("/b", "null")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("null");
}
@@ -210,11 +210,11 @@ public class FormDataAnnotationTest {
public void d03_optionalParam_listOfBeans() throws Exception {
d.post("/c", "f1=@((a=1,b=foo))")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("[{a:1,b:'foo'}]");
d.post("/c", "null")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("null");
}
@@ -222,11 +222,11 @@ public class FormDataAnnotationTest {
public void d04_optionalParam_listOfOptionals() throws Exception {
d.post("/d", "f1=@((a=1,b=foo))")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("[{a:1,b:'foo'}]");
d.post("/d", "null")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("null");
}
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 1cbba10..1042552 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
@@ -62,11 +62,11 @@ public class HeaderAnnotationTest {
public void a01_optionalParam_integer() throws Exception {
a.get("/a").header("f1", 123)
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("123");
a.get("/a")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("null");
}
@@ -75,11 +75,11 @@ public class HeaderAnnotationTest {
a.get("/b")
.header("f1", "a=1,b=foo")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("{a:1,b:'foo'}");
a.get("/b")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("null");
}
@@ -88,11 +88,11 @@ public class HeaderAnnotationTest {
a.get("/c")
.header("f1", "@((a=1,b=foo))")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("[{a:1,b:'foo'}]");
a.get("/c")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("null");
}
@@ -101,11 +101,11 @@ public class HeaderAnnotationTest {
a.get("/d")
.header("f1", "@((a=1,b=foo))")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("[{a:1,b:'foo'}]");
a.get("/d")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(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 e96fce6..17775a2 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
@@ -66,7 +66,7 @@ public class PathAnnotationTest {
public void a00_nonExistentPath() throws Exception {
a.get("/bad?noTrace=true")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
}
@Test
public void a01_noPath() throws Exception {
@@ -163,7 +163,7 @@ public class PathAnnotationTest {
.assertBody().is("123");
b.get("/int/bad/foo?noTrace=true")
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void b02_short() throws Exception {
@@ -172,7 +172,7 @@ public class PathAnnotationTest {
.assertBody().is("123");
b.get("/short/bad/foo?noTrace=true")
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void b03_long() throws Exception {
@@ -181,7 +181,7 @@ public class PathAnnotationTest {
.assertBody().is("123");
b.get("/long/bad/foo?noTrace=true")
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void b04_char() throws Exception {
@@ -190,7 +190,7 @@ public class PathAnnotationTest {
.assertBody().is("c");
b.get("/char/bad/foo?noTrace=true")
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void b05_float() throws Exception {
@@ -199,7 +199,7 @@ public class PathAnnotationTest {
.assertBody().is("1.23");
b.get("/float/bad/foo?noTrace=true")
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void b06_double() throws Exception {
@@ -208,7 +208,7 @@ public class PathAnnotationTest {
.assertBody().is("1.23");
b.get("/double/bad/foo?noTrace=true")
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void b07_byte() throws Exception {
@@ -217,7 +217,7 @@ public class PathAnnotationTest {
.assertBody().is("123");
b.get("/byte/bad/foo?noTrace=true")
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void b08_boolean() throws Exception {
@@ -226,7 +226,7 @@ public class PathAnnotationTest {
.assertBody().is("true");
b.get("/boolean/bad/foo?noTrace=true")
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
//=================================================================================================================
@@ -277,7 +277,7 @@ public class PathAnnotationTest {
.assertBody().is("123");
c.get("/Integer/bad/foo?noTrace=true")
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void c02_Short() throws Exception {
@@ -286,7 +286,7 @@ public class PathAnnotationTest {
.assertBody().is("123");
c.get("/Short/bad/foo?noTrace=true")
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void c03_Long() throws Exception {
@@ -295,7 +295,7 @@ public class PathAnnotationTest {
.assertBody().is("123");
c.get("/Long/bad/foo?noTrace=true")
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void c04_Char() throws Exception {
@@ -304,7 +304,7 @@ public class PathAnnotationTest {
.assertBody().is("c");
c.get("/Character/bad/foo?noTrace=true")
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void c05_Float() throws Exception {
@@ -313,7 +313,7 @@ public class PathAnnotationTest {
.assertBody().is("1.23");
c.get("/Float/bad/foo?noTrace=true")
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void c06_Double() throws Exception {
@@ -322,7 +322,7 @@ public class PathAnnotationTest {
.assertBody().is("1.23");
c.get("/Double/bad/foo?noTrace=true")
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void c07_Byte() throws Exception {
@@ -331,7 +331,7 @@ public class PathAnnotationTest {
.assertBody().is("123");
c.get("/Byte/bad/foo?noTrace=true")
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
@Test
public void c08_Boolean() throws Exception {
@@ -340,7 +340,7 @@ public class PathAnnotationTest {
.assertBody().is("true");
c.get("/Boolean/bad/foo?noTrace=true")
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
//=================================================================================================================
@@ -472,23 +472,23 @@ public class PathAnnotationTest {
public void f01b_incompletePath() throws Exception {
f.get("/f/x1")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
f.get("/f")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
}
@Test
public void f01c_noPath_blanks() throws Exception {
f.get("/f//")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
f.get("/f/x/")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
f.get("/f//x")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
}
@Test
@@ -502,13 +502,13 @@ public class PathAnnotationTest {
public void f02b_noPath2_blanks() throws Exception {
f.get("/f///foo")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
f.get("/f/x1//foo")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
f.get("/f//x2/foo")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
}
@Test
@@ -522,13 +522,13 @@ public class PathAnnotationTest {
public void f03b_noVars_blanks() throws Exception {
f.get("/f///a")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
f.get("/f/x1//a")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
f.get("/f//x2/a")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
}
@Test
@@ -542,19 +542,19 @@ public class PathAnnotationTest {
public void f04b_twoVars_blanks() throws Exception {
f.get("/f//x2/b/x3/x4")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
f.get("/f/x1//b/x3/x4")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
f.get("/f/x1/x2/b//x4")
.run()
- .assertStatus().is(200);
+ .assertStatusCode().is(200);
f.get("/f/x1/x2/b/x3/")
.run()
- .assertStatus().is(200);
+ .assertStatusCode().is(200);
f.get("/f///b//")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
}
@Test
@@ -605,23 +605,23 @@ public class PathAnnotationTest {
public void g01b_incompletePath() throws Exception {
g.get("/f/x1")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
g.get("/f")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
}
@Test
public void g01c_noPath_blanks() throws Exception {
g.get("/f//")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
g.get("/f/x1/")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
g.get("/f//x2")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
}
@Test
@@ -635,13 +635,13 @@ public class PathAnnotationTest {
public void g02b_noVars_blanks() throws Exception {
g.get("/f///a")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
g.get("/f/x1//a")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
g.get("/f//x2/a")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
}
@Test
@@ -655,19 +655,19 @@ public class PathAnnotationTest {
public void g03b_twoVars_blanks() throws Exception {
g.get("/f//x2/b/x3/x4")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
g.get("/f/x1//b/x3/x4")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
g.get("/f/x1/x2/b//x4")
.run()
- .assertStatus().is(200);
+ .assertStatusCode().is(200);
g.get("/f/x1/x2/b/x3/")
.run()
- .assertStatus().is(200);
+ .assertStatusCode().is(200);
g.get("/f///b//")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
}
@Test
@@ -719,38 +719,38 @@ public class PathAnnotationTest {
// 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")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
h.get("/h/ha1/hb1/f")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
h.get("/h/ha1/hb1")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
h.get("/h/ha1")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
h.get("/h")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
}
@Test
public void h01c_noPath_blanks() throws Exception {
h.get("/h//hb1/f/x1/x2")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
h.get("/h/ha1//f/x1/x2")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
h.get("/h/ha1/hb1/f//x2")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
h.get("/h/ha1/hb1/f/x1/")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
h.get("/h///f//")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
}
@Test
@@ -764,19 +764,19 @@ public class PathAnnotationTest {
public void h02b_noPath2_blanks() throws Exception {
h.get("/h//hb1/f/x1/x2/foo")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
h.get("/h/ha1//f/x1/x2/foo")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
h.get("/h/ha1/hb1/f//x2/foo")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
h.get("/h/ha1/hb1/f/x1//foo")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
h.get("/h///f///foo")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
}
@Test
@@ -790,19 +790,19 @@ public class PathAnnotationTest {
public void h03b_noVars_blanks() throws Exception {
h.get("/h//hb1/f/x1/x2/a")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
h.get("/h/ha1//f/x1/x2/a")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
h.get("/h/ha1/hb1/f//x2/a")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
h.get("/h/ha1/hb1/f/x1//a")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
h.get("/h///f///a")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
}
@Test
@@ -860,53 +860,53 @@ public class PathAnnotationTest {
public void i01b_incompletePath() throws Exception {
i.get("/i/ia1/ib1/h/ha1/hb1/f/x1")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
i.get("/i/ia1/ib1/h/ha1/hb1/f")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
i.get("/i/ia1/ib1/h/ha1/hb1")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
i.get("/i/ia1/ib1/h/ha1")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
i.get("/i/ia1/ib1/h")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
i.get("/i/ia1/ib1")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
i.get("/i/ia1")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
i.get("/i")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
}
@Test
public void i01c_noPath_blanks() throws Exception {
i.get("/i//ib1/h/ha1/hb1/f/x1/x2")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
i.get("/i/ia1//h/ha1/hb1/f/x1/x2")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
i.get("/i/ia1/ib1/h//hb1/f/x1/x2")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
i.get("/i/ia1/ib1/h/ha1//f/x1/x2")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
i.get("/i/ia1/ib1/h/ha1/hb1/f//x2")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
i.get("/i/ia1/ib1/h/ha1/hb1/f/x1/")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
i.get("/i///h///f//")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
}
@Test
@@ -990,7 +990,7 @@ public class PathAnnotationTest {
public void j01_optionalParam_integer() throws Exception {
j.get("/a/123")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("123");
}
@@ -998,7 +998,7 @@ public class PathAnnotationTest {
public void j02_optionalParam_bean() throws Exception {
j.get("/b/a=1,b=foo")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("{a:1,b:'foo'}");
}
@@ -1006,7 +1006,7 @@ public class PathAnnotationTest {
public void j03_optionalParam_listOfBeans() throws Exception {
j.get("/c/@((a=1,b=foo))")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("[{a:1,b:'foo'}]");
}
@@ -1014,7 +1014,7 @@ public class PathAnnotationTest {
public void j04_optionalParam_listOfOptionals() throws Exception {
j.get("/d/@((a=1,b=foo))")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("[{a:1,b:'foo'}]");
}
@@ -1423,19 +1423,19 @@ public class PathAnnotationTest {
public void u01_nonRequiredPath() throws Exception {
u1.get("/u1/foo/u2")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("foo");
u1.get("/u1/foo/u2/foo/xxx")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("foo,xxx");
u2.get("/")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("nil");
u2.get("/foo/xxx")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("nil,xxx");
}
@@ -1465,35 +1465,35 @@ public class PathAnnotationTest {
public void v01_multiplePaths() throws Exception {
v1.get("/v1/v1foo/v2")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("1,v1foo,nil");
v1.get("/v1/v1foo/v2/v2foo")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("1,v1foo,v2foo");
v1.get("/v1/v1foo/v2/foo")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("2,v1foo,nil");
v1.get("/v1/v1foo/v2/foo/v2foo")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("2,v1foo,v2foo");
v2.get("/v2")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("1,nil,nil");
v2.get("/v2/v2foo")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("1,nil,v2foo");
v2.get("/v2/foo")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("2,nil,nil");
v2.get("/v2/foo/v2foo")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(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 5d24ff8..5badf15 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
@@ -86,7 +86,7 @@ public class PathRemainderAnnotationTest {
public void b01_optionalParam_integer() throws Exception {
b.get("/a/123")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("123");
}
@@ -94,7 +94,7 @@ public class PathRemainderAnnotationTest {
public void b02_optionalParam_bean() throws Exception {
b.get("/b/a=1,b=foo")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("{a:1,b:'foo'}");
}
@@ -102,7 +102,7 @@ public class PathRemainderAnnotationTest {
public void b03_optionalParam_listOfBeans() throws Exception {
b.get("/c/@((a=1,b=foo))")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("[{a:1,b:'foo'}]");
}
@@ -110,7 +110,7 @@ public class PathRemainderAnnotationTest {
public void b04_optionalParam_listOfOptionals() throws Exception {
b.get("/d/@((a=1,b=foo))")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(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 a4d63bc..c34bb47 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
@@ -296,11 +296,11 @@ public class QueryAnnotationTest {
public void e01_optionalParam_integer() throws Exception {
e.get("/a?f1=123")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("123");
e.get("/a")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("null");
}
@@ -308,11 +308,11 @@ public class QueryAnnotationTest {
public void e02_optionalParam_bean() throws Exception {
e.get("/b?f1=a=1,b=foo")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("{a:1,b:'foo'}");
e.get("/b")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("null");
}
@@ -320,11 +320,11 @@ public class QueryAnnotationTest {
public void e03_optionalParam_listOfBeans() throws Exception {
e.get("/c?f1=@((a=1,b=foo))")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("[{a:1,b:'foo'}]");
e.get("/c")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("null");
}
@@ -332,11 +332,11 @@ public class QueryAnnotationTest {
public void e04_optionalParam_listOfOptionals() throws Exception {
e.get("/d?f1=@((a=1,b=foo))")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("[{a:1,b:'foo'}]");
e.get("/d")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(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 5ce7271..9e58aa8 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
@@ -73,14 +73,14 @@ public class ResponseAnnotationTest {
public void a01_codeOnClass() throws Exception {
a.get("/a01")
.run()
- .assertStatus().is(201)
+ .assertStatusCode().is(201)
.assertBody().is("foo");
}
@Test
public void a02_codeOnThrown() throws Exception {
a.get("/a02")
.run()
- .assertStatus().is(501);
+ .assertStatusCode().is(501);
}
//=================================================================================================================
@@ -131,28 +131,28 @@ public class ResponseAnnotationTest {
public void b01_useOnMethod() throws Exception {
b.get("/b01")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("foo");
}
@Test
public void b03_useOnClass() throws Exception {
b.get("/b03")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("foo");
}
@Test
public void b05_useOnThrown() throws Exception {
b.get("/b05")
.run()
- .assertStatus().is(500)
+ .assertStatusCode().is(500)
.assertBody().is("foo");
}
@Test
public void b07_useOnParameter() throws Exception {
b.get("/b07")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("foo");
}
@@ -234,56 +234,56 @@ public class ResponseAnnotationTest {
public void d01_useOnMethod() throws Exception {
d.get("/d01")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("foo|bar");
}
@Test
public void d02_useOnClass() throws Exception {
d.get("/d02")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("foo|bar");
}
@Test
public void d03_useOnThrown() throws Exception {
d.get("/d03")
.run()
- .assertStatus().is(500)
+ .assertStatusCode().is(500)
.assertBody().is("foo|bar");
}
@Test
public void d04_useOnParameter() throws Exception {
d.get("/d04")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("foo|bar");
}
@Test
public void d05_useOnMethodBytes() throws Exception {
d.get("/d05")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("Zm9v");
}
@Test
public void d06_useOnClassBytes() throws Exception {
d.get("/d06")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("Zm9v");
}
@Test
public void d07_useOnThrownBytes() throws Exception {
d.get("/d07")
.run()
- .assertStatus().is(500)
+ .assertStatusCode().is(500)
.assertBody().is("Zm9v");
}
@Test
public void d08_useOnParameterBytes() throws Exception {
d.get("/d08")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("Zm9v");
}
@@ -329,28 +329,28 @@ public class ResponseAnnotationTest {
public void e01_basic_onParameter() throws Exception {
e.get("/e01")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("foo");
}
@Test
public void e02_basic_onType() throws Exception {
e.get("/e02")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("foo");
}
@Test
public void e03_basic_onMethod() throws Exception {
e.get("/e03")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("foo");
}
@Test
public void e04_basic_onReturnedType() throws Exception {
e.get("/e04")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("foo");
}
@@ -394,7 +394,7 @@ public class ResponseAnnotationTest {
public void f01a_basic_onParameter() throws Exception {
f.get("/f01")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("1|2");
}
@Test
@@ -406,7 +406,7 @@ public class ResponseAnnotationTest {
public void f02a_basic_onType() throws Exception {
f.get("/f02")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("1|2");
}
@Test
@@ -418,7 +418,7 @@ public class ResponseAnnotationTest {
public void f03a_basic_onMethod() throws Exception {
f.get("/f03")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("1|2");
}
@Test
@@ -430,7 +430,7 @@ public class ResponseAnnotationTest {
public void f04a_basic_onReturnedType() throws Exception {
f.get("/f04")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("1|2");
}
@Test
@@ -479,7 +479,7 @@ public class ResponseAnnotationTest {
public void g01a_basic_onParameter() throws Exception {
g.get("/g01").json()
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("[1,2]");
}
@Test
@@ -491,7 +491,7 @@ public class ResponseAnnotationTest {
public void g02a_basic_onType() throws Exception {
g.get("/g02").json()
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("[1,2]");
}
@Test
@@ -503,7 +503,7 @@ public class ResponseAnnotationTest {
public void g03a_basic_onMethod() throws Exception {
g.get("/g03").json()
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("[1,2]");
}
@Test
@@ -515,7 +515,7 @@ public class ResponseAnnotationTest {
public void g04a_basic_onReturnedType() throws Exception {
g.get("/g04").json()
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("[1,2]");
}
@Test
@@ -547,7 +547,7 @@ public class ResponseAnnotationTest {
public void j01a_basic() throws Exception {
j.post("/j01", "foo").accept("text/plain")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(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/RestResourceParsersTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RestResourceParsersTest.java
index 8c936e2..efa4cf4 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
@@ -135,7 +135,7 @@ public class RestResourceParsersTest {
a.put("/parserOnClass?noTrace=true", "test1")
.contentType("text/b")
.run()
- .assertStatus().is(415)
+ .assertStatusCode().is(415)
.assertBody().contains(
"Unsupported media-type in request header 'Content-Type': 'text/b'",
"Supported media-types: ['text/a"
@@ -150,7 +150,7 @@ public class RestResourceParsersTest {
a.put("/parserOnMethod?noTrace=true", "test2")
.contentType("text/a")
.run()
- .assertStatus().is(415)
+ .assertStatusCode().is(415)
.assertBody().contains(
"Unsupported media-type in request header 'Content-Type': 'text/a'",
"Supported media-types: ['text/b']"
@@ -183,7 +183,7 @@ public class RestResourceParsersTest {
a.put("/validErrorResponse?noTrace=true", "test1")
.contentType("text/bad")
.run()
- .assertStatus().is(415)
+ .assertStatusCode().is(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/RoleGuardTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/annotation2/RoleGuardTest.java
index d388fd4..04ac98a 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").run().assertStatus().is(200);
- a1.get().roles("foo","bar").run().assertStatus().is(200);
- a1.get().roles("bar","foo").run().assertStatus().is(200);
+ a1.get().roles("foo").run().assertStatusCode().is(200);
+ a1.get().roles("foo","bar").run().assertStatusCode().is(200);
+ a1.get().roles("bar","foo").run().assertStatusCode().is(200);
}
@Test
public void a01b_onClass_simple_fail() throws Exception {
- a1.get().run().assertStatus().is(403);
- a1.get().roles("foo2").run().assertStatus().is(403);
- a1.get().roles("foo2","bar").run().assertStatus().is(403);
+ a1.get().run().assertStatusCode().is(403);
+ a1.get().roles("foo2").run().assertStatusCode().is(403);
+ a1.get().roles("foo2","bar").run().assertStatusCode().is(403);
}
//-----------------------------------------------------------------------------------------------------------------
@@ -63,16 +63,16 @@ public class RoleGuardTest {
@Test
public void a02a_onMethod_simple_pass() throws Exception {
- a2.get().roles("foo").run().assertStatus().is(200);
- a2.get().roles("foo","bar").run().assertStatus().is(200);
- a2.get().roles("bar","foo").run().assertStatus().is(200);
+ a2.get().roles("foo").run().assertStatusCode().is(200);
+ a2.get().roles("foo","bar").run().assertStatusCode().is(200);
+ a2.get().roles("bar","foo").run().assertStatusCode().is(200);
}
@Test
public void a02b_onMethod_simple_fail() throws Exception {
- a2.get().run().assertStatus().is(403);
- a2.get().roles("foo2").run().assertStatus().is(403);
- a2.get().roles("foo2","bar").run().assertStatus().is(403);
+ a2.get().run().assertStatusCode().is(403);
+ a2.get().roles("foo2").run().assertStatusCode().is(403);
+ a2.get().roles("foo2","bar").run().assertStatusCode().is(403);
}
//-----------------------------------------------------------------------------------------------------------------
@@ -90,18 +90,18 @@ public class RoleGuardTest {
@Test
public void a03a_onBoth_simple_pass() throws Exception {
- a3.get().roles("foo","bar").run().assertStatus().is(200);
- a3.get().roles("bar","foo").run().assertStatus().is(200);
- a3.get().roles("bar","foo","baz").run().assertStatus().is(200);
+ a3.get().roles("foo","bar").run().assertStatusCode().is(200);
+ a3.get().roles("bar","foo").run().assertStatusCode().is(200);
+ a3.get().roles("bar","foo","baz").run().assertStatusCode().is(200);
}
@Test
public void a03b_onBoth_simple_fail() throws Exception {
- a3.get().run().assertStatus().is(403);
- a3.get().roles("foo").run().assertStatus().is(403);
- a3.get().roles("bar").run().assertStatus().is(403);
- a3.get().roles("foo2").run().assertStatus().is(403);
- a3.get().roles("foo2","bar").run().assertStatus().is(403);
+ a3.get().run().assertStatusCode().is(403);
+ a3.get().roles("foo").run().assertStatusCode().is(403);
+ a3.get().roles("bar").run().assertStatusCode().is(403);
+ a3.get().roles("foo2").run().assertStatusCode().is(403);
+ a3.get().roles("foo2","bar").run().assertStatusCode().is(403);
}
//-----------------------------------------------------------------------------------------------------------------
@@ -129,21 +129,21 @@ public class RoleGuardTest {
@Test
public void a04a_inheritence_simple_pass() throws Exception {
- a4.get().roles("foo","bar","baz","qux").run().assertStatus().is(200);
- a4.get().roles("foo","bar","baz","qux","quux").run().assertStatus().is(200);
+ a4.get().roles("foo","bar","baz","qux").run().assertStatusCode().is(200);
+ a4.get().roles("foo","bar","baz","qux","quux").run().assertStatusCode().is(200);
}
@Test
public void a04b_inheritence_simple_fail() throws Exception {
- a3.get().run().assertStatus().is(403);
- a3.get().roles("foo").run().assertStatus().is(403);
- a3.get().roles("bar").run().assertStatus().is(403);
- a3.get().roles("baz").run().assertStatus().is(403);
- a3.get().roles("qux").run().assertStatus().is(403);
- a4.get().roles("foo","bar","baz").run().assertStatus().is(403);
- a4.get().roles("foo","bar","qux").run().assertStatus().is(403);
- a4.get().roles("foo","baz","qux").run().assertStatus().is(403);
- a4.get().roles("bar","baz","qux").run().assertStatus().is(403);
+ a3.get().run().assertStatusCode().is(403);
+ a3.get().roles("foo").run().assertStatusCode().is(403);
+ a3.get().roles("bar").run().assertStatusCode().is(403);
+ a3.get().roles("baz").run().assertStatusCode().is(403);
+ a3.get().roles("qux").run().assertStatusCode().is(403);
+ a4.get().roles("foo","bar","baz").run().assertStatusCode().is(403);
+ a4.get().roles("foo","bar","qux").run().assertStatusCode().is(403);
+ a4.get().roles("foo","baz","qux").run().assertStatusCode().is(403);
+ a4.get().roles("bar","baz","qux").run().assertStatusCode().is(403);
}
//-----------------------------------------------------------------------------------------------------------------
@@ -194,130 +194,130 @@ public class RoleGuardTest {
@Test
public void b01a_orsWithComma_pass() throws Exception {
// @Rest(roleGuard="foo,bar")
- b1a.get().roles("foo").run().assertStatus().is(200);
- b1a.get().roles("bar").run().assertStatus().is(200);
- b1a.get().roles("foo","bar").run().assertStatus().is(200);
- b1a.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ b1a.get().roles("foo").run().assertStatusCode().is(200);
+ b1a.get().roles("bar").run().assertStatusCode().is(200);
+ b1a.get().roles("foo","bar").run().assertStatusCode().is(200);
+ b1a.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void b01b_orsWithComma_fail() throws Exception {
// @Rest(roleGuard="foo,bar")
- b1a.get().roles().run().assertStatus().is(403);
- b1a.get().roles("baz").run().assertStatus().is(403);
+ b1a.get().roles().run().assertStatusCode().is(403);
+ b1a.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void b01c_orsWithSinglePipe_pass() throws Exception {
// @Rest(roleGuard="foo | bar")
- b1b.get().roles("foo").run().assertStatus().is(200);
- b1b.get().roles("bar").run().assertStatus().is(200);
- b1b.get().roles("foo","bar").run().assertStatus().is(200);
- b1b.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ b1b.get().roles("foo").run().assertStatusCode().is(200);
+ b1b.get().roles("bar").run().assertStatusCode().is(200);
+ b1b.get().roles("foo","bar").run().assertStatusCode().is(200);
+ b1b.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void b01d_orsWithSinglePipe_fail() throws Exception {
// @Rest(roleGuard="foo | bar")
- b1b.get().roles().run().assertStatus().is(403);
- b1b.get().roles("baz").run().assertStatus().is(403);
+ b1b.get().roles().run().assertStatusCode().is(403);
+ b1b.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void b01e_orsWithDoublePipe_pass() throws Exception {
// @Rest(roleGuard="foo || bar")
- b1c.get().roles("foo").run().assertStatus().is(200);
- b1c.get().roles("bar").run().assertStatus().is(200);
- b1c.get().roles("foo","bar").run().assertStatus().is(200);
- b1c.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ b1c.get().roles("foo").run().assertStatusCode().is(200);
+ b1c.get().roles("bar").run().assertStatusCode().is(200);
+ b1c.get().roles("foo","bar").run().assertStatusCode().is(200);
+ b1c.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void b01f_orsWithDoublePipe_fail() throws Exception {
// @Rest(roleGuard="foo || bar")
- b1c.get().roles().run().assertStatus().is(403);
- b1c.get().roles("baz").run().assertStatus().is(403);
+ b1c.get().roles().run().assertStatusCode().is(403);
+ b1c.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void b01g_andsWithSingleAmp_pass() throws Exception {
// @Rest(roleGuard="foo & bar")
- b1d.get().roles("foo","bar").run().assertStatus().is(200);
- b1d.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ b1d.get().roles("foo","bar").run().assertStatusCode().is(200);
+ b1d.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void b01h_andsWithSingleAmp_fail() throws Exception {
// @Rest(roleGuard="foo & bar")
- b1d.get().roles().run().assertStatus().is(403);
- b1d.get().roles("foo").run().assertStatus().is(403);
- b1d.get().roles("bar").run().assertStatus().is(403);
- b1d.get().roles("baz").run().assertStatus().is(403);
+ b1d.get().roles().run().assertStatusCode().is(403);
+ b1d.get().roles("foo").run().assertStatusCode().is(403);
+ b1d.get().roles("bar").run().assertStatusCode().is(403);
+ b1d.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void b01i_andsWithDoubleAmp_pass() throws Exception {
// @Rest(roleGuard="foo && bar")
- b1e.get().roles("foo","bar").run().assertStatus().is(200);
- b1e.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ b1e.get().roles("foo","bar").run().assertStatusCode().is(200);
+ b1e.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void b01j_andsWithDoubleAmp_fail() throws Exception {
// @Rest(roleGuard="foo && bar")
- b1e.get().roles().run().assertStatus().is(403);
- b1e.get().roles("foo").run().assertStatus().is(403);
- b1e.get().roles("bar").run().assertStatus().is(403);
- b1e.get().roles("baz").run().assertStatus().is(403);
+ b1e.get().roles().run().assertStatusCode().is(403);
+ b1e.get().roles("foo").run().assertStatusCode().is(403);
+ b1e.get().roles("bar").run().assertStatusCode().is(403);
+ b1e.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void b01k_andsWithDoubleAmpAndParens_pass() throws Exception {
// @Rest(roleGuard="(foo) && (bar)")
- b1f.get().roles("foo","bar").run().assertStatus().is(200);
- b1f.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ b1f.get().roles("foo","bar").run().assertStatusCode().is(200);
+ b1f.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void b01l_andsWithDoubleAmpAndParens_fail() throws Exception {
// @Rest(roleGuard="(foo) && (bar)")
- b1f.get().roles().run().assertStatus().is(403);
- b1f.get().roles("foo").run().assertStatus().is(403);
- b1f.get().roles("bar").run().assertStatus().is(403);
- b1f.get().roles("baz").run().assertStatus().is(403);
+ b1f.get().roles().run().assertStatusCode().is(403);
+ b1f.get().roles("foo").run().assertStatusCode().is(403);
+ b1f.get().roles("bar").run().assertStatusCode().is(403);
+ b1f.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void b01m_complex_pass() throws Exception {
// @Rest(roleGuard="foo && (bar || baz)")
- b1g.get().roles("foo","bar").run().assertStatus().is(200);
- b1g.get().roles("foo","baz").run().assertStatus().is(200);
- b1g.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ b1g.get().roles("foo","bar").run().assertStatusCode().is(200);
+ b1g.get().roles("foo","baz").run().assertStatusCode().is(200);
+ b1g.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void b01n_complex_fail() throws Exception {
// @Rest(roleGuard="foo && (bar || baz)")
- b1g.get().roles().run().assertStatus().is(403);
- b1g.get().roles("foo").run().assertStatus().is(403);
- b1g.get().roles("bar","baz").run().assertStatus().is(403);
- b1g.get().roles("baz").run().assertStatus().is(403);
+ b1g.get().roles().run().assertStatusCode().is(403);
+ b1g.get().roles("foo").run().assertStatusCode().is(403);
+ b1g.get().roles("bar","baz").run().assertStatusCode().is(403);
+ b1g.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void b01o_complex_pass() throws Exception {
// @Rest(roleGuard="foo || (bar && baz)")
- b1h.get().roles("foo").run().assertStatus().is(200);
- b1h.get().roles("bar","baz").run().assertStatus().is(200);
- b1h.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ b1h.get().roles("foo").run().assertStatusCode().is(200);
+ b1h.get().roles("bar","baz").run().assertStatusCode().is(200);
+ b1h.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void b01p_complex_fail() throws Exception {
// @Rest(roleGuard="foo || (bar && baz)")
- b1h.get().roles().run().assertStatus().is(403);
- b1h.get().roles("bar").run().assertStatus().is(403);
- b1h.get().roles("baz").run().assertStatus().is(403);
+ b1h.get().roles().run().assertStatusCode().is(403);
+ b1h.get().roles("bar").run().assertStatusCode().is(403);
+ b1h.get().roles("baz").run().assertStatusCode().is(403);
}
//-----------------------------------------------------------------------------------------------------------------
@@ -400,130 +400,130 @@ public class RoleGuardTest {
@Test
public void b02a_orsWithComma_pass() throws Exception {
// @RestMethod(roleGuard="foo,bar")
- b2a.get().roles("foo").run().assertStatus().is(200);
- b2a.get().roles("bar").run().assertStatus().is(200);
- b2a.get().roles("foo","bar").run().assertStatus().is(200);
- b2a.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ b2a.get().roles("foo").run().assertStatusCode().is(200);
+ b2a.get().roles("bar").run().assertStatusCode().is(200);
+ b2a.get().roles("foo","bar").run().assertStatusCode().is(200);
+ b2a.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void b02b_orsWithComma_fail() throws Exception {
// @RestMethod(roleGuard="foo,bar")
- b2a.get().roles().run().assertStatus().is(403);
- b2a.get().roles("baz").run().assertStatus().is(403);
+ b2a.get().roles().run().assertStatusCode().is(403);
+ b2a.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void b02c_orsWithSinglePipe_pass() throws Exception {
// @RestMethod(roleGuard="foo | bar")
- b2b.get().roles("foo").run().assertStatus().is(200);
- b2b.get().roles("bar").run().assertStatus().is(200);
- b2b.get().roles("foo","bar").run().assertStatus().is(200);
- b2b.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ b2b.get().roles("foo").run().assertStatusCode().is(200);
+ b2b.get().roles("bar").run().assertStatusCode().is(200);
+ b2b.get().roles("foo","bar").run().assertStatusCode().is(200);
+ b2b.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void b02d_orsWithSinglePipe_fail() throws Exception {
// @RestMethod(roleGuard="foo | bar")
- b2b.get().roles().run().assertStatus().is(403);
- b2b.get().roles("baz").run().assertStatus().is(403);
+ b2b.get().roles().run().assertStatusCode().is(403);
+ b2b.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void b02e_orsWithDoublePipe_pass() throws Exception {
// @RestMethod(roleGuard="foo || bar")
- b2c.get().roles("foo").run().assertStatus().is(200);
- b2c.get().roles("bar").run().assertStatus().is(200);
- b2c.get().roles("foo","bar").run().assertStatus().is(200);
- b2c.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ b2c.get().roles("foo").run().assertStatusCode().is(200);
+ b2c.get().roles("bar").run().assertStatusCode().is(200);
+ b2c.get().roles("foo","bar").run().assertStatusCode().is(200);
+ b2c.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void b02f_orsWithDoublePipe_fail() throws Exception {
// @RestMethod(roleGuard="foo || bar")
- b2c.get().roles().run().assertStatus().is(403);
- b2c.get().roles("baz").run().assertStatus().is(403);
+ b2c.get().roles().run().assertStatusCode().is(403);
+ b2c.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void b02g_andsWithSingleAmp_pass() throws Exception {
// @RestMethod(roleGuard="foo & bar")
- b2d.get().roles("foo","bar").run().assertStatus().is(200);
- b2d.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ b2d.get().roles("foo","bar").run().assertStatusCode().is(200);
+ b2d.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void b02h_andsWithSingleAmp_fail() throws Exception {
// @RestMethod(roleGuard="foo & bar")
- b2d.get().roles().run().assertStatus().is(403);
- b2d.get().roles("foo").run().assertStatus().is(403);
- b2d.get().roles("bar").run().assertStatus().is(403);
- b2d.get().roles("baz").run().assertStatus().is(403);
+ b2d.get().roles().run().assertStatusCode().is(403);
+ b2d.get().roles("foo").run().assertStatusCode().is(403);
+ b2d.get().roles("bar").run().assertStatusCode().is(403);
+ b2d.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void b02i_andsWithDoubleAmp_pass() throws Exception {
// @RestMethod(roleGuard="foo && bar")
- b2e.get().roles("foo","bar").run().assertStatus().is(200);
- b2e.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ b2e.get().roles("foo","bar").run().assertStatusCode().is(200);
+ b2e.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void b02j_andsWithDoubleAmp_fail() throws Exception {
// @RestMethod(roleGuard="foo && bar")
- b2e.get().roles().run().assertStatus().is(403);
- b2e.get().roles("foo").run().assertStatus().is(403);
- b2e.get().roles("bar").run().assertStatus().is(403);
- b2e.get().roles("baz").run().assertStatus().is(403);
+ b2e.get().roles().run().assertStatusCode().is(403);
+ b2e.get().roles("foo").run().assertStatusCode().is(403);
+ b2e.get().roles("bar").run().assertStatusCode().is(403);
+ b2e.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void b02k_andsWithDoubleAmpAndParens_pass() throws Exception {
// @RestMethod(roleGuard="(foo) && (bar)")
- b2f.get().roles("foo","bar").run().assertStatus().is(200);
- b2f.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ b2f.get().roles("foo","bar").run().assertStatusCode().is(200);
+ b2f.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void b02l_andsWithDoubleAmpAndParens_fail() throws Exception {
// @RestMethod(roleGuard="(foo) && (bar)")
- b2f.get().roles().run().assertStatus().is(403);
- b2f.get().roles("foo").run().assertStatus().is(403);
- b2f.get().roles("bar").run().assertStatus().is(403);
- b2f.get().roles("baz").run().assertStatus().is(403);
+ b2f.get().roles().run().assertStatusCode().is(403);
+ b2f.get().roles("foo").run().assertStatusCode().is(403);
+ b2f.get().roles("bar").run().assertStatusCode().is(403);
+ b2f.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void b02m_complex_pass() throws Exception {
// @RestMethod(roleGuard="foo && (bar || baz)")
- b2g.get().roles("foo","bar").run().assertStatus().is(200);
- b2g.get().roles("foo","baz").run().assertStatus().is(200);
- b2g.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ b2g.get().roles("foo","bar").run().assertStatusCode().is(200);
+ b2g.get().roles("foo","baz").run().assertStatusCode().is(200);
+ b2g.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void b02n_complex_fail() throws Exception {
// @RestMethod(roleGuard="foo && (bar || baz)")
- b2g.get().roles().run().assertStatus().is(403);
- b2g.get().roles("foo").run().assertStatus().is(403);
- b2g.get().roles("bar","baz").run().assertStatus().is(403);
- b2g.get().roles("baz").run().assertStatus().is(403);
+ b2g.get().roles().run().assertStatusCode().is(403);
+ b2g.get().roles("foo").run().assertStatusCode().is(403);
+ b2g.get().roles("bar","baz").run().assertStatusCode().is(403);
+ b2g.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void b02o_complex_pass() throws Exception {
// @RestMethod(roleGuard="foo || (bar && baz)")
- b2h.get().roles("foo").run().assertStatus().is(200);
- b2h.get().roles("bar","baz").run().assertStatus().is(200);
- b2h.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ b2h.get().roles("foo").run().assertStatusCode().is(200);
+ b2h.get().roles("bar","baz").run().assertStatusCode().is(200);
+ b2h.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void b02p_complex_fail() throws Exception {
// @RestMethod(roleGuard="foo || (bar && baz)")
- b2h.get().roles().run().assertStatus().is(403);
- b2h.get().roles("bar").run().assertStatus().is(403);
- b2h.get().roles("baz").run().assertStatus().is(403);
+ b2h.get().roles().run().assertStatusCode().is(403);
+ b2h.get().roles("bar").run().assertStatusCode().is(403);
+ b2h.get().roles("baz").run().assertStatusCode().is(403);
}
//-----------------------------------------------------------------------------------------------------------------
@@ -574,130 +574,130 @@ public class RoleGuardTest {
@Test
public void c01a_orPatternsWithComma_pass() throws Exception {
// @Rest(roleGuard="fo*,*ar")
- c1a.get().roles("foo").run().assertStatus().is(200);
- c1a.get().roles("bar").run().assertStatus().is(200);
- c1a.get().roles("foo","bar").run().assertStatus().is(200);
- c1a.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ c1a.get().roles("foo").run().assertStatusCode().is(200);
+ c1a.get().roles("bar").run().assertStatusCode().is(200);
+ c1a.get().roles("foo","bar").run().assertStatusCode().is(200);
+ c1a.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void c01b_orPatternsWithComma_fail() throws Exception {
// @Rest(roleGuard="fo*,*ar")
- c1a.get().roles().run().assertStatus().is(403);
- c1a.get().roles("baz").run().assertStatus().is(403);
+ c1a.get().roles().run().assertStatusCode().is(403);
+ c1a.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void c01c_orPatternsWithSinglePipe_pass() throws Exception {
// @Rest(roleGuard="fo* | *ar")
- c1b.get().roles("foo").run().assertStatus().is(200);
- c1b.get().roles("bar").run().assertStatus().is(200);
- c1b.get().roles("foo","bar").run().assertStatus().is(200);
- c1b.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ c1b.get().roles("foo").run().assertStatusCode().is(200);
+ c1b.get().roles("bar").run().assertStatusCode().is(200);
+ c1b.get().roles("foo","bar").run().assertStatusCode().is(200);
+ c1b.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void c01d_orPatternsWithSinglePipe_fail() throws Exception {
// @Rest(roleGuard="fo* | *ar")
- c1b.get().roles().run().assertStatus().is(403);
- c1b.get().roles("baz").run().assertStatus().is(403);
+ c1b.get().roles().run().assertStatusCode().is(403);
+ c1b.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void c01e_orPatternsWithDoublePipe_pass() throws Exception {
// @Rest(roleGuard="fo* || *ar")
- c1c.get().roles("foo").run().assertStatus().is(200);
- c1c.get().roles("bar").run().assertStatus().is(200);
- c1c.get().roles("foo","bar").run().assertStatus().is(200);
- c1c.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ c1c.get().roles("foo").run().assertStatusCode().is(200);
+ c1c.get().roles("bar").run().assertStatusCode().is(200);
+ c1c.get().roles("foo","bar").run().assertStatusCode().is(200);
+ c1c.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void c01f_orPatternsWithDoublePipe_fail() throws Exception {
// @Rest(roleGuard="fo* || *ar")
- c1c.get().roles().run().assertStatus().is(403);
- c1c.get().roles("baz").run().assertStatus().is(403);
+ c1c.get().roles().run().assertStatusCode().is(403);
+ c1c.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void c01g_andPatternsWithSingleAmp_pass() throws Exception {
// @Rest(roleGuard="fo* & *ar")
- c1d.get().roles("foo","bar").run().assertStatus().is(200);
- c1d.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ c1d.get().roles("foo","bar").run().assertStatusCode().is(200);
+ c1d.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void c01h_andPatternsWithSingleAmp_fail() throws Exception {
// @Rest(roleGuard="fo* & *ar")
- c1d.get().roles().run().assertStatus().is(403);
- c1d.get().roles("foo").run().assertStatus().is(403);
- c1d.get().roles("bar").run().assertStatus().is(403);
- c1d.get().roles("baz").run().assertStatus().is(403);
+ c1d.get().roles().run().assertStatusCode().is(403);
+ c1d.get().roles("foo").run().assertStatusCode().is(403);
+ c1d.get().roles("bar").run().assertStatusCode().is(403);
+ c1d.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void c01i_andPatternsWithDoubleAmp_pass() throws Exception {
// @Rest(roleGuard="fo* && *ar")
- c1e.get().roles("foo","bar").run().assertStatus().is(200);
- c1e.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ c1e.get().roles("foo","bar").run().assertStatusCode().is(200);
+ c1e.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void c01j_andPatternsWithDoubleAmp_fail() throws Exception {
// @Rest(roleGuard="fo* && *ar")
- c1e.get().roles().run().assertStatus().is(403);
- c1e.get().roles("foo").run().assertStatus().is(403);
- c1e.get().roles("bar").run().assertStatus().is(403);
- c1e.get().roles("baz").run().assertStatus().is(403);
+ c1e.get().roles().run().assertStatusCode().is(403);
+ c1e.get().roles("foo").run().assertStatusCode().is(403);
+ c1e.get().roles("bar").run().assertStatusCode().is(403);
+ c1e.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void c01k_andPatternsWithDoubleAmpAndParens_pass() throws Exception {
// @Rest(roleGuard="(fo*) && (*ar)")
- c1f.get().roles("foo","bar").run().assertStatus().is(200);
- c1f.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ c1f.get().roles("foo","bar").run().assertStatusCode().is(200);
+ c1f.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void c01l_andPatternsWithDoubleAmpAndParens_fail() throws Exception {
// @Rest(roleGuard="(fo*) && (*ar)")
- c1f.get().roles().run().assertStatus().is(403);
- c1f.get().roles("foo").run().assertStatus().is(403);
- c1f.get().roles("bar").run().assertStatus().is(403);
- c1f.get().roles("baz").run().assertStatus().is(403);
+ c1f.get().roles().run().assertStatusCode().is(403);
+ c1f.get().roles("foo").run().assertStatusCode().is(403);
+ c1f.get().roles("bar").run().assertStatusCode().is(403);
+ c1f.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void c01m_complexPatterns_pass() throws Exception {
// @Rest(roleGuard="fo* && (*ar || *az)")
- c1g.get().roles("foo","bar").run().assertStatus().is(200);
- c1g.get().roles("foo","baz").run().assertStatus().is(200);
- c1g.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ c1g.get().roles("foo","bar").run().assertStatusCode().is(200);
+ c1g.get().roles("foo","baz").run().assertStatusCode().is(200);
+ c1g.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void c01n_complexPatterns_fail() throws Exception {
// @Rest(roleGuard="fo* && (*ar || *az)")
- c1g.get().roles().run().assertStatus().is(403);
- c1g.get().roles("foo").run().assertStatus().is(403);
- c1g.get().roles("bar","baz").run().assertStatus().is(403);
- c1g.get().roles("baz").run().assertStatus().is(403);
+ c1g.get().roles().run().assertStatusCode().is(403);
+ c1g.get().roles("foo").run().assertStatusCode().is(403);
+ c1g.get().roles("bar","baz").run().assertStatusCode().is(403);
+ c1g.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void c01o_complexPatterns_pass() throws Exception {
// @Rest(roleGuard="fo* || (*ar && *az)")
- c1h.get().roles("foo").run().assertStatus().is(200);
- c1h.get().roles("bar","baz").run().assertStatus().is(200);
- c1h.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ c1h.get().roles("foo").run().assertStatusCode().is(200);
+ c1h.get().roles("bar","baz").run().assertStatusCode().is(200);
+ c1h.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void c01p_complexPatterns_fail() throws Exception {
// @Rest(roleGuard="fo* || (*ar && *az)")
- c1h.get().roles().run().assertStatus().is(403);
- c1h.get().roles("bar").run().assertStatus().is(403);
- c1h.get().roles("baz").run().assertStatus().is(403);
+ c1h.get().roles().run().assertStatusCode().is(403);
+ c1h.get().roles("bar").run().assertStatusCode().is(403);
+ c1h.get().roles("baz").run().assertStatusCode().is(403);
}
//-----------------------------------------------------------------------------------------------------------------
@@ -780,130 +780,130 @@ public class RoleGuardTest {
@Test
public void c02a_orPatternsWithComma_pass() throws Exception {
// @RestMethod(roleGuard="fo*,*ar")
- c2a.get().roles("foo").run().assertStatus().is(200);
- c2a.get().roles("bar").run().assertStatus().is(200);
- c2a.get().roles("foo","bar").run().assertStatus().is(200);
- c2a.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ c2a.get().roles("foo").run().assertStatusCode().is(200);
+ c2a.get().roles("bar").run().assertStatusCode().is(200);
+ c2a.get().roles("foo","bar").run().assertStatusCode().is(200);
+ c2a.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void c02b_orPatternsWithComma_fail() throws Exception {
// @RestMethod(roleGuard="fo*,*ar")
- c2a.get().roles().run().assertStatus().is(403);
- c2a.get().roles("baz").run().assertStatus().is(403);
+ c2a.get().roles().run().assertStatusCode().is(403);
+ c2a.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void c02c_orPatternsWithSinglePipe_pass() throws Exception {
// @RestMethod(roleGuard="fo* | *ar")
- c2b.get().roles("foo").run().assertStatus().is(200);
- c2b.get().roles("bar").run().assertStatus().is(200);
- c2b.get().roles("foo","bar").run().assertStatus().is(200);
- c2b.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ c2b.get().roles("foo").run().assertStatusCode().is(200);
+ c2b.get().roles("bar").run().assertStatusCode().is(200);
+ c2b.get().roles("foo","bar").run().assertStatusCode().is(200);
+ c2b.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void c02d_orPatternsWithSinglePipe_fail() throws Exception {
// @RestMethod(roleGuard="fo* | *ar")
- c2b.get().roles().run().assertStatus().is(403);
- c2b.get().roles("baz").run().assertStatus().is(403);
+ c2b.get().roles().run().assertStatusCode().is(403);
+ c2b.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void c02e_orPatternsWithDoublePipe_pass() throws Exception {
// @RestMethod(roleGuard="fo* || *ar")
- c2c.get().roles("foo").run().assertStatus().is(200);
- c2c.get().roles("bar").run().assertStatus().is(200);
- c2c.get().roles("foo","bar").run().assertStatus().is(200);
- c2c.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ c2c.get().roles("foo").run().assertStatusCode().is(200);
+ c2c.get().roles("bar").run().assertStatusCode().is(200);
+ c2c.get().roles("foo","bar").run().assertStatusCode().is(200);
+ c2c.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void c02f_orPatternsWithDoublePipe_fail() throws Exception {
// @RestMethod(roleGuard="foo || bar")
- c2c.get().roles().run().assertStatus().is(403);
- c2c.get().roles("baz").run().assertStatus().is(403);
+ c2c.get().roles().run().assertStatusCode().is(403);
+ c2c.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void c02g_andPatternsWithSingleAmp_pass() throws Exception {
// @RestMethod(roleGuard="fo* & *ar")
- c2d.get().roles("foo","bar").run().assertStatus().is(200);
- c2d.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ c2d.get().roles("foo","bar").run().assertStatusCode().is(200);
+ c2d.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void c02h_andPatternsWithSingleAmp_fail() throws Exception {
// @RestMethod(roleGuard="fo* & *ar")
- c2d.get().roles().run().assertStatus().is(403);
- c2d.get().roles("foo").run().assertStatus().is(403);
- c2d.get().roles("bar").run().assertStatus().is(403);
- c2d.get().roles("baz").run().assertStatus().is(403);
+ c2d.get().roles().run().assertStatusCode().is(403);
+ c2d.get().roles("foo").run().assertStatusCode().is(403);
+ c2d.get().roles("bar").run().assertStatusCode().is(403);
+ c2d.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void c02i_andPatternsWithDoubleAmp_pass() throws Exception {
// @RestMethod(roleGuard="fo* && *ar")
- c2e.get().roles("foo","bar").run().assertStatus().is(200);
- c2e.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ c2e.get().roles("foo","bar").run().assertStatusCode().is(200);
+ c2e.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void c02j_andPatternsWithDoubleAmp_fail() throws Exception {
// @RestMethod(roleGuard="fo* && *ar")
- c2e.get().roles().run().assertStatus().is(403);
- c2e.get().roles("foo").run().assertStatus().is(403);
- c2e.get().roles("bar").run().assertStatus().is(403);
- c2e.get().roles("baz").run().assertStatus().is(403);
+ c2e.get().roles().run().assertStatusCode().is(403);
+ c2e.get().roles("foo").run().assertStatusCode().is(403);
+ c2e.get().roles("bar").run().assertStatusCode().is(403);
+ c2e.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void c02k_andPatternsWithDoubleAmpAndParens_pass() throws Exception {
// @RestMethod(roleGuard="(fo*) && (*ar)")
- c2f.get().roles("foo","bar").run().assertStatus().is(200);
- c2f.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ c2f.get().roles("foo","bar").run().assertStatusCode().is(200);
+ c2f.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void c02l_andPatternsWithDoubleAmpAndParens_fail() throws Exception {
// @RestMethod(roleGuard="(fo*) && (*ar)")
- c2f.get().roles().run().assertStatus().is(403);
- c2f.get().roles("foo").run().assertStatus().is(403);
- c2f.get().roles("bar").run().assertStatus().is(403);
- c2f.get().roles("baz").run().assertStatus().is(403);
+ c2f.get().roles().run().assertStatusCode().is(403);
+ c2f.get().roles("foo").run().assertStatusCode().is(403);
+ c2f.get().roles("bar").run().assertStatusCode().is(403);
+ c2f.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void c02m_complexPatterns_pass() throws Exception {
// @RestMethod(roleGuard="fo* && (*ar || *az)")
- c2g.get().roles("foo","bar").run().assertStatus().is(200);
- c2g.get().roles("foo","baz").run().assertStatus().is(200);
- c2g.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ c2g.get().roles("foo","bar").run().assertStatusCode().is(200);
+ c2g.get().roles("foo","baz").run().assertStatusCode().is(200);
+ c2g.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void c02n_complexPatterns_fail() throws Exception {
// @RestMethod(roleGuard="fo* && (*ar || *az)")
- c2g.get().roles().run().assertStatus().is(403);
- c2g.get().roles("foo").run().assertStatus().is(403);
- c2g.get().roles("bar","baz").run().assertStatus().is(403);
- c2g.get().roles("baz").run().assertStatus().is(403);
+ c2g.get().roles().run().assertStatusCode().is(403);
+ c2g.get().roles("foo").run().assertStatusCode().is(403);
+ c2g.get().roles("bar","baz").run().assertStatusCode().is(403);
+ c2g.get().roles("baz").run().assertStatusCode().is(403);
}
@Test
public void c02o_complexPatterns_pass() throws Exception {
// @RestMethod(roleGuard="fo* || (*ar && *az)")
- c2h.get().roles("foo").run().assertStatus().is(200);
- c2h.get().roles("bar","baz").run().assertStatus().is(200);
- c2h.get().roles("foo","bar","baz").run().assertStatus().is(200);
+ c2h.get().roles("foo").run().assertStatusCode().is(200);
+ c2h.get().roles("bar","baz").run().assertStatusCode().is(200);
+ c2h.get().roles("foo","bar","baz").run().assertStatusCode().is(200);
}
@Test
public void c02p_complexPatterns_fail() throws Exception {
// @RestMethod(roleGuard="fo* || (*ar && *az)")
- c2h.get().roles().run().assertStatus().is(403);
- c2h.get().roles("bar").run().assertStatus().is(403);
- c2h.get().roles("baz").run().assertStatus().is(403);
+ c2h.get().roles().run().assertStatusCode().is(403);
+ c2h.get().roles("bar").run().assertStatusCode().is(403);
+ c2h.get().roles("baz").run().assertStatusCode().is(403);
}
//-----------------------------------------------------------------------------------------------------------------
@@ -923,11 +923,11 @@ public class RoleGuardTest {
@Test
public void d01_patternsWithoutRoles_fail() throws Exception {
// @RestMethod(roleGuard="fo*,*bar")
- d.get().roles().run().assertStatus().is(403);
- d.get().roles("foo").run().assertStatus().is(403);
- d.get().roles("bar").run().assertStatus().is(403);
- d.get().roles("baz").run().assertStatus().is(403);
- d.get().roles("foo","bar").run().assertStatus().is(403);
+ d.get().roles().run().assertStatusCode().is(403);
+ d.get().roles("foo").run().assertStatusCode().is(403);
+ d.get().roles("bar").run().assertStatusCode().is(403);
+ d.get().roles("baz").run().assertStatusCode().is(403);
+ d.get().roles("foo","bar").run().assertStatusCode().is(403);
}
//-----------------------------------------------------------------------------------------------------------------
@@ -947,15 +947,15 @@ public class RoleGuardTest {
@Test
public void e01_anyRole_pass() throws Exception {
// @RestMethod(roleGuard="*")
- e.get().roles("foo").run().assertStatus().is(200);
- e.get().roles("bar").run().assertStatus().is(200);
- e.get().roles("baz").run().assertStatus().is(200);
- e.get().roles("foo","bar").run().assertStatus().is(200);
+ e.get().roles("foo").run().assertStatusCode().is(200);
+ e.get().roles("bar").run().assertStatusCode().is(200);
+ e.get().roles("baz").run().assertStatusCode().is(200);
+ e.get().roles("foo","bar").run().assertStatusCode().is(200);
}
@Test
public void e02_anyRole_fail() throws Exception {
// @RestMethod(roleGuard="*")
- e.get().roles().run().assertStatus().is(403);
+ e.get().roles().run().assertStatusCode().is(403);
}
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/exceptions/BasicTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/exceptions/BasicTest.java
index e7fd1fb..75e7b60 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/exceptions/BasicTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/exceptions/BasicTest.java
@@ -75,231 +75,231 @@ public class BasicTest {
public void a01_badRequest() throws Exception {
a.get("/badRequest")
.run()
- .assertStatus().is(400)
+ .assertStatusCode().is(400)
.assertBody().is("Bad Request");
}
@Test
public void a02_conflict() throws Exception {
a.get("/conflict")
.run()
- .assertStatus().is(409)
+ .assertStatusCode().is(409)
.assertBody().is("Conflict");
}
@Test
public void a03_expectationFailed() throws Exception {
a.get("/expectationFailed")
.run()
- .assertStatus().is(417)
+ .assertStatusCode().is(417)
.assertBody().is("Expectation Failed");
}
@Test
public void a04_failedDependency() throws Exception {
a.get("/failedDependency")
.run()
- .assertStatus().is(424)
+ .assertStatusCode().is(424)
.assertBody().is("Failed Dependency");
}
@Test
public void a05_forbidden() throws Exception {
a.get("/forbidden")
.run()
- .assertStatus().is(403)
+ .assertStatusCode().is(403)
.assertBody().is("Forbidden");
}
@Test
public void a06_gone() throws Exception {
a.get("/gone")
.run()
- .assertStatus().is(410)
+ .assertStatusCode().is(410)
.assertBody().is("Gone");
}
@Test
public void a07_httpVersionNotSupported() throws Exception {
a.get("/httpVersionNotSupported")
.run()
- .assertStatus().is(505)
+ .assertStatusCode().is(505)
.assertBody().is("HTTP Version Not Supported");
}
@Test
public void a08_insufficientStorage() throws Exception {
a.get("/insufficientStorage")
.run()
- .assertStatus().is(507)
+ .assertStatusCode().is(507)
.assertBody().is("Insufficient Storage");
}
@Test
public void a09_internalServerError() throws Exception {
a.get("/internalServerError")
.run()
- .assertStatus().is(500)
+ .assertStatusCode().is(500)
.assertBody().is("Internal Server Error");
}
@Test
public void a10_lengthRequired() throws Exception {
a.get("/lengthRequired")
.run()
- .assertStatus().is(411)
+ .assertStatusCode().is(411)
.assertBody().is("Length Required");
}
@Test
public void a11_locked() throws Exception {
a.get("/locked")
.run()
- .assertStatus().is(423)
+ .assertStatusCode().is(423)
.assertBody().is("Locked");
}
@Test
public void a12_loopDetected() throws Exception {
a.get("/loopDetected")
.run()
- .assertStatus().is(508)
+ .assertStatusCode().is(508)
.assertBody().is("Loop Detected");
}
@Test
public void a13_methodNotAllowed() throws Exception {
a.get("/methodNotAllowed")
.run()
- .assertStatus().is(405)
+ .assertStatusCode().is(405)
.assertBody().is("Method Not Allowed");
}
@Test
public void a14_misdirectedRequest() throws Exception {
a.get("/misdirectedRequest")
.run()
- .assertStatus().is(421)
+ .assertStatusCode().is(421)
.assertBody().is("Misdirected Request");
}
@Test
public void a15_networkAuthenticationRequired() throws Exception {
a.get("/networkAuthenticationRequired")
.run()
- .assertStatus().is(511)
+ .assertStatusCode().is(511)
.assertBody().is("Network Authentication Required");
}
@Test
public void a16_notAcceptable() throws Exception {
a.get("/notAcceptable")
.run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().is("Not Acceptable");
}
@Test
public void a17_notExtended() throws Exception {
a.get("/notExtended")
.run()
- .assertStatus().is(510)
+ .assertStatusCode().is(510)
.assertBody().is("Not Extended");
}
@Test
public void a18_notFound() throws Exception {
a.get("/notFound")
.run()
- .assertStatus().is(404)
+ .assertStatusCode().is(404)
.assertBody().is("Not Found");
}
@Test
public void a19_notImplemented() throws Exception {
a.get("/notImplemented")
.run()
- .assertStatus().is(501)
+ .assertStatusCode().is(501)
.assertBody().is("Not Implemented");
}
@Test
public void a20_payloadTooLarge() throws Exception {
a.get("/payloadTooLarge")
.run()
- .assertStatus().is(413)
+ .assertStatusCode().is(413)
.assertBody().is("Payload Too Large");
}
@Test
public void a21_preconditionFailed() throws Exception {
a.get("/preconditionFailed")
.run()
- .assertStatus().is(412)
+ .assertStatusCode().is(412)
.assertBody().is("Precondition Failed");
}
@Test
public void a22_preconditionRequired() throws Exception {
a.get("/preconditionRequired")
.run()
- .assertStatus().is(428)
+ .assertStatusCode().is(428)
.assertBody().is("Precondition Required");
}
@Test
public void a23_rangeNotSatisfiable() throws Exception {
a.get("/rangeNotSatisfiable")
.run()
- .assertStatus().is(416)
+ .assertStatusCode().is(416)
.assertBody().is("Range Not Satisfiable");
}
@Test
public void a24_requestHeaderFieldsTooLarge() throws Exception {
a.get("/requestHeaderFieldsTooLarge")
.run()
- .assertStatus().is(431)
+ .assertStatusCode().is(431)
.assertBody().is("Request Header Fields Too Large");
}
@Test
public void a25_serviceUnavailable() throws Exception {
a.get("/serviceUnavailable")
.run()
- .assertStatus().is(503)
+ .assertStatusCode().is(503)
.assertBody().is("Service Unavailable");
}
@Test
public void a26_tooManyRequests() throws Exception {
a.get("/tooManyRequests")
.run()
- .assertStatus().is(429)
+ .assertStatusCode().is(429)
.assertBody().is("Too Many Requests");
}
@Test
public void a27_unauthorized() throws Exception {
a.get("/unauthorized")
.run()
- .assertStatus().is(401)
+ .assertStatusCode().is(401)
.assertBody().is("Unauthorized");
}
@Test
public void a28_unavailableForLegalReasons() throws Exception {
a.get("/unavailableForLegalReasons")
.run()
- .assertStatus().is(451)
+ .assertStatusCode().is(451)
.assertBody().is("Unavailable For Legal Reasons");
}
@Test
public void a29_unprocessableEntity() throws Exception {
a.get("/unprocessableEntity")
.run()
- .assertStatus().is(422)
+ .assertStatusCode().is(422)
.assertBody().is("Unprocessable Entity");
}
@Test
public void a30_unsupportedMediaType() throws Exception {
a.get("/unsupportedMediaType")
.run()
- .assertStatus().is(415)
+ .assertStatusCode().is(415)
.assertBody().is("Unsupported Media Type");
}
@Test
public void a31_upgradeRequired() throws Exception {
a.get("/upgradeRequired")
.run()
- .assertStatus().is(426)
+ .assertStatusCode().is(426)
.assertBody().is("Upgrade Required");
}
@Test
public void a32_uriTooLong() throws Exception {
a.get("/uriTooLong")
.run()
- .assertStatus().is(414)
+ .assertStatusCode().is(414)
.assertBody().is("URI Too Long");
}
@Test
public void a33_variantAlsoNegotiates() throws Exception {
a.get("/variantAlsoNegotiates")
.run()
- .assertStatus().is(506)
+ .assertStatusCode().is(506)
.assertBody().is("Variant Also Negotiates");
}
@@ -350,231 +350,231 @@ public class BasicTest {
public void b01_badRequest() throws Exception {
b.get("/badRequest")
.run()
- .assertStatus().is(400)
+ .assertStatusCode().is(400)
.assertBody().is("foo bar");
}
@Test
public void b02_conflict() throws Exception {
b.get("/conflict")
.run()
- .assertStatus().is(409)
+ .assertStatusCode().is(409)
.assertBody().is("foo bar");
}
@Test
public void b03_expectationFailed() throws Exception {
b.get("/expectationFailed")
.run()
- .assertStatus().is(417)
+ .assertStatusCode().is(417)
.assertBody().is("foo bar");
}
@Test
public void b04_failedDependency() throws Exception {
b.get("/failedDependency")
.run()
- .assertStatus().is(424)
+ .assertStatusCode().is(424)
.assertBody().is("foo bar");
}
@Test
public void b05_forbidden() throws Exception {
b.get("/forbidden")
.run()
- .assertStatus().is(403)
+ .assertStatusCode().is(403)
.assertBody().is("foo bar");
}
@Test
public void b06_gone() throws Exception {
b.get("/gone")
.run()
- .assertStatus().is(410)
+ .assertStatusCode().is(410)
.assertBody().is("foo bar");
}
@Test
public void b07_httpVersionNotSupported() throws Exception {
b.get("/httpVersionNotSupported")
.run()
- .assertStatus().is(505)
+ .assertStatusCode().is(505)
.assertBody().is("foo bar");
}
@Test
public void b08_insufficientStorage() throws Exception {
b.get("/insufficientStorage")
.run()
- .assertStatus().is(507)
+ .assertStatusCode().is(507)
.assertBody().is("foo bar");
}
@Test
public void b09_internalServerError() throws Exception {
b.get("/internalServerError")
.run()
- .assertStatus().is(500)
+ .assertStatusCode().is(500)
.assertBody().is("foo bar");
}
@Test
public void b10_lengthRequired() throws Exception {
b.get("/lengthRequired")
.run()
- .assertStatus().is(411)
+ .assertStatusCode().is(411)
.assertBody().is("foo bar");
}
@Test
public void b11_locked() throws Exception {
b.get("/locked")
.run()
- .assertStatus().is(423)
+ .assertStatusCode().is(423)
.assertBody().is("foo bar");
}
@Test
public void b12_loopDetected() throws Exception {
b.get("/loopDetected")
.run()
- .assertStatus().is(508)
+ .assertStatusCode().is(508)
.assertBody().is("foo bar");
}
@Test
public void b13_methodNotAllowed() throws Exception {
b.get("/methodNotAllowed")
.run()
- .assertStatus().is(405)
+ .assertStatusCode().is(405)
.assertBody().is("foo bar");
}
@Test
public void b14_misdirectedRequest() throws Exception {
b.get("/misdirectedRequest")
.run()
- .assertStatus().is(421)
+ .assertStatusCode().is(421)
.assertBody().is("foo bar");
}
@Test
public void b15_networkAuthenticationRequired() throws Exception {
b.get("/networkAuthenticationRequired")
.run()
- .assertStatus().is(511)
+ .assertStatusCode().is(511)
.assertBody().is("foo bar");
}
@Test
public void b16_notAcceptable() throws Exception {
b.get("/notAcceptable")
.run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().is("foo bar");
}
@Test
public void b17_notExtended() throws Exception {
b.get("/notExtended")
.run()
- .assertStatus().is(510)
+ .assertStatusCode().is(510)
.assertBody().is("foo bar");
}
@Test
public void b18_notFound() throws Exception {
b.get("/notFound")
.run()
- .assertStatus().is(404)
+ .assertStatusCode().is(404)
.assertBody().is("foo bar");
}
@Test
public void b19_notImplemented() throws Exception {
b.get("/notImplemented")
.run()
- .assertStatus().is(501)
+ .assertStatusCode().is(501)
.assertBody().is("foo bar");
}
@Test
public void b20_payloadTooLarge() throws Exception {
b.get("/payloadTooLarge")
.run()
- .assertStatus().is(413)
+ .assertStatusCode().is(413)
.assertBody().is("foo bar");
}
@Test
public void b21_preconditionFailed() throws Exception {
b.get("/preconditionFailed")
.run()
- .assertStatus().is(412)
+ .assertStatusCode().is(412)
.assertBody().is("foo bar");
}
@Test
public void b22_preconditionRequired() throws Exception {
b.get("/preconditionRequired")
.run()
- .assertStatus().is(428)
+ .assertStatusCode().is(428)
.assertBody().is("foo bar");
}
@Test
public void b23_rangeNotSatisfiable() throws Exception {
b.get("/rangeNotSatisfiable")
.run()
- .assertStatus().is(416)
+ .assertStatusCode().is(416)
.assertBody().is("foo bar");
}
@Test
public void b24_requestHeaderFieldsTooLarge() throws Exception {
b.get("/requestHeaderFieldsTooLarge")
.run()
- .assertStatus().is(431)
+ .assertStatusCode().is(431)
.assertBody().is("foo bar");
}
@Test
public void b25_serviceUnavailable() throws Exception {
b.get("/serviceUnavailable")
.run()
- .assertStatus().is(503)
+ .assertStatusCode().is(503)
.assertBody().is("foo bar");
}
@Test
public void b26_tooManyRequests() throws Exception {
b.get("/tooManyRequests")
.run()
- .assertStatus().is(429)
+ .assertStatusCode().is(429)
.assertBody().is("foo bar");
}
@Test
public void b27_unauthorized() throws Exception {
b.get("/unauthorized")
.run()
- .assertStatus().is(401)
+ .assertStatusCode().is(401)
.assertBody().is("foo bar");
}
@Test
public void b28_unavailableForLegalReasons() throws Exception {
b.get("/unavailableForLegalReasons")
.run()
- .assertStatus().is(451)
+ .assertStatusCode().is(451)
.assertBody().is("foo bar");
}
@Test
public void b29_unprocessableEntity() throws Exception {
b.get("/unprocessableEntity")
.run()
- .assertStatus().is(422)
+ .assertStatusCode().is(422)
.assertBody().is("foo bar");
}
@Test
public void b30_unsupportedMediaType() throws Exception {
b.get("/unsupportedMediaType")
.run()
- .assertStatus().is(415)
+ .assertStatusCode().is(415)
.assertBody().is("foo bar");
}
@Test
public void b31_upgradeRequired() throws Exception {
b.get("/upgradeRequired")
.run()
- .assertStatus().is(426)
+ .assertStatusCode().is(426)
.assertBody().is("foo bar");
}
@Test
public void b32_uriTooLong() throws Exception {
b.get("/uriTooLong")
.run()
- .assertStatus().is(414)
+ .assertStatusCode().is(414)
.assertBody().is("foo bar");
}
@Test
public void b33_variantAlsoNegotiates() throws Exception {
b.get("/variantAlsoNegotiates")
.run()
- .assertStatus().is(506)
+ .assertStatusCode().is(506)
.assertBody().is("foo bar");
}
@@ -627,231 +627,231 @@ public class BasicTest {
public void c01_badRequest() throws Exception {
c.get("/badRequest")
.run()
- .assertStatus().is(400)
+ .assertStatusCode().is(400)
.assertBody().is("foo");
}
@Test
public void c02_conflict() throws Exception {
c.get("/conflict")
.run()
- .assertStatus().is(409)
+ .assertStatusCode().is(409)
.assertBody().is("foo");
}
@Test
public void c03_expectationFailed() throws Exception {
c.get("/expectationFailed")
.run()
- .assertStatus().is(417)
+ .assertStatusCode().is(417)
.assertBody().is("foo");
}
@Test
public void c04_failedDependency() throws Exception {
c.get("/failedDependency")
.run()
- .assertStatus().is(424)
+ .assertStatusCode().is(424)
.assertBody().is("foo");
}
@Test
public void c05_forbidden() throws Exception {
c.get("/forbidden")
.run()
- .assertStatus().is(403)
+ .assertStatusCode().is(403)
.assertBody().is("foo");
}
@Test
public void c06_gone() throws Exception {
c.get("/gone")
.run()
- .assertStatus().is(410)
+ .assertStatusCode().is(410)
.assertBody().is("foo");
}
@Test
public void c07_httpVersionNotSupported() throws Exception {
c.get("/httpVersionNotSupported")
.run()
- .assertStatus().is(505)
+ .assertStatusCode().is(505)
.assertBody().is("foo");
}
@Test
public void c08_insufficientStorage() throws Exception {
c.get("/insufficientStorage")
.run()
- .assertStatus().is(507)
+ .assertStatusCode().is(507)
.assertBody().is("foo");
}
@Test
public void c09_internalServerError() throws Exception {
c.get("/internalServerError")
.run()
- .assertStatus().is(500)
+ .assertStatusCode().is(500)
.assertBody().is("foo");
}
@Test
public void c10_lengthRequired() throws Exception {
c.get("/lengthRequired")
.run()
- .assertStatus().is(411)
+ .assertStatusCode().is(411)
.assertBody().is("foo");
}
@Test
public void c11_locked() throws Exception {
c.get("/locked")
.run()
- .assertStatus().is(423)
+ .assertStatusCode().is(423)
.assertBody().is("foo");
}
@Test
public void c12_loopDetected() throws Exception {
c.get("/loopDetected")
.run()
- .assertStatus().is(508)
+ .assertStatusCode().is(508)
.assertBody().is("foo");
}
@Test
public void c13_methodNotAllowed() throws Exception {
c.get("/methodNotAllowed")
.run()
- .assertStatus().is(405)
+ .assertStatusCode().is(405)
.assertBody().is("foo");
}
@Test
public void c14_misdirectedRequest() throws Exception {
c.get("/misdirectedRequest")
.run()
- .assertStatus().is(421)
+ .assertStatusCode().is(421)
.assertBody().is("foo");
}
@Test
public void c15_networkAuthenticationRequired() throws Exception {
c.get("/networkAuthenticationRequired")
.run()
- .assertStatus().is(511)
+ .assertStatusCode().is(511)
.assertBody().is("foo");
}
@Test
public void c16_notAcceptable() throws Exception {
c.get("/notAcceptable")
.run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().is("foo");
}
@Test
public void c17_notExtended() throws Exception {
c.get("/notExtended")
.run()
- .assertStatus().is(510)
+ .assertStatusCode().is(510)
.assertBody().is("foo");
}
@Test
public void c18_notFound() throws Exception {
c.get("/notFound")
.run()
- .assertStatus().is(404)
+ .assertStatusCode().is(404)
.assertBody().is("foo");
}
@Test
public void c19_notImplemented() throws Exception {
c.get("/notImplemented")
.run()
- .assertStatus().is(501)
+ .assertStatusCode().is(501)
.assertBody().is("foo");
}
@Test
public void c20_payloadTooLarge() throws Exception {
c.get("/payloadTooLarge")
.run()
- .assertStatus().is(413)
+ .assertStatusCode().is(413)
.assertBody().is("foo");
}
@Test
public void c21_preconditionFailed() throws Exception {
c.get("/preconditionFailed").
run()
- .assertStatus().is(412)
+ .assertStatusCode().is(412)
.assertBody().is("foo");
}
@Test
public void c22_preconditionRequired() throws Exception {
c.get("/preconditionRequired")
.run()
- .assertStatus().is(428)
+ .assertStatusCode().is(428)
.assertBody().is("foo");
}
@Test
public void c23_rangeNotSatisfiable() throws Exception {
c.get("/rangeNotSatisfiable")
.run()
- .assertStatus().is(416)
+ .assertStatusCode().is(416)
.assertBody().is("foo");
}
@Test
public void c24_requestHeaderFieldsTooLarge() throws Exception {
c.get("/requestHeaderFieldsTooLarge")
.run()
- .assertStatus().is(431)
+ .assertStatusCode().is(431)
.assertBody().is("foo");
}
@Test
public void c25_serviceUnavailable() throws Exception {
c.get("/serviceUnavailable")
.run()
- .assertStatus().is(503)
+ .assertStatusCode().is(503)
.assertBody().is("foo");
}
@Test
public void c26_tooManyRequests() throws Exception {
c.get("/tooManyRequests")
.run()
- .assertStatus().is(429)
+ .assertStatusCode().is(429)
.assertBody().is("foo");
}
@Test
public void c27_unauthorized() throws Exception {
c.get("/unauthorized")
.run()
- .assertStatus().is(401)
+ .assertStatusCode().is(401)
.assertBody().is("foo");
}
@Test
public void c28_unavailableForLegalReasons() throws Exception {
c.get("/unavailableForLegalReasons")
.run()
- .assertStatus().is(451)
+ .assertStatusCode().is(451)
.assertBody().is("foo");
}
@Test
public void c29_unprocessableEntity() throws Exception {
c.get("/unprocessableEntity")
.run()
- .assertStatus().is(422)
+ .assertStatusCode().is(422)
.assertBody().is("foo");
}
@Test
public void c30_unsupportedMediaType() throws Exception {
c.get("/unsupportedMediaType")
.run()
- .assertStatus().is(415)
+ .assertStatusCode().is(415)
.assertBody().is("foo");
}
@Test
public void c31_upgradeRequired() throws Exception {
c.get("/upgradeRequired")
.run()
- .assertStatus().is(426)
+ .assertStatusCode().is(426)
.assertBody().is("foo");
}
@Test
public void c32_uriTooLong() throws Exception {
c.get("/uriTooLong")
.run()
- .assertStatus().is(414)
+ .assertStatusCode().is(414)
.assertBody().is("foo");
}
@Test
public void c33_variantAlsoNegotiates() throws Exception {
c.get("/variantAlsoNegotiates")
.run()
- .assertStatus().is(506)
+ .assertStatusCode().is(506)
.assertBody().is("foo");
}
@@ -902,231 +902,231 @@ public class BasicTest {
public void d01_badRequest() throws Exception {
d.get("/badRequest")
.run()
- .assertStatus().is(400)
+ .assertStatusCode().is(400)
.assertBody().is("foo bar");
}
@Test
public void d02_conflict() throws Exception {
d.get("/conflict")
.run()
- .assertStatus().is(409)
+ .assertStatusCode().is(409)
.assertBody().is("foo bar");
}
@Test
public void d03_expectationFailed() throws Exception {
d.get("/expectationFailed")
.run()
- .assertStatus().is(417)
+ .assertStatusCode().is(417)
.assertBody().is("foo bar");
}
@Test
public void d04_failedDependency() throws Exception {
d.get("/failedDependency")
.run()
- .assertStatus().is(424)
+ .assertStatusCode().is(424)
.assertBody().is("foo bar");
}
@Test
public void d05_forbidden() throws Exception {
d.get("/forbidden")
.run()
- .assertStatus().is(403)
+ .assertStatusCode().is(403)
.assertBody().is("foo bar");
}
@Test
public void d06_gone() throws Exception {
d.get("/gone")
.run()
- .assertStatus().is(410)
+ .assertStatusCode().is(410)
.assertBody().is("foo bar");
}
@Test
public void d07_httpVersionNotSupported() throws Exception {
d.get("/httpVersionNotSupported")
.run()
- .assertStatus().is(505)
+ .assertStatusCode().is(505)
.assertBody().is("foo bar");
}
@Test
public void d08_insufficientStorage() throws Exception {
d.get("/insufficientStorage")
.run()
- .assertStatus().is(507)
+ .assertStatusCode().is(507)
.assertBody().is("foo bar");
}
@Test
public void d09_internalServerError() throws Exception {
d.get("/internalServerError")
.run()
- .assertStatus().is(500)
+ .assertStatusCode().is(500)
.assertBody().is("foo bar");
}
@Test
public void d10_lengthRequired() throws Exception {
d.get("/lengthRequired")
.run()
- .assertStatus().is(411)
+ .assertStatusCode().is(411)
.assertBody().is("foo bar");
}
@Test
public void d11_locked() throws Exception {
d.get("/locked")
.run()
- .assertStatus().is(423)
+ .assertStatusCode().is(423)
.assertBody().is("foo bar");
}
@Test
public void d12_loopDetected() throws Exception {
d.get("/loopDetected")
.run()
- .assertStatus().is(508)
+ .assertStatusCode().is(508)
.assertBody().is("foo bar");
}
@Test
public void d13_methodNotAllowed() throws Exception {
d.get("/methodNotAllowed")
.run()
- .assertStatus().is(405)
+ .assertStatusCode().is(405)
.assertBody().is("foo bar");
}
@Test
public void d14_misdirectedRequest() throws Exception {
d.get("/misdirectedRequest")
.run()
- .assertStatus().is(421)
+ .assertStatusCode().is(421)
.assertBody().is("foo bar");
}
@Test
public void d15_networkAuthenticationRequired() throws Exception {
d.get("/networkAuthenticationRequired")
.run()
- .assertStatus().is(511)
+ .assertStatusCode().is(511)
.assertBody().is("foo bar");
}
@Test
public void d16_notAcceptable() throws Exception {
d.get("/notAcceptable")
.run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().is("foo bar");
}
@Test
public void d17_notExtended() throws Exception {
d.get("/notExtended")
.run()
- .assertStatus().is(510)
+ .assertStatusCode().is(510)
.assertBody().is("foo bar");
}
@Test
public void d18_notFound() throws Exception {
d.get("/notFound")
.run()
- .assertStatus().is(404)
+ .assertStatusCode().is(404)
.assertBody().is("foo bar");
}
@Test
public void d19_notImplemented() throws Exception {
d.get("/notImplemented")
.run()
- .assertStatus().is(501)
+ .assertStatusCode().is(501)
.assertBody().is("foo bar");
}
@Test
public void d20_payloadTooLarge() throws Exception {
d.get("/payloadTooLarge")
.run()
- .assertStatus().is(413)
+ .assertStatusCode().is(413)
.assertBody().is("foo bar");
}
@Test
public void d21_preconditionFailed() throws Exception {
d.get("/preconditionFailed")
.run()
- .assertStatus().is(412)
+ .assertStatusCode().is(412)
.assertBody().is("foo bar");
}
@Test
public void d22_preconditionRequired() throws Exception {
d.get("/preconditionRequired")
.run()
- .assertStatus().is(428)
+ .assertStatusCode().is(428)
.assertBody().is("foo bar");
}
@Test
public void d23_rangeNotSatisfiable() throws Exception {
d.get("/rangeNotSatisfiable")
.run()
- .assertStatus().is(416)
+ .assertStatusCode().is(416)
.assertBody().is("foo bar");
}
@Test
public void d24_requestHeaderFieldsTooLarge() throws Exception {
d.get("/requestHeaderFieldsTooLarge")
.run()
- .assertStatus().is(431)
+ .assertStatusCode().is(431)
.assertBody().is("foo bar");
}
@Test
public void d25_serviceUnavailable() throws Exception {
d.get("/serviceUnavailable")
.run()
- .assertStatus().is(503)
+ .assertStatusCode().is(503)
.assertBody().is("foo bar");
}
@Test
public void d26_tooManyRequests() throws Exception {
d.get("/tooManyRequests")
.run()
- .assertStatus().is(429)
+ .assertStatusCode().is(429)
.assertBody().is("foo bar");
}
@Test
public void d27_unauthorized() throws Exception {
d.get("/unauthorized")
.run()
- .assertStatus().is(401)
+ .assertStatusCode().is(401)
.assertBody().is("foo bar");
}
@Test
public void d28_unavailableForLegalReasons() throws Exception {
d.get("/unavailableForLegalReasons")
.run()
- .assertStatus().is(451)
+ .assertStatusCode().is(451)
.assertBody().is("foo bar");
}
@Test
public void d29_unprocessableEntity() throws Exception {
d.get("/unprocessableEntity")
.run()
- .assertStatus().is(422)
+ .assertStatusCode().is(422)
.assertBody().is("foo bar");
}
@Test
public void d30_unsupportedMediaType() throws Exception {
d.get("/unsupportedMediaType")
.run()
- .assertStatus().is(415)
+ .assertStatusCode().is(415)
.assertBody().is("foo bar");
}
@Test
public void d31_upgradeRequired() throws Exception {
d.get("/upgradeRequired")
.run()
- .assertStatus().is(426)
+ .assertStatusCode().is(426)
.assertBody().is("foo bar");
}
@Test
public void d32_uriTooLong() throws Exception {
d.get("/uriTooLong")
.run()
- .assertStatus().is(414)
+ .assertStatusCode().is(414)
.assertBody().is("foo bar");
}
@Test
public void d33_variantAlsoNegotiates() throws Exception {
d.get("/variantAlsoNegotiates")
.run()
- .assertStatus().is(506)
+ .assertStatusCode().is(506)
.assertBody().is("foo bar");
}
@@ -1146,7 +1146,7 @@ public class BasicTest {
e.get("/badRequest")
.json()
.run()
- .assertStatus().is(400)
+ .assertStatusCode().is(400)
.assertBody().is("'foo bar'");
}
@@ -1375,7 +1375,7 @@ public class BasicTest {
public void g01_thrownObjectDoesntMatchReturnType() throws Exception {
g.get("/thrownObjectDoesntMatchReturnType")
.run()
- .assertStatus().is(404);
+ .assertStatusCode().is(404);
}
//-----------------------------------------------------------------------------------------------------------------
@@ -1396,6 +1396,6 @@ public class BasicTest {
public void h01_parseExceptionCausesBadRequest() throws Exception {
h.get("/foo")
.run()
- .assertStatus().is(400);
+ .assertStatusCode().is(400);
}
}
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptCharsetTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptCharsetTest.java
index 401fdd0..d8a637f 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptCharsetTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptCharsetTest.java
@@ -109,7 +109,7 @@ public class AcceptCharsetTest {
public void b01_testCharsetOnResponse() throws Exception {
b.put("/charsetOnResponse", null).plainText().run().assertBody().is("UTF-8/UTF-8");
b.put("/charsetOnResponse", null).plainText().acceptCharset("Shift_JIS").run().assertBody().is("UTF-8/Shift_JIS");
- b.put("/charsetOnResponse?noTrace=true", null).plainText().acceptCharset("BAD").run().assertStatus().is(406).assertBody().contains("No supported charsets in header 'Accept-Charset': 'BAD'");
+ b.put("/charsetOnResponse?noTrace=true", null).plainText().acceptCharset("BAD").run().assertStatusCode().is(406).assertBody().contains("No supported charsets in header 'Accept-Charset': 'BAD'");
b.put("/charsetOnResponse", null).plainText().acceptCharset("UTF-8").run().assertBody().is("UTF-8/UTF-8");
b.put("/charsetOnResponse", null).plainText().acceptCharset("bad,iso-8859-1").run().assertBody().is("UTF-8/ISO-8859-1");
b.put("/charsetOnResponse", null).plainText().acceptCharset("bad;q=0.9,iso-8859-1;q=0.1").run().assertBody().is("UTF-8/ISO-8859-1");
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptEncodingTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptEncodingTest.java
index 193bb91..2a5c77d 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptEncodingTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptEncodingTest.java
@@ -72,37 +72,37 @@ public class AcceptEncodingTest {
@Test
public void a03_noCompression_nomatch() throws Exception {
a.get("?noTrace=true").acceptEncoding("mycoding,identity;q=0").run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().contains(
"Unsupported encoding in request header 'Accept-Encoding': 'mycoding,identity;q=0'",
"Supported codings: ['identity']"
);
a.get("?noTrace=true").acceptEncoding("mycoding,*;q=0").run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().contains(
"Unsupported encoding in request header 'Accept-Encoding': 'mycoding,*;q=0'",
"Supported codings: ['identity']"
);
a.get("?noTrace=true").acceptEncoding("identity;q=0").run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().contains(
"Unsupported encoding in request header 'Accept-Encoding': 'identity;q=0'",
"Supported codings: ['identity']"
);
a.get("?noTrace=true").acceptEncoding("identity;q=0.0").run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().contains(
"Unsupported encoding in request header 'Accept-Encoding': 'identity;q=0.0'",
"Supported codings: ['identity']"
);
a.get("?noTrace=true").acceptEncoding("*;q=0").run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().contains(
"Unsupported encoding in request header 'Accept-Encoding': '*;q=0'",
"Supported codings: ['identity']"
);
a.get("?noTrace=true").acceptEncoding("*;q=0.0").run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().contains(
"Unsupported encoding in request header 'Accept-Encoding': '*;q=0.0'",
"Supported codings: ['identity']"
@@ -147,25 +147,25 @@ public class AcceptEncodingTest {
@Test
public void b05_withCompression_nomatch() throws Exception {
b.get("/b01?noTrace=true").acceptEncoding("identity;q=0").run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().contains(
"Unsupported encoding in request header 'Accept-Encoding': 'identity;q=0'",
"Supported codings: ['mycoding','identity']"
);
b.get("/b01?noTrace=true").acceptEncoding("identity;q=0.0").run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().contains(
"Unsupported encoding in request header 'Accept-Encoding': 'identity;q=0.0'",
"Supported codings: ['mycoding','identity']"
);
b.get("/b01?noTrace=true").acceptEncoding("*;q=0").run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().contains(
"Unsupported encoding in request header 'Accept-Encoding': '*;q=0'",
"Supported codings: ['mycoding','identity']"
);
b.get("/b01?noTrace=true").acceptEncoding("*;q=0.0").run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().contains(
"Unsupported encoding in request header 'Accept-Encoding': '*;q=0.0'",
"Supported codings: ['mycoding','identity']"
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptTest.java
index fa83287..4d3f938 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/AcceptTest.java
@@ -89,7 +89,7 @@ public class AcceptTest {
a.put("/a01?noTrace=true", null)
.accept("text/s3")
.run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().contains("Unsupported media-type in request header 'Accept': 'text/s3'");
}
@@ -120,7 +120,7 @@ public class AcceptTest {
b.put("/b?noTrace=true", null)
.accept("text/s4")
.run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().contains(
"Unsupported media-type in request header 'Accept': 'text/s4'",
"Supported media-types: ['text/s3']"
@@ -168,7 +168,7 @@ public class AcceptTest {
c.put("/c?noTrace=true", null)
.accept("text/s4")
.run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().contains(
"Unsupported media-type in request header 'Accept': 'text/s4'",
"Supported media-types: ['text/s3','text/s1','text/s2']"
@@ -207,7 +207,7 @@ public class AcceptTest {
d.put("/d?noTrace=true", null)
.accept("bad/*")
.run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().contains(
"Unsupported media-type in request header 'Accept': 'bad/*'",
"Supported media-types: ['text/s1','text/s2']"
@@ -241,13 +241,13 @@ public class AcceptTest {
e.put("/d?noTrace=true", null)
.accept("text/s1")
.run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().contains(
"Unsupported media-type in request header 'Accept': 'text/s1'",
"Supported media-types: ['text/s3']"
);
e.put("/d?noTrace=true", null).accept("text/s2").run()
- .assertStatus().is(406)
+ .assertStatusCode().is(406)
.assertBody().contains(
"Unsupported media-type in request header 'Accept': 'text/s2'",
"Supported media-types: ['text/s3']"
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/ContentEncodingTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/ContentEncodingTest.java
index 541c6e2..d8360a3 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/ContentEncodingTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/ContentEncodingTest.java
@@ -58,7 +58,7 @@ public class ContentEncodingTest {
@Test
public void a02_noCompression_invalid() throws Exception {
a.put("?noTrace=true", compress("foo")).contentEncoding("mycoding").run()
- .assertStatus().is(415)
+ .assertStatusCode().is(415)
.assertBody().contains(
"Unsupported encoding in request header 'Content-Encoding': 'mycoding'",
"Supported codings: ['identity']"
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/ContentTypeTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/ContentTypeTest.java
index e7916ea..23761da 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/ContentTypeTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/headers/ContentTypeTest.java
@@ -88,7 +88,7 @@ public class ContentTypeTest {
a.put("/a01?noTrace=true", null)
.contentType("text/p3")
.run()
- .assertStatus().is(415)
+ .assertStatusCode().is(415)
.assertBody().contains("Unsupported media-type in request header 'Content-Type': 'text/p3'");
}
@@ -118,21 +118,21 @@ public class ContentTypeTest {
public void b02_restMethodWithParsersSerializers_invalid() throws Exception {
b.put("/b?noTrace=true", null)
.run()
- .assertStatus().is(415)
+ .assertStatusCode().is(415)
.assertBody().contains(
"Unsupported media-type in request header 'Content-Type': 'text/p2'",
"Supported media-types: ['text/p3']"
);
b.put("/b?noTrace=true", null).contentType("text/p1")
.run()
- .assertStatus().is(415)
+ .assertStatusCode().is(415)
.assertBody().contains(
"Unsupported media-type in request header 'Content-Type': 'text/p1'",
"Supported media-types: ['text/p3']"
);
b.put("/b?noTrace=true", null).contentType("text/p2")
.run()
- .assertStatus().is(415)
+ .assertStatusCode().is(415)
.assertBody().contains(
"Unsupported media-type in request header 'Content-Type': 'text/p2'",
"Supported media-types: ['text/p3']"
@@ -168,7 +168,7 @@ public class ContentTypeTest {
public void c02_restMethodAddParsersSerializersInherit_invalid() throws Exception {
c.put("/c?noTrace=true", null).contentType("text/p4")
.run()
- .assertStatus().is(415)
+ .assertStatusCode().is(415)
.assertBody().contains(
"Unsupported media-type in request header 'Content-Type': 'text/p4'",
"Supported media-types: ['text/p3','text/p1','text/p2']"
@@ -207,7 +207,7 @@ public class ContentTypeTest {
e.put("/e?noTrace=true", null)
.contentType("text/p1")
.run()
- .assertStatus().is(415)
+ .assertStatusCode().is(415)
.assertBody().contains(
"Unsupported media-type in request header 'Content-Type': 'text/p1'",
"Supported media-types: ['text/p3']"
@@ -215,7 +215,7 @@ public class ContentTypeTest {
e.put("/e?noTrace=true", null)
.contentType("text/p2")
.run()
- .assertStatus().is(415)
+ .assertStatusCode().is(415)
.assertBody().contains(
"Unsupported media-type in request header 'Content-Type': 'text/p2'",
"Supported media-types: ['text/p3']"
diff --git a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/responses/BasicTest.java b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/responses/BasicTest.java
index 04ed8c6..8b02e46 100644
--- a/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/responses/BasicTest.java
+++ b/juneau-rest/juneau-rest-server-utest/src/test/java/org/apache/juneau/rest/responses/BasicTest.java
@@ -65,154 +65,154 @@ public class BasicTest {
public void a01_accepted() throws Exception {
a.get("/accepted")
.run()
- .assertStatus().is(202)
+ .assertStatusCode().is(202)
.assertBody().is("Accepted");
}
@Test
public void a02_alreadyReported() throws Exception {
a.get("/alreadyReported")
.run()
- .assertStatus().is(208)
+ .assertStatusCode().is(208)
.assertBody().is("Already Reported");
}
@Test
public void a03_continue() throws Exception {
a.get("/continue")
.run()
- .assertStatus().is(100)
+ .assertStatusCode().is(100)
.assertBody().is("Continue");
}
@Test
public void a04_created() throws Exception {
a.get("/created")
.run()
- .assertStatus().is(201)
+ .assertStatusCode().is(201)
.assertBody().is("Created");
}
@Test
public void a05_earlyHints() throws Exception {
a.get("/earlyHints")
.run()
- .assertStatus().is(103)
+ .assertStatusCode().is(103)
.assertBody().is("Early Hints");
}
@Test
public void a06_found() throws Exception {
a.get("/found")
.run()
- .assertStatus().is(302)
+ .assertStatusCode().is(302)
.assertBody().is("Found");
}
@Test
public void a07_imUsed() throws Exception {
a.get("/imUsed")
.run()
- .assertStatus().is(226)
+ .assertStatusCode().is(226)
.assertBody().is("IM Used");
}
@Test
public void a08_movedPermanently() throws Exception {
a.get("/movedPermanently")
.run()
- .assertStatus().is(301)
+ .assertStatusCode().is(301)
.assertBody().is("Moved Permanently");
}
@Test
public void a09_multipleChoices() throws Exception {
a.get("/multipleChoices")
.run()
- .assertStatus().is(300)
+ .assertStatusCode().is(300)
.assertBody().is("Multiple Choices");
}
@Test
public void a10_multiStatus() throws Exception {
a.get("/multiStatus")
.run()
- .assertStatus().is(207)
+ .assertStatusCode().is(207)
.assertBody().is("Multi-Status");
}
@Test
public void a11_noContent() throws Exception {
a.get("/noContent")
.run()
- .assertStatus().is(204)
+ .assertStatusCode().is(204)
.assertBody().is("No Content");
}
@Test
public void a12_nonAuthoritiveInformation() throws Exception {
a.get("/nonAuthoritiveInformation")
.run()
- .assertStatus().is(203)
+ .assertStatusCode().is(203)
.assertBody().is("Non-Authoritative Information");
}
@Test
public void a13_notModified() throws Exception {
a.get("/notModified")
.run()
- .assertStatus().is(304)
+ .assertStatusCode().is(304)
.assertBody().is("Not Modified");
}
@Test
public void a14_ok() throws Exception {
a.get("/ok")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("OK");
}
@Test
public void a15_partialContent() throws Exception {
a.get("/partialContent")
.run()
- .assertStatus().is(206)
+ .assertStatusCode().is(206)
.assertBody().is("Partial Content");
}
@Test
public void a16_permanentRedirect() throws Exception {
a.get("/permanentRedirect")
.run()
- .assertStatus().is(308)
+ .assertStatusCode().is(308)
.assertBody().is("Permanent Redirect");
}
@Test
public void a17_processing() throws Exception {
a.get("/processing")
.run()
- .assertStatus().is(102)
+ .assertStatusCode().is(102)
.assertBody().is("Processing");
}
@Test
public void a18_resetContent() throws Exception {
a.get("/resetContent")
.run()
- .assertStatus().is(205)
+ .assertStatusCode().is(205)
.assertBody().is("Reset Content");
}
@Test
public void a19_seeOther() throws Exception {
a.get("/seeOther")
.run()
- .assertStatus().is(303)
+ .assertStatusCode().is(303)
.assertBody().is("See Other");
}
@Test
public void a20_switchingProtocols() throws Exception {
a.get("/switchingProtocols")
.run()
- .assertStatus().is(101)
+ .assertStatusCode().is(101)
.assertBody().is("Switching Protocols");
}
@Test
public void a21_temporaryRedirect() throws Exception {
a.get("/temporaryRedirect")
.run()
- .assertStatus().is(307)
+ .assertStatusCode().is(307)
.assertBody().is("Temporary Redirect");
}
@Test
public void a22_useProxy() throws Exception {
a.get("/useProxy")
.run()
- .assertStatus().is(305)
+ .assertStatusCode().is(305)
.assertBody().is("Use Proxy");
}
@@ -234,28 +234,28 @@ public class BasicTest {
public void b01_movedPermanently() throws Exception {
b.get("/movedPermanently")
.run()
- .assertStatus().is(301)
+ .assertStatusCode().is(301)
.assertBody().is("Moved Permanently").assertHeader("Location").is("/foo");
}
@Test
public void b02_permanentRedirect() throws Exception {
b.get("/permanentRedirect")
.run()
- .assertStatus().is(308)
+ .assertStatusCode().is(308)
.assertBody().is("Permanent Redirect").assertHeader("Location").is("/foo");
}
@Test
public void b03_seeOther() throws Exception {
b.get("/seeOther")
.run()
- .assertStatus().is(303)
+ .assertStatusCode().is(303)
.assertBody().is("See Other").assertHeader("Location").is("/foo");
}
@Test
public void b04_temporaryRedirect() throws Exception {
b.get("/temporaryRedirect")
.run()
- .assertStatus().is(307)
+ .assertStatusCode().is(307)
.assertBody().is("Temporary Redirect").assertHeader("Location").is("/foo");
}
@@ -295,154 +295,154 @@ public class BasicTest {
public void c01_accepted() throws Exception {
c.get("/accepted")
.run()
- .assertStatus().is(202)
+ .assertStatusCode().is(202)
.assertBody().is("foo");
}
@Test
public void c02_alreadyReported() throws Exception {
c.get("/alreadyReported")
.run()
- .assertStatus().is(208)
+ .assertStatusCode().is(208)
.assertBody().is("foo");
}
@Test
public void c03_continue() throws Exception {
c.get("/continue")
.run()
- .assertStatus().is(100)
+ .assertStatusCode().is(100)
.assertBody().is("foo");
}
@Test
public void c04_created() throws Exception {
c.get("/created")
.run()
- .assertStatus().is(201)
+ .assertStatusCode().is(201)
.assertBody().is("foo");
}
@Test
public void c05_earlyHints() throws Exception {
c.get("/earlyHints")
.run()
- .assertStatus().is(103)
+ .assertStatusCode().is(103)
.assertBody().is("foo");
}
@Test
public void c06_found() throws Exception {
c.get("/found")
.run()
- .assertStatus().is(302)
+ .assertStatusCode().is(302)
.assertBody().is("foo");
}
@Test
public void c07_imUsed() throws Exception {
c.get("/imUsed")
.run()
- .assertStatus().is(226)
+ .assertStatusCode().is(226)
.assertBody().is("foo");
}
@Test
public void c08_movedPermanently() throws Exception {
c.get("/movedPermanently")
.run()
- .assertStatus().is(301)
+ .assertStatusCode().is(301)
.assertBody().is("foo");
}
@Test
public void c09_multipleChoices() throws Exception {
c.get("/multipleChoices")
.run()
- .assertStatus().is(300)
+ .assertStatusCode().is(300)
.assertBody().is("foo");
}
@Test
public void c10_multiStatus() throws Exception {
c.get("/multiStatus")
.run()
- .assertStatus().is(207)
+ .assertStatusCode().is(207)
.assertBody().is("foo");
}
@Test
public void c11_noContent() throws Exception {
c.get("/noContent")
.run()
- .assertStatus().is(204)
+ .assertStatusCode().is(204)
.assertBody().is("foo");
}
@Test
public void c12_nonAuthoritiveInformation() throws Exception {
c.get("/nonAuthoritiveInformation")
.run()
- .assertStatus().is(203)
+ .assertStatusCode().is(203)
.assertBody().is("foo");
}
@Test
public void c13_notModified() throws Exception {
c.get("/notModified")
.run()
- .assertStatus().is(304)
+ .assertStatusCode().is(304)
.assertBody().is("foo");
}
@Test
public void c14_ok() throws Exception {
c.get("/ok")
.run()
- .assertStatus().is(200)
+ .assertStatusCode().is(200)
.assertBody().is("foo");
}
@Test
public void c15_partialContent() throws Exception {
c.get("/partialContent")
.run()
- .assertStatus().is(206)
+ .assertStatusCode().is(206)
.assertBody().is("foo");
}
@Test
public void c16_permanentRedirect() throws Exception {
c.get("/permanentRedirect")
.run()
- .assertStatus().is(308)
+ .assertStatusCode().is(308)
.assertBody().is("foo");
}
@Test
public void c17_processing() throws Exception {
c.get("/processing")
.run()
- .assertStatus().is(102)
+ .assertStatusCode().is(102)
.assertBody().is("foo");
}
@Test
public void c18_resetContent() throws Exception {
c.get("/resetContent")
.run()
- .assertStatus().is(205)
+ .assertStatusCode().is(205)
.assertBody().is("foo");
}
@Test
public void c19_seeOther() throws Exception {
c.get("/seeOther")
.run()
- .assertStatus().is(303)
+ .assertStatusCode().is(303)
.assertBody().is("foo");
}
@Test
public void c20_switchingProtocols() throws Exception {
c.get("/switchingProtocols")
.run()
- .assertStatus().is(101)
+ .assertStatusCode().is(101)
.assertBody().is("foo");
}
@Test
public void c21_temporaryRedirect() throws Exception {
c.get("/temporaryRedirect")
.run()
- .assertStatus().is(307)
+ .assertStatusCode().is(307)
.assertBody().is("foo");
}
@Test
public void c22_useProxy() throws Exception {
c.get("/useProxy")
.run()
- .assertStatus().is(305)
+ .assertStatusCode().is(305)
.assertBody().is("foo");
}
@@ -461,7 +461,7 @@ public class BasicTest {
public void d01_accepted() throws Exception {
d.get("/accepted").json()
.run()
- .assertStatus().is(202)
+ .assertStatusCode().is(202)
.assertBody().is("'foo'");
}