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

test(auto-rules): Add POST rule itests #571

Merged
merged 8 commits into from
Jul 19, 2021

Conversation

jan-law
Copy link
Contributor

@jan-law jan-law commented Jul 13, 2021

Related #474

Adds integration tests to cover 4xx status codes defined by RulesPostHandler.java.

@jan-law jan-law changed the title Add POST rule itests test(auto-rules): Add POST rule itests Jul 13, 2021
@jan-law jan-law force-pushed the add-rules-post-itest branch from b8dbd9b to 46d2637 Compare July 14, 2021 19:25
@jan-law
Copy link
Contributor Author

jan-law commented Jul 14, 2021

Note: When using sendForm() to POST a new rule, Vertx will set the Content-Type header to application/x-www-form-urlencoded, unless you specify multipart/form-data. Any attempts to overwrite the Content-Type with an invalid value will be overridden with application/x-www-form-urlencoded.

void sendForm(MultiMap body,
              Handler<AsyncResult<HttpResponse<T>>> handler)

Like send(Handler) but with an HTTP request body multimap encoded as form and the content type set to application/x-www-form-urlencoded.
When the content type header is previously set to multipart/form-data it will be used instead.

Parameters:
body - the body

However, POSTing a rule with JSON allows me to test invalid mimes, as Vertx won't check the Content-Type header when calling sendJsonObject().

default Future<HttpResponse<T>> sendJsonObject(JsonObject body)

Parameters:
body - the body

@jan-law jan-law force-pushed the add-rules-post-itest branch 2 times, most recently from 5301700 to 5f81c24 Compare July 15, 2021 19:04
@jan-law jan-law marked this pull request as ready for review July 15, 2021 19:31
@jan-law jan-law requested a review from andrewazores July 15, 2021 20:10
@jan-law jan-law force-pushed the add-rules-post-itest branch from 7346d42 to e0d9fe6 Compare July 19, 2021 14:41
@andrewazores
Copy link
Member

Looks good otherwise.

@andrewazores andrewazores merged commit f7990fc into cryostatio:main Jul 19, 2021
@jan-law jan-law deleted the add-rules-post-itest branch July 19, 2021 18:26
aali309 pushed a commit to aali309/cryostat-legacy that referenced this pull request Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants