Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormParameterEncoder: Handle correctly when style is deepObject, spaceDelimited, pipeDelimited #231

Merged
merged 1 commit into from
May 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void getPosts_IdsType_Is_NotArray() {
Response response =
given()
.baseUri( forTestServer())
.queryParam( "ids", "n,-879,b,-720,kmfrupntmmanfxx,Y;;")
.queryParam( "ids", "n|-879|b|-720|kmfrupntmmanfxx|Y;;")
.when()
.request( "GET", "/posts")
.then()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void headPost_UserAttributesDefined_Is_Yes() {
given()
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "post?[post references]", "0,1")
.queryParam( "user attributes[user type]", "Typical User")
.queryParam( "user attributes", "user type,Typical User")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -51,7 +51,7 @@ public void headPost_UserAttributesValuePropertiesUserTypeValue_Is_VIP() {
given()
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "post?[post references]", "1,2")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -70,7 +70,7 @@ public void headPost_PostValuePropertiesPostReferencesItemsContainsValue_Is_2()
given()
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "post?[post references]", "2,1")
.queryParam( "user attributes[user type]", "Typical User")
.queryParam( "user attributes", "user type,Typical User")
.when()
.request( "HEAD", "/post")
.then()
Expand Down Expand Up @@ -148,6 +148,7 @@ public void headPost_UserAttributesValuePropertiesUserTypeDefined_Is_No() {
given()
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "post?[post references]", "0,2")
.queryParam( "user attributes", "")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -167,7 +168,7 @@ public void headPost_UserAttributesValuePropertiesUserTypeType_Is_Null() {
given()
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "post?[post references]", "0,2")
.queryParam( "user attributes[user type]", (String) null)
.queryParam( "user attributes", "user type,")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -187,7 +188,7 @@ public void headPost_UserAttributesValuePropertiesUserTypeValue_Is_Other() {
given()
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "post?[post references]", "0,1")
.queryParam( "user attributes[user type]", "*76s/1*r")
.queryParam( "user attributes", "user type,*76s/1*r")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -207,10 +208,7 @@ public void headPost_UserAttributesValuePropertiesAdditional_Is_Yes() {
given()
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "post?[post references]", "0,2")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes[wfgawhzebqxw]", "-993.3")
.queryParam( "user attributes[bt]", "-646")
.queryParam( "user attributes[d]", "429")
.queryParam( "user attributes", "user type,VIP!,wfgawhzebqxw,-993.3,bt,-646,d,429")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -229,7 +227,7 @@ public void headPost_PostDefined_Is_No() {
Response response =
given()
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -249,7 +247,7 @@ public void headPost_PostType_Is_Null() {
given()
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "post?", (String) null)
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -269,7 +267,7 @@ public void headPost_PostType_Is_NotObject() {
given()
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "post?", "-689.9")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -288,7 +286,7 @@ public void headPost_PostValuePropertiesPostReferencesDefined_Is_No() {
Response response =
given()
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -308,7 +306,7 @@ public void headPost_PostValuePropertiesPostReferencesType_Is_Null() {
given()
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "post?[post references]", (String) null)
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -328,7 +326,7 @@ public void headPost_PostValuePropertiesPostReferencesType_Is_NotArray() {
given()
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "post?[post references]", "true")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -348,7 +346,7 @@ public void headPost_PostValuePropertiesPostReferencesItemsSize_Is_1() {
given()
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "post?[post references]", "0")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -368,7 +366,7 @@ public void headPost_PostValuePropertiesPostReferencesItemsSize_Is_3() {
given()
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "post?[post references]", "0,1,2")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -388,7 +386,7 @@ public void headPost_PostValuePropertiesPostReferencesItemsContainsType_Is_Null(
given()
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "post?[post references]", ",1")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -408,7 +406,7 @@ public void headPost_PostValuePropertiesPostReferencesItemsContainsType_Is_NotIn
given()
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "post?[post references]", ",,NU,2")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -428,7 +426,7 @@ public void headPost_PostValuePropertiesPostReferencesItemsContainsValue_Is_Othe
given()
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "post?[post references]", "518413185,0")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -448,7 +446,7 @@ public void headPost_PostValuePropertiesPostReferencesItemsUnique_Is_No() {
given()
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "post?[post references]", "0,0")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -469,7 +467,7 @@ public void headPost_PostValuePropertiesAdditional_Is_Yes() {
.baseUri( forTestServer( "http://localhost:12306"))
.queryParam( "post?[post references]", "0,1")
.queryParam( "post?[pfuxkykifiozux]", "g\"YtKR,&")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public void headPost_UserAttributesDefined_Is_Yes() {
given()
.baseUri( forTestServer())
.queryParam( "post?[post references]", "0,1")
.queryParam( "user attributes[user type]", "Typical User")
.queryParam( "user attributes", "user type,Typical User")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -27,7 +27,7 @@ public void headPost_UserAttributesValuePropertiesUserTypeValue_Is_VIP() {
given()
.baseUri( forTestServer())
.queryParam( "post?[post references]", "1,2")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -40,7 +40,7 @@ public void headPost_PostValuePropertiesPostReferencesItemsContainsValue_Is_2()
given()
.baseUri( forTestServer())
.queryParam( "post?[post references]", "2,1")
.queryParam( "user attributes[user type]", "Typical User")
.queryParam( "user attributes", "user type,Typical User")
.when()
.request( "HEAD", "/post")
.then()
Expand Down Expand Up @@ -94,6 +94,7 @@ public void headPost_UserAttributesValuePropertiesUserTypeDefined_Is_No() {
given()
.baseUri( forTestServer())
.queryParam( "post?[post references]", "0,2")
.queryParam( "user attributes", "")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -107,7 +108,7 @@ public void headPost_UserAttributesValuePropertiesUserTypeType_Is_Null() {
given()
.baseUri( forTestServer())
.queryParam( "post?[post references]", "0,2")
.queryParam( "user attributes[user type]", (String) null)
.queryParam( "user attributes", "user type,")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -121,7 +122,7 @@ public void headPost_UserAttributesValuePropertiesUserTypeValue_Is_Other() {
given()
.baseUri( forTestServer())
.queryParam( "post?[post references]", "0,1")
.queryParam( "user attributes[user type]", "*76s/1*r")
.queryParam( "user attributes", "user type,*76s/1*r")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -135,10 +136,7 @@ public void headPost_UserAttributesValuePropertiesAdditional_Is_Yes() {
given()
.baseUri( forTestServer())
.queryParam( "post?[post references]", "0,2")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes[wfgawhzebqxw]", "-993.3")
.queryParam( "user attributes[bt]", "-646")
.queryParam( "user attributes[d]", "429")
.queryParam( "user attributes", "user type,VIP!,wfgawhzebqxw,-993.3,bt,-646,d,429")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -151,7 +149,7 @@ public void headPost_UserAttributesValuePropertiesAdditional_Is_Yes() {
public void headPost_PostDefined_Is_No() {
given()
.baseUri( forTestServer())
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -165,7 +163,7 @@ public void headPost_PostType_Is_Null() {
given()
.baseUri( forTestServer())
.queryParam( "post?", (String) null)
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -179,7 +177,7 @@ public void headPost_PostType_Is_NotObject() {
given()
.baseUri( forTestServer())
.queryParam( "post?", "-689.9")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -192,7 +190,7 @@ public void headPost_PostType_Is_NotObject() {
public void headPost_PostValuePropertiesPostReferencesDefined_Is_No() {
given()
.baseUri( forTestServer())
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -206,7 +204,7 @@ public void headPost_PostValuePropertiesPostReferencesType_Is_Null() {
given()
.baseUri( forTestServer())
.queryParam( "post?[post references]", (String) null)
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -220,7 +218,7 @@ public void headPost_PostValuePropertiesPostReferencesType_Is_NotArray() {
given()
.baseUri( forTestServer())
.queryParam( "post?[post references]", "true")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -234,7 +232,7 @@ public void headPost_PostValuePropertiesPostReferencesItemsSize_Is_1() {
given()
.baseUri( forTestServer())
.queryParam( "post?[post references]", "0")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -248,7 +246,7 @@ public void headPost_PostValuePropertiesPostReferencesItemsSize_Is_3() {
given()
.baseUri( forTestServer())
.queryParam( "post?[post references]", "0,1,2")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -262,7 +260,7 @@ public void headPost_PostValuePropertiesPostReferencesItemsContainsType_Is_Null(
given()
.baseUri( forTestServer())
.queryParam( "post?[post references]", ",1")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -276,7 +274,7 @@ public void headPost_PostValuePropertiesPostReferencesItemsContainsType_Is_NotIn
given()
.baseUri( forTestServer())
.queryParam( "post?[post references]", ",,NU,2")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -290,7 +288,7 @@ public void headPost_PostValuePropertiesPostReferencesItemsContainsValue_Is_Othe
given()
.baseUri( forTestServer())
.queryParam( "post?[post references]", "518413185,0")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -304,7 +302,7 @@ public void headPost_PostValuePropertiesPostReferencesItemsUnique_Is_No() {
given()
.baseUri( forTestServer())
.queryParam( "post?[post references]", "0,0")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -319,7 +317,7 @@ public void headPost_PostValuePropertiesAdditional_Is_Yes() {
.baseUri( forTestServer())
.queryParam( "post?[post references]", "0,1")
.queryParam( "post?[pfuxkykifiozux]", "g\"YtKR,&")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void headPost_UserAttributesDefined_Is_Yes() {
given()
.baseUri( forTestServer())
.queryParam( "post?[post references]", "0,1")
.queryParam( "user attributes[user type]", "Typical User")
.queryParam( "user attributes", "user type,Typical User")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -44,7 +44,7 @@ public void headPost_UserAttributesValuePropertiesUserTypeValue_Is_VIP() {
given()
.baseUri( forTestServer())
.queryParam( "post?[post references]", "1,0")
.queryParam( "user attributes[user type]", "VIP!")
.queryParam( "user attributes", "user type,VIP!")
.when()
.request( "HEAD", "/post")
.then()
Expand All @@ -63,7 +63,7 @@ public void headPost_PostValuePropertiesPostReferencesItemsContainsValue_Is_2()
given()
.baseUri( forTestServer())
.queryParam( "post?[post references]", "2,1")
.queryParam( "user attributes[user type]", "Typical User")
.queryParam( "user attributes", "user type,Typical User")
.when()
.request( "HEAD", "/post")
.then()
Expand Down
Loading