-
Notifications
You must be signed in to change notification settings - Fork 0
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
Hoist up Node Gradle plugin, set TestTomcat baseDir, add hasContentType matcher, HTTP status consts #3
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mbland
force-pushed
the
test-matchers
branch
from
November 25, 2023 22:49
f0a66d7
to
8f4444c
Compare
Closing and reopening to try to trigger checks... |
Reopening to trigger checks... |
mbland
force-pushed
the
test-matchers
branch
from
November 25, 2023 22:51
8f4444c
to
a7a838f
Compare
Switched the branch protection rule to use actions from "GitHub Actions" instead of "any source" to see if that'll trigger the build... |
And reopening again... |
settings.gradle.kts seems a better place to specify the versions of Gradle plugins than in the project specific build.gradle.kts files.
This is in preparation for possibly launching a TestTomcat per test method, instead of per test fixture/suite. I found out that trying to dynamically create a baseDir for each instance led to the first instance's baseDir reappearing. I haven't been able to see clearly how this is happening, but it seems that: 1. The baseDir isn't strictly necessary in our case, since we're not running JSPs. 2. Using the same build/test-tomcat baseDir for all instances and having each instance delete it when finished isn't breaking anything.
mbland
force-pushed
the
test-matchers
branch
from
November 25, 2023 23:03
a7a838f
to
e6c5bb6
Compare
This matcher removes a lot of boilerplate from checking the Content-Type of a HttpResponse. It's based on the Hamcrest API with the help of these tutorials: - https://hamcrest.org/JavaHamcrest/tutorial - https://www.baeldung.com/hamcrest-custom-matchers This could be generalized to handle any header. However, I want to keep it straightforward for now, as a good basic example of how to write a custom matcher. Also took the opportunity to replace bare HTTP status codes (200, et. al.) with constants defined on jakarta.servlet.http.HttpServletResponse.
mbland
force-pushed
the
test-matchers
branch
from
November 25, 2023 23:04
e6c5bb6
to
d0cd79e
Compare
I'll try closing and reopening... |
...one more time... |
OK, I'll close this one and reopen a new one to see if that helps. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Combining several small touch up changes in one:
Hoist Node Gradle plugin up to settings.gradle.kts
settings.gradle.kts
seems a better place to specify the versions of Gradle plugins than in the project specificbuild.gradle.kts
files.Set TestTomcat baseDir explicitly
This is in preparation for possibly launching a TestTomcat per test method, instead of per test fixture/suite.
I found out that trying to dynamically create a baseDir for each instance led to the first instance's baseDir reappearing. I haven't been able to see clearly how this is happening, but it seems that:
Add hasContentType matcher, HTTP status consts
This matcher removes a lot of boilerplate from checking the Content-Type of a HttpResponse. It's based on the Hamcrest API with the help of these tutorials:
This could be generalized to handle any header. However, I want to keep it straightforward for now, as a good basic example of how to write a custom matcher.
Also took the opportunity to replace bare HTTP status codes (200, et. al.) with constants defined on jakarta.servlet.http.HttpServletResponse.